<!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>[48937] trunk/tests/phpunit: Tests: First pass at using `assertSame()` instead of `assertEquals()` in most of the unit tests.</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/48937">48937</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/48937","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>2020-09-02 00:35:36 +0000 (Wed, 02 Sep 2020)</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: First pass at using `assertSame()` instead of `assertEquals()` in most of the unit tests.
This ensures that not only the return values match the expected results, but also that their type is the same.
Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.
Props johnbillion, jrf, SergeyBiryukov.
See <a href="https://core.trac.wordpress.org/ticket/38266">#38266</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunktestsphpunitincludesabstracttestcasephp">trunk/tests/phpunit/includes/abstract-testcase.php</a></li>
<li><a href="#trunktestsphpunittestsactionscallbacksphp">trunk/tests/phpunit/tests/actions/callbacks.php</a></li>
<li><a href="#trunktestsphpunittestsactionsphp">trunk/tests/phpunit/tests/actions.php</a></li>
<li><a href="#trunktestsphpunittestsadminincludesCommunityEventsphp">trunk/tests/phpunit/tests/admin/includesCommunityEvents.php</a></li>
<li><a href="#trunktestsphpunittestsadminincludesFilephp">trunk/tests/phpunit/tests/admin/includesFile.php</a></li>
<li><a href="#trunktestsphpunittestsadminincludesMiscphp">trunk/tests/phpunit/tests/admin/includesMisc.php</a></li>
<li><a href="#trunktestsphpunittestsadminincludesPluginphp">trunk/tests/phpunit/tests/admin/includesPlugin.php</a></li>
<li><a href="#trunktestsphpunittestsadminincludesPostphp">trunk/tests/phpunit/tests/admin/includesPost.php</a></li>
<li><a href="#trunktestsphpunittestsadminincludesSchemaphp">trunk/tests/phpunit/tests/admin/includesSchema.php</a></li>
<li><a href="#trunktestsphpunittestsadminincludesScreenphp">trunk/tests/phpunit/tests/admin/includesScreen.php</a></li>
<li><a href="#trunktestsphpunittestsadminincludesThemephp">trunk/tests/phpunit/tests/admin/includesTheme.php</a></li>
<li><a href="#trunktestsphpunittestsadminbarphp">trunk/tests/phpunit/tests/adminbar.php</a></li>
<li><a href="#trunktestsphpunittestsajaxAddMetaphp">trunk/tests/phpunit/tests/ajax/AddMeta.php</a></li>
<li><a href="#trunktestsphpunittestsajaxAttachmentsphp">trunk/tests/phpunit/tests/ajax/Attachments.php</a></li>
<li><a href="#trunktestsphpunittestsajaxCompressionphp">trunk/tests/phpunit/tests/ajax/Compression.php</a></li>
<li><a href="#trunktestsphpunittestsajaxCustomizeManagerphp">trunk/tests/phpunit/tests/ajax/CustomizeManager.php</a></li>
<li><a href="#trunktestsphpunittestsajaxCustomizeMenusphp">trunk/tests/phpunit/tests/ajax/CustomizeMenus.php</a></li>
<li><a href="#trunktestsphpunittestsajaxDeleteCommentphp">trunk/tests/phpunit/tests/ajax/DeleteComment.php</a></li>
<li><a href="#trunktestsphpunittestsajaxDimCommentphp">trunk/tests/phpunit/tests/ajax/DimComment.php</a></li>
<li><a href="#trunktestsphpunittestsajaxEditCommentphp">trunk/tests/phpunit/tests/ajax/EditComment.php</a></li>
<li><a href="#trunktestsphpunittestsajaxGetCommentsphp">trunk/tests/phpunit/tests/ajax/GetComments.php</a></li>
<li><a href="#trunktestsphpunittestsajaxReplytoCommentphp">trunk/tests/phpunit/tests/ajax/ReplytoComment.php</a></li>
<li><a href="#trunktestsphpunittestsajaxTagSearchphp">trunk/tests/phpunit/tests/ajax/TagSearch.php</a></li>
<li><a href="#trunktestsphpunittestsattachmentslashesphp">trunk/tests/phpunit/tests/attachment/slashes.php</a></li>
<li><a href="#trunktestsphpunittestsauthphp">trunk/tests/phpunit/tests/auth.php</a></li>
<li><a href="#trunktestsphpunittestsavatarphp">trunk/tests/phpunit/tests/avatar.php</a></li>
<li><a href="#trunktestsphpunittestsbasicphp">trunk/tests/phpunit/tests/basic.php</a></li>
<li><a href="#trunktestsphpunittestsblocksblockcontextphp">trunk/tests/phpunit/tests/blocks/block-context.php</a></li>
<li><a href="#trunktestsphpunittestsblocksblocklistphp">trunk/tests/phpunit/tests/blocks/block-list.php</a></li>
<li><a href="#trunktestsphpunittestsblocksblockparserphp">trunk/tests/phpunit/tests/blocks/block-parser.php</a></li>
<li><a href="#trunktestsphpunittestsblocksblocktyperegistryphp">trunk/tests/phpunit/tests/blocks/block-type-registry.php</a></li>
<li><a href="#trunktestsphpunittestsblocksblocktypephp">trunk/tests/phpunit/tests/blocks/block-type.php</a></li>
<li><a href="#trunktestsphpunittestsblocksblockphp">trunk/tests/phpunit/tests/blocks/block.php</a></li>
<li><a href="#trunktestsphpunittestsblocksregisterphp">trunk/tests/phpunit/tests/blocks/register.php</a></li>
<li><a href="#trunktestsphpunittestsblocksrenderphp">trunk/tests/phpunit/tests/blocks/render.php</a></li>
<li><a href="#trunktestsphpunittestsblocksserializationphp">trunk/tests/phpunit/tests/blocks/serialization.php</a></li>
<li><a href="#trunktestsphpunittestscachephp">trunk/tests/phpunit/tests/cache.php</a></li>
<li><a href="#trunktestsphpunittestscanonicalhttpsphp">trunk/tests/phpunit/tests/canonical/https.php</a></li>
<li><a href="#trunktestsphpunittestscanonicalphp">trunk/tests/phpunit/tests/canonical.php</a></li>
<li><a href="#trunktestsphpunittestscategoryphp">trunk/tests/phpunit/tests/category.php</a></li>
<li><a href="#trunktestsphpunittestscommentdateQueryphp">trunk/tests/phpunit/tests/comment/dateQuery.php</a></li>
<li><a href="#trunktestsphpunittestscommentgetCommentAuthorEmailLinkphp">trunk/tests/phpunit/tests/comment/getCommentAuthorEmailLink.php</a></li>
<li><a href="#trunktestsphpunittestscommentgetCommentAuthorUrlLinkphp">trunk/tests/phpunit/tests/comment/getCommentAuthorUrlLink.php</a></li>
<li><a href="#trunktestsphpunittestscommentgetCommentExcerptphp">trunk/tests/phpunit/tests/comment/getCommentExcerpt.php</a></li>
<li><a href="#trunktestsphpunittestscommentgetCommentsPagesCountphp">trunk/tests/phpunit/tests/comment/getCommentsPagesCount.php</a></li>
<li><a href="#trunktestsphpunittestscommentgetPageOfCommentphp">trunk/tests/phpunit/tests/comment/getPageOfComment.php</a></li>
<li><a href="#trunktestsphpunittestscommentqueryphp">trunk/tests/phpunit/tests/comment/query.php</a></li>
<li><a href="#trunktestsphpunittestscommentslashesphp">trunk/tests/phpunit/tests/comment/slashes.php</a></li>
<li><a href="#trunktestsphpunittestscommenttemplatephp">trunk/tests/phpunit/tests/comment/template.php</a></li>
<li><a href="#trunktestsphpunittestscommentwpBatchUpdateCommentTypephp">trunk/tests/phpunit/tests/comment/wpBatchUpdateCommentType.php</a></li>
<li><a href="#trunktestsphpunittestscommentwpCountCommentsphp">trunk/tests/phpunit/tests/comment/wpCountComments.php</a></li>
<li><a href="#trunktestsphpunittestscommentsubmissionphp">trunk/tests/phpunit/tests/comment-submission.php</a></li>
<li><a href="#trunktestsphpunittestscommentphp">trunk/tests/phpunit/tests/comment.php</a></li>
<li><a href="#trunktestsphpunittestscompatphp">trunk/tests/phpunit/tests/compat.php</a></li>
<li><a href="#trunktestsphpunittestscronphp">trunk/tests/phpunit/tests/cron.php</a></li>
<li><a href="#trunktestsphpunittestscustomizecustomcsssettingphp">trunk/tests/phpunit/tests/customize/custom-css-setting.php</a></li>
<li><a href="#trunktestsphpunittestscustomizemanagerphp">trunk/tests/phpunit/tests/customize/manager.php</a></li>
<li><a href="#trunktestsphpunittestscustomizenavmenuitemsettingphp">trunk/tests/phpunit/tests/customize/nav-menu-item-setting.php</a></li>
<li><a href="#trunktestsphpunittestscustomizenavmenusettingphp">trunk/tests/phpunit/tests/customize/nav-menu-setting.php</a></li>
<li><a href="#trunktestsphpunittestscustomizenavmenusphp">trunk/tests/phpunit/tests/customize/nav-menus.php</a></li>
<li><a href="#trunktestsphpunittestscustomizepanelphp">trunk/tests/phpunit/tests/customize/panel.php</a></li>
<li><a href="#trunktestsphpunittestscustomizepartialphp">trunk/tests/phpunit/tests/customize/partial.php</a></li>
<li><a href="#trunktestsphpunittestscustomizesectionphp">trunk/tests/phpunit/tests/customize/section.php</a></li>
<li><a href="#trunktestsphpunittestscustomizeselectiverefreshajaxphp">trunk/tests/phpunit/tests/customize/selective-refresh-ajax.php</a></li>
<li><a href="#trunktestsphpunittestscustomizeselectiverefreshphp">trunk/tests/phpunit/tests/customize/selective-refresh.php</a></li>
<li><a href="#trunktestsphpunittestscustomizesettingphp">trunk/tests/phpunit/tests/customize/setting.php</a></li>
<li><a href="#trunktestsphpunittestscustomizewidgetsphp">trunk/tests/phpunit/tests/customize/widgets.php</a></li>
<li><a href="#trunktestsphpunittestsdatedateI18nphp">trunk/tests/phpunit/tests/date/dateI18n.php</a></li>
<li><a href="#trunktestsphpunittestsdategetCommentDatephp">trunk/tests/phpunit/tests/date/getCommentDate.php</a></li>
<li><a href="#trunktestsphpunittestsdategetFeedBuildDatephp">trunk/tests/phpunit/tests/date/getFeedBuildDate.php</a></li>
<li><a href="#trunktestsphpunittestsdategetPermalinkphp">trunk/tests/phpunit/tests/date/getPermalink.php</a></li>
<li><a href="#trunktestsphpunittestsdategetPostTimephp">trunk/tests/phpunit/tests/date/getPostTime.php</a></li>
<li><a href="#trunktestsphpunittestsdategetTheDatephp">trunk/tests/phpunit/tests/date/getTheDate.php</a></li>
<li><a href="#trunktestsphpunittestsdategetTheModifiedDatephp">trunk/tests/phpunit/tests/date/getTheModifiedDate.php</a></li>
<li><a href="#trunktestsphpunittestsdatemaybeDeclineDatephp">trunk/tests/phpunit/tests/date/maybeDeclineDate.php</a></li>
<li><a href="#trunktestsphpunittestsdatemysql2datephp">trunk/tests/phpunit/tests/date/mysql2date.php</a></li>
<li><a href="#trunktestsphpunittestsdatequeryphp">trunk/tests/phpunit/tests/date/query.php</a></li>
<li><a href="#trunktestsphpunittestsdatetheDatephp">trunk/tests/phpunit/tests/date/theDate.php</a></li>
<li><a href="#trunktestsphpunittestsdatewpDatephp">trunk/tests/phpunit/tests/date/wpDate.php</a></li>
<li><a href="#trunktestsphpunittestsdatewpTimezonephp">trunk/tests/phpunit/tests/date/wpTimezone.php</a></li>
<li><a href="#trunktestsphpunittestsdatexmlrpcphp">trunk/tests/phpunit/tests/date/xmlrpc.php</a></li>
<li><a href="#trunktestsphpunittestsdbcharsetphp">trunk/tests/phpunit/tests/db/charset.php</a></li>
<li><a href="#trunktestsphpunittestsdbphp">trunk/tests/phpunit/tests/db.php</a></li>
<li><a href="#trunktestsphpunittestsdbdeltaphp">trunk/tests/phpunit/tests/dbdelta.php</a></li>
<li><a href="#trunktestsphpunittestsdependenciesjqueryphp">trunk/tests/phpunit/tests/dependencies/jquery.php</a></li>
<li><a href="#trunktestsphpunittestsdependenciesscriptsphp">trunk/tests/phpunit/tests/dependencies/scripts.php</a></li>
<li><a href="#trunktestsphpunittestsdependenciesstylesphp">trunk/tests/phpunit/tests/dependencies/styles.php</a></li>
<li><a href="#trunktestsphpunittestsdependenciesphp">trunk/tests/phpunit/tests/dependencies.php</a></li>
<li><a href="#trunktestsphpunittestserrorprotectionrecoverymodecookieservicephp">trunk/tests/phpunit/tests/error-protection/recovery-mode-cookie-service.php</a></li>
<li><a href="#trunktestsphpunittestserrorprotectionrecoverymodekeyservicephp">trunk/tests/phpunit/tests/error-protection/recovery-mode-key-service.php</a></li>
<li><a href="#trunktestsphpunittestsfeedatomphp">trunk/tests/phpunit/tests/feed/atom.php</a></li>
<li><a href="#trunktestsphpunittestsfeedrss2php">trunk/tests/phpunit/tests/feed/rss2.php</a></li>
<li><a href="#trunktestsphpunittestsfilephp">trunk/tests/phpunit/tests/file.php</a></li>
<li><a href="#trunktestsphpunittestsfilesystemfindFolderphp">trunk/tests/phpunit/tests/filesystem/findFolder.php</a></li>
<li><a href="#trunktestsphpunittestsfiltersphp">trunk/tests/phpunit/tests/filters.php</a></li>
<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="#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="#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="#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="#trunktestsphpunittestsformattingZeroisephp">trunk/tests/phpunit/tests/formatting/Zeroise.php</a></li>
<li><a href="#trunktestsphpunittestsformattingbalanceTagsphp">trunk/tests/phpunit/tests/formatting/balanceTags.php</a></li>
<li><a href="#trunktestsphpunittestsformattingdatephp">trunk/tests/phpunit/tests/formatting/date.php</a></li>
<li><a href="#trunktestsphpunittestsformattingent2ncrphp">trunk/tests/phpunit/tests/formatting/ent2ncr.php</a></li>
<li><a href="#trunktestsphpunittestsformattingisoDescramblerphp">trunk/tests/phpunit/tests/formatting/isoDescrambler.php</a></li>
<li><a href="#trunktestsphpunittestsformattingredirectphp">trunk/tests/phpunit/tests/formatting/redirect.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionsallowedProtocolsphp">trunk/tests/phpunit/tests/functions/allowedProtocols.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionsanonymizationphp">trunk/tests/phpunit/tests/functions/anonymization.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionscanonicalCharsetphp">trunk/tests/phpunit/tests/functions/canonicalCharset.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionscleanupHeaderCommentphp">trunk/tests/phpunit/tests/functions/cleanupHeaderComment.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionsgetWeekstartendphp">trunk/tests/phpunit/tests/functions/getWeekstartend.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionsnumberFormatI18nphp">trunk/tests/phpunit/tests/functions/numberFormatI18n.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionsremoveQueryArgphp">trunk/tests/phpunit/tests/functions/removeQueryArg.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionswpGetArchivesphp">trunk/tests/phpunit/tests/functions/wpGetArchives.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionswpListFilterphp">trunk/tests/phpunit/tests/functions/wpListFilter.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionswpListUtilphp">trunk/tests/phpunit/tests/functions/wpListUtil.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionswpRemoteFopenphp">trunk/tests/phpunit/tests/functions/wpRemoteFopen.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionsphp">trunk/tests/phpunit/tests/functions.php</a></li>
<li><a href="#trunktestsphpunittestsgeneralarchivesphp">trunk/tests/phpunit/tests/general/archives.php</a></li>
<li><a href="#trunktestsphpunittestsgeneraldocumenttitlephp">trunk/tests/phpunit/tests/general/document-title.php</a></li>
<li><a href="#trunktestsphpunittestsgeneralpaginateLinksphp">trunk/tests/phpunit/tests/general/paginateLinks.php</a></li>
<li><a href="#trunktestsphpunittestsgeneralresourceHintsphp">trunk/tests/phpunit/tests/general/resourceHints.php</a></li>
<li><a href="#trunktestsphpunittestsgeneraltemplatephp">trunk/tests/phpunit/tests/general/template.php</a></li>
<li><a href="#trunktestsphpunittestsgeneralwpErrorphp">trunk/tests/phpunit/tests/general/wpError.php</a></li>
<li><a href="#trunktestsphpunittestshooksaddFilterphp">trunk/tests/phpunit/tests/hooks/addFilter.php</a></li>
<li><a href="#trunktestsphpunittestshooksapplyFiltersphp">trunk/tests/phpunit/tests/hooks/applyFilters.php</a></li>
<li><a href="#trunktestsphpunittestshooksdoActionphp">trunk/tests/phpunit/tests/hooks/doAction.php</a></li>
<li><a href="#trunktestsphpunittestshooksdoAllHookphp">trunk/tests/phpunit/tests/hooks/doAllHook.php</a></li>
<li><a href="#trunktestsphpunittestshookshasFilterphp">trunk/tests/phpunit/tests/hooks/hasFilter.php</a></li>
<li><a href="#trunktestsphpunittestshookspreinitHooksphp">trunk/tests/phpunit/tests/hooks/preinitHooks.php</a></li>
<li><a href="#trunktestsphpunittestshooksremoveAllFiltersphp">trunk/tests/phpunit/tests/hooks/removeAllFilters.php</a></li>
<li><a href="#trunktestsphpunittestshttpbasephp">trunk/tests/phpunit/tests/http/base.php</a></li>
<li><a href="#trunktestsphpunittestshttpfunctionsphp">trunk/tests/phpunit/tests/http/functions.php</a></li>
<li><a href="#trunktestsphpunittestshttphttpphp">trunk/tests/phpunit/tests/http/http.php</a></li>
<li><a href="#trunktestsphpunittestshttpremoteRetrieveHeadersphp">trunk/tests/phpunit/tests/http/remoteRetrieveHeaders.php</a></li>
<li><a href="#trunktestsphpunittestsimagebasephp">trunk/tests/phpunit/tests/image/base.php</a></li>
<li><a href="#trunktestsphpunittestsimagedimensionsphp">trunk/tests/phpunit/tests/image/dimensions.php</a></li>
<li><a href="#trunktestsphpunittestsimageeditorphp">trunk/tests/phpunit/tests/image/editor.php</a></li>
<li><a href="#trunktestsphpunittestsimageeditorGdphp">trunk/tests/phpunit/tests/image/editorGd.php</a></li>
<li><a href="#trunktestsphpunittestsimageeditorImagickphp">trunk/tests/phpunit/tests/image/editorImagick.php</a></li>
<li><a href="#trunktestsphpunittestsimagefunctionsphp">trunk/tests/phpunit/tests/image/functions.php</a></li>
<li><a href="#trunktestsphpunittestsimageheaderphp">trunk/tests/phpunit/tests/image/header.php</a></li>
<li><a href="#trunktestsphpunittestsimageintermediateSizephp">trunk/tests/phpunit/tests/image/intermediateSize.php</a></li>
<li><a href="#trunktestsphpunittestsimagemetaphp">trunk/tests/phpunit/tests/image/meta.php</a></li>
<li><a href="#trunktestsphpunittestsimageresizephp">trunk/tests/phpunit/tests/image/resize.php</a></li>
<li><a href="#trunktestsphpunittestsimageresizeGdphp">trunk/tests/phpunit/tests/image/resizeGd.php</a></li>
<li><a href="#trunktestsphpunittestsimagesiteIconphp">trunk/tests/phpunit/tests/image/siteIcon.php</a></li>
<li><a href="#trunktestsphpunittestsimportimportphp">trunk/tests/phpunit/tests/import/import.php</a></li>
<li><a href="#trunktestsphpunittestsimportparserphp">trunk/tests/phpunit/tests/import/parser.php</a></li>
<li><a href="#trunktestsphpunittestsimportpostmetaphp">trunk/tests/phpunit/tests/import/postmeta.php</a></li>
<li><a href="#trunktestsphpunittestsincludesfactoryphp">trunk/tests/phpunit/tests/includes/factory.php</a></li>
<li><a href="#trunktestsphpunittestsksesphp">trunk/tests/phpunit/tests/kses.php</a></li>
<li><a href="#trunktestsphpunittestsl10nloadScriptTextdomainphp">trunk/tests/phpunit/tests/l10n/loadScriptTextdomain.php</a></li>
<li><a href="#trunktestsphpunittestsl10nphp">trunk/tests/phpunit/tests/l10n.php</a></li>
<li><a href="#trunktestsphpunittestslinkgetAdjacentPostphp">trunk/tests/phpunit/tests/link/getAdjacentPost.php</a></li>
<li><a href="#trunktestsphpunittestslinkgetDashboardUrlphp">trunk/tests/phpunit/tests/link/getDashboardUrl.php</a></li>
<li><a href="#trunktestsphpunittestslinkgetPostCommentsFeedLinkphp">trunk/tests/phpunit/tests/link/getPostCommentsFeedLink.php</a></li>
<li><a href="#trunktestsphpunittestslinkgetPreviewPostLinkphp">trunk/tests/phpunit/tests/link/getPreviewPostLink.php</a></li>
<li><a href="#trunktestsphpunittestslinkgetPreviousCommentsLinkphp">trunk/tests/phpunit/tests/link/getPreviousCommentsLink.php</a></li>
<li><a href="#trunktestsphpunittestslinkwpGetCanonicalURLphp">trunk/tests/phpunit/tests/link/wpGetCanonicalURL.php</a></li>
<li><a href="#trunktestsphpunittestslinkphp">trunk/tests/phpunit/tests/link.php</a></li>
<li><a href="#trunktestsphpunittestslocalephp">trunk/tests/phpunit/tests/locale.php</a></li>
<li><a href="#trunktestsphpunittestsmailphp">trunk/tests/phpunit/tests/mail.php</a></li>
<li><a href="#trunktestsphpunittestsmediaphp">trunk/tests/phpunit/tests/media.php</a></li>
<li><a href="#trunktestsphpunittestsmenunavmenuphp">trunk/tests/phpunit/tests/menu/nav-menu.php</a></li>
<li><a href="#trunktestsphpunittestsmenuwpExpandNavMenuPostDataphp">trunk/tests/phpunit/tests/menu/wpExpandNavMenuPostData.php</a></li>
<li><a href="#trunktestsphpunittestsmetadeleteMetadataphp">trunk/tests/phpunit/tests/meta/deleteMetadata.php</a></li>
<li><a href="#trunktestsphpunittestsmetaqueryphp">trunk/tests/phpunit/tests/meta/query.php</a></li>
<li><a href="#trunktestsphpunittestsmetaregisterMetaphp">trunk/tests/phpunit/tests/meta/registerMeta.php</a></li>
<li><a href="#trunktestsphpunittestsmetaslashesphp">trunk/tests/phpunit/tests/meta/slashes.php</a></li>
<li><a href="#trunktestsphpunittestsmetaphp">trunk/tests/phpunit/tests/meta.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitebootstrapphp">trunk/tests/phpunit/tests/multisite/bootstrap.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitegetBlogDetailsphp">trunk/tests/phpunit/tests/multisite/getBlogDetails.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitegetIdFromBlognamephp">trunk/tests/phpunit/tests/multisite/getIdFromBlogname.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitegetSitephp">trunk/tests/phpunit/tests/multisite/getSite.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitegetSpaceAllowedphp">trunk/tests/phpunit/tests/multisite/getSpaceAllowed.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitegetSpaceUsedphp">trunk/tests/phpunit/tests/multisite/getSpaceUsed.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitemsfilesrewritingphp">trunk/tests/phpunit/tests/multisite/ms-files-rewriting.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitenetworkphp">trunk/tests/phpunit/tests/multisite/network.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitenetworkQueryphp">trunk/tests/phpunit/tests/multisite/networkQuery.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitesitephp">trunk/tests/phpunit/tests/multisite/site.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitesiteMetaphp">trunk/tests/phpunit/tests/multisite/siteMeta.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitesiteQueryphp">trunk/tests/phpunit/tests/multisite/siteQuery.php</a></li>
<li><a href="#trunktestsphpunittestsmultisiteupdateBlogDetailsphp">trunk/tests/phpunit/tests/multisite/updateBlogDetails.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitewpGetSitesphp">trunk/tests/phpunit/tests/multisite/wpGetSites.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitewpInstallDefaultsphp">trunk/tests/phpunit/tests/multisite/wpInstallDefaults.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitephp">trunk/tests/phpunit/tests/multisite.php</a></li>
<li><a href="#trunktestsphpunittestsoembedWpEmbedphp">trunk/tests/phpunit/tests/oembed/WpEmbed.php</a></li>
<li><a href="#trunktestsphpunittestsoembedcontrollerphp">trunk/tests/phpunit/tests/oembed/controller.php</a></li>
<li><a href="#trunktestsphpunittestsoembeddiscoveryphp">trunk/tests/phpunit/tests/oembed/discovery.php</a></li>
<li><a href="#trunktestsphpunittestsoembedfilterResultphp">trunk/tests/phpunit/tests/oembed/filterResult.php</a></li>
<li><a href="#trunktestsphpunittestsoembedgetResponseDataphp">trunk/tests/phpunit/tests/oembed/getResponseData.php</a></li>
<li><a href="#trunktestsphpunittestsoembedpostEmbedUrlphp">trunk/tests/phpunit/tests/oembed/postEmbedUrl.php</a></li>
<li><a href="#trunktestsphpunittestsoembedtemplatephp">trunk/tests/phpunit/tests/oembed/template.php</a></li>
<li><a href="#trunktestsphpunittestsoembedwpOembedphp">trunk/tests/phpunit/tests/oembed/wpOembed.php</a></li>
<li><a href="#trunktestsphpunittestsoptionmultisitephp">trunk/tests/phpunit/tests/option/multisite.php</a></li>
<li><a href="#trunktestsphpunittestsoptionnetworkOptionphp">trunk/tests/phpunit/tests/option/networkOption.php</a></li>
<li><a href="#trunktestsphpunittestsoptionoptionphp">trunk/tests/phpunit/tests/option/option.php</a></li>
<li><a href="#trunktestsphpunittestsoptionregistrationphp">trunk/tests/phpunit/tests/option/registration.php</a></li>
<li><a href="#trunktestsphpunittestsoptionsanitizeoptionphp">trunk/tests/phpunit/tests/option/sanitize-option.php</a></li>
<li><a href="#trunktestsphpunittestsoptionsiteOptionphp">trunk/tests/phpunit/tests/option/siteOption.php</a></li>
<li><a href="#trunktestsphpunittestsoptionsiteTransientphp">trunk/tests/phpunit/tests/option/siteTransient.php</a></li>
<li><a href="#trunktestsphpunittestsoptionslashesphp">trunk/tests/phpunit/tests/option/slashes.php</a></li>
<li><a href="#trunktestsphpunittestsoptionthemeModsphp">trunk/tests/phpunit/tests/option/themeMods.php</a></li>
<li><a href="#trunktestsphpunittestsoptiontransientphp">trunk/tests/phpunit/tests/option/transient.php</a></li>
<li><a href="#trunktestsphpunittestsoptionupdateOptionphp">trunk/tests/phpunit/tests/option/updateOption.php</a></li>
<li><a href="#trunktestsphpunittestsoptionuserSettingsphp">trunk/tests/phpunit/tests/option/userSettings.php</a></li>
<li><a href="#trunktestsphpunittestsoptionwpLoadAllOptionsphp">trunk/tests/phpunit/tests/option/wpLoadAllOptions.php</a></li>
<li><a href="#trunktestsphpunittestspomomophp">trunk/tests/phpunit/tests/pomo/mo.php</a></li>
<li><a href="#trunktestsphpunittestspomonoopTranslationsphp">trunk/tests/phpunit/tests/pomo/noopTranslations.php</a></li>
<li><a href="#trunktestsphpunittestspomopluralFormsphp">trunk/tests/phpunit/tests/pomo/pluralForms.php</a></li>
<li><a href="#trunktestsphpunittestspomopophp">trunk/tests/phpunit/tests/pomo/po.php</a></li>
<li><a href="#trunktestsphpunittestspomotranslationEntryphp">trunk/tests/phpunit/tests/pomo/translationEntry.php</a></li>
<li><a href="#trunktestsphpunittestspomotranslationsphp">trunk/tests/phpunit/tests/pomo/translations.php</a></li>
<li><a href="#trunktestsphpunittestspostattachmentsphp">trunk/tests/phpunit/tests/post/attachments.php</a></li>
<li><a href="#trunktestsphpunittestspostfilteringphp">trunk/tests/phpunit/tests/post/filtering.php</a></li>
<li><a href="#trunktestsphpunittestspostformatsphp">trunk/tests/phpunit/tests/post/formats.php</a></li>
<li><a href="#trunktestsphpunittestspostgetLastPostDatephp">trunk/tests/phpunit/tests/post/getLastPostDate.php</a></li>
<li><a href="#trunktestsphpunittestspostgetLastPostModifiedphp">trunk/tests/phpunit/tests/post/getLastPostModified.php</a></li>
<li><a href="#trunktestsphpunittestspostgetPageByPathphp">trunk/tests/phpunit/tests/post/getPageByPath.php</a></li>
<li><a href="#trunktestsphpunittestspostgetPageChildrenphp">trunk/tests/phpunit/tests/post/getPageChildren.php</a></li>
<li><a href="#trunktestsphpunittestspostgetPageUriphp">trunk/tests/phpunit/tests/post/getPageUri.php</a></li>
<li><a href="#trunktestsphpunittestspostgetPagesphp">trunk/tests/phpunit/tests/post/getPages.php</a></li>
<li><a href="#trunktestsphpunittestspostgetPostClassphp">trunk/tests/phpunit/tests/post/getPostClass.php</a></li>
<li><a href="#trunktestsphpunittestspostlistPagesphp">trunk/tests/phpunit/tests/post/listPages.php</a></li>
<li><a href="#trunktestsphpunittestspostmetaphp">trunk/tests/phpunit/tests/post/meta.php</a></li>
<li><a href="#trunktestsphpunittestspostnavmenuphp">trunk/tests/phpunit/tests/post/nav-menu.php</a></li>
<li><a href="#trunktestsphpunittestspostobjectsphp">trunk/tests/phpunit/tests/post/objects.php</a></li>
<li><a href="#trunktestsphpunittestspostoutputphp">trunk/tests/phpunit/tests/post/output.php</a></li>
<li><a href="#trunktestsphpunittestspostqueryphp">trunk/tests/phpunit/tests/post/query.php</a></li>
<li><a href="#trunktestsphpunittestspostrevisionsphp">trunk/tests/phpunit/tests/post/revisions.php</a></li>
<li><a href="#trunktestsphpunittestspostslashesphp">trunk/tests/phpunit/tests/post/slashes.php</a></li>
<li><a href="#trunktestsphpunittestsposttemplatephp">trunk/tests/phpunit/tests/post/template.php</a></li>
<li><a href="#trunktestsphpunittestspostthumbnailsphp">trunk/tests/phpunit/tests/post/thumbnails.php</a></li>
<li><a href="#trunktestsphpunittestsposttypesphp">trunk/tests/phpunit/tests/post/types.php</a></li>
<li><a href="#trunktestsphpunittestspostwpInsertPostphp">trunk/tests/phpunit/tests/post/wpInsertPost.php</a></li>
<li><a href="#trunktestsphpunittestspostwpUniquePostSlugphp">trunk/tests/phpunit/tests/post/wpUniquePostSlug.php</a></li>
<li><a href="#trunktestsphpunittestspostphp">trunk/tests/phpunit/tests/post.php</a></li>
<li><a href="#trunktestsphpunittestsqueryconditionalsphp">trunk/tests/phpunit/tests/query/conditionals.php</a></li>
<li><a href="#trunktestsphpunittestsquerydatephp">trunk/tests/phpunit/tests/query/date.php</a></li>
<li><a href="#trunktestsphpunittestsquerydateQueryphp">trunk/tests/phpunit/tests/query/dateQuery.php</a></li>
<li><a href="#trunktestsphpunittestsquerygeneratePostdataphp">trunk/tests/phpunit/tests/query/generatePostdata.php</a></li>
<li><a href="#trunktestsphpunittestsqueryisTermphp">trunk/tests/phpunit/tests/query/isTerm.php</a></li>
<li><a href="#trunktestsphpunittestsquerymetaQueryphp">trunk/tests/phpunit/tests/query/metaQuery.php</a></li>
<li><a href="#trunktestsphpunittestsqueryparseQueryphp">trunk/tests/phpunit/tests/query/parseQuery.php</a></li>
<li><a href="#trunktestsphpunittestsquerypostStatusphp">trunk/tests/phpunit/tests/query/postStatus.php</a></li>
<li><a href="#trunktestsphpunittestsqueryresultsphp">trunk/tests/phpunit/tests/query/results.php</a></li>
<li><a href="#trunktestsphpunittestsquerysearchphp">trunk/tests/phpunit/tests/query/search.php</a></li>
<li><a href="#trunktestsphpunittestsquerysetupPostdataphp">trunk/tests/phpunit/tests/query/setupPostdata.php</a></li>
<li><a href="#trunktestsphpunittestsquerystickiesphp">trunk/tests/phpunit/tests/query/stickies.php</a></li>
<li><a href="#trunktestsphpunittestsquerytaxQueryphp">trunk/tests/phpunit/tests/query/taxQuery.php</a></li>
<li><a href="#trunktestsphpunittestsqueryvarsphp">trunk/tests/phpunit/tests/query/vars.php</a></li>
<li><a href="#trunktestsphpunittestsqueryphp">trunk/tests/phpunit/tests/query.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestattachmentscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestautosavescontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-autosaves-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestblockdirectorycontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-block-directory-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestblockrenderercontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestblocktypecontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-block-type-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestblockscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-blocks-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestcategoriescontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-categories-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestcommentscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestcontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestpagescontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-pages-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestpluginscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-plugins-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestpostmetafieldsphp">trunk/tests/phpunit/tests/rest-api/rest-post-meta-fields.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestpoststatusescontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-post-statuses-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestposttypescontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-post-types-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestpostscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestrequestvalidationphp">trunk/tests/phpunit/tests/rest-api/rest-request-validation.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestrequestphp">trunk/tests/phpunit/tests/rest-api/rest-request.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestrevisionscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-revisions-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestschemasanitizationphp">trunk/tests/phpunit/tests/rest-api/rest-schema-sanitization.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestschemasetupphp">trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestschemavalidationphp">trunk/tests/phpunit/tests/rest-api/rest-schema-validation.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestsearchcontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-search-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestserverphp">trunk/tests/phpunit/tests/rest-api/rest-server.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestsettingscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-settings-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapiresttagscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-tags-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapiresttaxonomiescontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-taxonomies-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapiresttermmetafieldsphp">trunk/tests/phpunit/tests/rest-api/rest-term-meta-fields.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestthemescontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-themes-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestuserscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-users-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapiphp">trunk/tests/phpunit/tests/rest-api.php</a></li>
<li><a href="#trunktestsphpunittestsrewritenumericSlugsphp">trunk/tests/phpunit/tests/rewrite/numericSlugs.php</a></li>
<li><a href="#trunktestsphpunittestsrewriteoldSlugRedirectphp">trunk/tests/phpunit/tests/rewrite/oldSlugRedirect.php</a></li>
<li><a href="#trunktestsphpunittestsrewritephp">trunk/tests/phpunit/tests/rewrite.php</a></li>
<li><a href="#trunktestsphpunittestsshortcodephp">trunk/tests/phpunit/tests/shortcode.php</a></li>
<li><a href="#trunktestsphpunittestssitemapsfunctionsphp">trunk/tests/phpunit/tests/sitemaps/functions.php</a></li>
<li><a href="#trunktestsphpunittestssitemapssitemapspostsphp">trunk/tests/phpunit/tests/sitemaps/sitemaps-posts.php</a></li>
<li><a href="#trunktestsphpunittestssitemapssitemapstaxonomiesphp">trunk/tests/phpunit/tests/sitemaps/sitemaps-taxonomies.php</a></li>
<li><a href="#trunktestsphpunittestssitemapssitemapsphp">trunk/tests/phpunit/tests/sitemaps/sitemaps.php</a></li>
<li><a href="#trunktestsphpunitteststaxonomyphp">trunk/tests/phpunit/tests/taxonomy.php</a></li>
<li><a href="#trunktestsphpunitteststemplatephp">trunk/tests/phpunit/tests/template.php</a></li>
<li><a href="#trunktestsphpunitteststermcachephp">trunk/tests/phpunit/tests/term/cache.php</a></li>
<li><a href="#trunktestsphpunitteststermgetEditTermLinkphp">trunk/tests/phpunit/tests/term/getEditTermLink.php</a></li>
<li><a href="#trunktestsphpunitteststermgetTermphp">trunk/tests/phpunit/tests/term/getTerm.php</a></li>
<li><a href="#trunktestsphpunitteststermgetTermByphp">trunk/tests/phpunit/tests/term/getTermBy.php</a></li>
<li><a href="#trunktestsphpunitteststermgetTermParentsListphp">trunk/tests/phpunit/tests/term/getTermParentsList.php</a></li>
<li><a href="#trunktestsphpunitteststermgetTermsphp">trunk/tests/phpunit/tests/term/getTerms.php</a></li>
<li><a href="#trunktestsphpunitteststermgetTheTermsphp">trunk/tests/phpunit/tests/term/getTheTerms.php</a></li>
<li><a href="#trunktestsphpunitteststermmetaphp">trunk/tests/phpunit/tests/term/meta.php</a></li>
<li><a href="#trunktestsphpunitteststermqueryphp">trunk/tests/phpunit/tests/term/query.php</a></li>
<li><a href="#trunktestsphpunitteststermslashesphp">trunk/tests/phpunit/tests/term/slashes.php</a></li>
<li><a href="#trunktestsphpunitteststermsplitSharedTermphp">trunk/tests/phpunit/tests/term/splitSharedTerm.php</a></li>
<li><a href="#trunktestsphpunitteststermtaxQueryphp">trunk/tests/phpunit/tests/term/taxQuery.php</a></li>
<li><a href="#trunktestsphpunitteststermtermExistsphp">trunk/tests/phpunit/tests/term/termExists.php</a></li>
<li><a href="#trunktestsphpunitteststermwpDeleteTermphp">trunk/tests/phpunit/tests/term/wpDeleteTerm.php</a></li>
<li><a href="#trunktestsphpunitteststermwpGetObjectTermsphp">trunk/tests/phpunit/tests/term/wpGetObjectTerms.php</a></li>
<li><a href="#trunktestsphpunitteststermwpInsertTermphp">trunk/tests/phpunit/tests/term/wpInsertTerm.php</a></li>
<li><a href="#trunktestsphpunitteststermwpSetObjectTermsphp">trunk/tests/phpunit/tests/term/wpSetObjectTerms.php</a></li>
<li><a href="#trunktestsphpunitteststermwpUniqueTermSlugphp">trunk/tests/phpunit/tests/term/wpUniqueTermSlug.php</a></li>
<li><a href="#trunktestsphpunitteststermwpUpdateTermphp">trunk/tests/phpunit/tests/term/wpUpdateTerm.php</a></li>
<li><a href="#trunktestsphpunitteststermphp">trunk/tests/phpunit/tests/term.php</a></li>
<li><a href="#trunktestsphpunitteststhemeWPThemephp">trunk/tests/phpunit/tests/theme/WPTheme.php</a></li>
<li><a href="#trunktestsphpunitteststhemecustomHeaderphp">trunk/tests/phpunit/tests/theme/customHeader.php</a></li>
<li><a href="#trunktestsphpunitteststhemegetAllowedFiltersphp">trunk/tests/phpunit/tests/theme/getAllowedFilters.php</a></li>
<li><a href="#trunktestsphpunitteststhemegetThemeStarterContentphp">trunk/tests/phpunit/tests/theme/getThemeStarterContent.php</a></li>
<li><a href="#trunktestsphpunitteststhemesupportphp">trunk/tests/phpunit/tests/theme/support.php</a></li>
<li><a href="#trunktestsphpunitteststhemethemeDirphp">trunk/tests/phpunit/tests/theme/themeDir.php</a></li>
<li><a href="#trunktestsphpunitteststhemephp">trunk/tests/phpunit/tests/theme.php</a></li>
<li><a href="#trunktestsphpunittestsuploadphp">trunk/tests/phpunit/tests/upload.php</a></li>
<li><a href="#trunktestsphpunittestsurlphp">trunk/tests/phpunit/tests/url.php</a></li>
<li><a href="#trunktestsphpunittestsuserauthorphp">trunk/tests/phpunit/tests/user/author.php</a></li>
<li><a href="#trunktestsphpunittestsusercapabilitiesphp">trunk/tests/phpunit/tests/user/capabilities.php</a></li>
<li><a href="#trunktestsphpunittestsusercountUsersphp">trunk/tests/phpunit/tests/user/countUsers.php</a></li>
<li><a href="#trunktestsphpunittestsusergetActiveBlogForUserphp">trunk/tests/phpunit/tests/user/getActiveBlogForUser.php</a></li>
<li><a href="#trunktestsphpunittestsusermapMetaCapphp">trunk/tests/phpunit/tests/user/mapMetaCap.php</a></li>
<li><a href="#trunktestsphpunittestsusermultisitephp">trunk/tests/phpunit/tests/user/multisite.php</a></li>
<li><a href="#trunktestsphpunittestsuserqueryphp">trunk/tests/phpunit/tests/user/query.php</a></li>
<li><a href="#trunktestsphpunittestsuserslashesphp">trunk/tests/phpunit/tests/user/slashes.php</a></li>
<li><a href="#trunktestsphpunittestsuserupdateUserCachesphp">trunk/tests/phpunit/tests/user/updateUserCaches.php</a></li>
<li><a href="#trunktestsphpunittestsuserwpAuthenticateSpamCheckphp">trunk/tests/phpunit/tests/user/wpAuthenticateSpamCheck.php</a></li>
<li><a href="#trunktestsphpunittestsuserwpDeleteUserphp">trunk/tests/phpunit/tests/user/wpDeleteUser.php</a></li>
<li><a href="#trunktestsphpunittestsuserwpSetCurrentUserphp">trunk/tests/phpunit/tests/user/wpSetCurrentUser.php</a></li>
<li><a href="#trunktestsphpunittestsuserphp">trunk/tests/phpunit/tests/user.php</a></li>
<li><a href="#trunktestsphpunittestswalkerphp">trunk/tests/phpunit/tests/walker.php</a></li>
<li><a href="#trunktestsphpunittestswidgetscustomhtmlwidgetphp">trunk/tests/phpunit/tests/widgets/custom-html-widget.php</a></li>
<li><a href="#trunktestsphpunittestswidgetsmediaaudiowidgetphp">trunk/tests/phpunit/tests/widgets/media-audio-widget.php</a></li>
<li><a href="#trunktestsphpunittestswidgetsmediagallerywidgetphp">trunk/tests/phpunit/tests/widgets/media-gallery-widget.php</a></li>
<li><a href="#trunktestsphpunittestswidgetsmediaimagewidgetphp">trunk/tests/phpunit/tests/widgets/media-image-widget.php</a></li>
<li><a href="#trunktestsphpunittestswidgetsmediavideowidgetphp">trunk/tests/phpunit/tests/widgets/media-video-widget.php</a></li>
<li><a href="#trunktestsphpunittestswidgetsmediawidgetphp">trunk/tests/phpunit/tests/widgets/media-widget.php</a></li>
<li><a href="#trunktestsphpunittestswidgetstextwidgetphp">trunk/tests/phpunit/tests/widgets/text-widget.php</a></li>
<li><a href="#trunktestsphpunittestswidgetsphp">trunk/tests/phpunit/tests/widgets.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcbasicphp">trunk/tests/phpunit/tests/xmlrpc/basic.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcclientphp">trunk/tests/phpunit/tests/xmlrpc/client.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcmtgetRecentPostTitlesphp">trunk/tests/phpunit/tests/xmlrpc/mt/getRecentPostTitles.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcmweditPostphp">trunk/tests/phpunit/tests/xmlrpc/mw/editPost.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcmwgetPostphp">trunk/tests/phpunit/tests/xmlrpc/mw/getPost.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcmwgetRecentPostsphp">trunk/tests/phpunit/tests/xmlrpc/mw/getRecentPosts.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcmwnewPostphp">trunk/tests/phpunit/tests/xmlrpc/mw/newPost.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpdeletePostphp">trunk/tests/phpunit/tests/xmlrpc/wp/deletePost.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpdeleteTermphp">trunk/tests/phpunit/tests/xmlrpc/wp/deleteTerm.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpeditCommentphp">trunk/tests/phpunit/tests/xmlrpc/wp/editComment.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpeditPostphp">trunk/tests/phpunit/tests/xmlrpc/wp/editPost.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpeditProfilephp">trunk/tests/phpunit/tests/xmlrpc/wp/editProfile.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpeditTermphp">trunk/tests/phpunit/tests/xmlrpc/wp/editTerm.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetCommentphp">trunk/tests/phpunit/tests/xmlrpc/wp/getComment.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetCommentsphp">trunk/tests/phpunit/tests/xmlrpc/wp/getComments.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetMediaItemphp">trunk/tests/phpunit/tests/xmlrpc/wp/getMediaItem.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetOptionsphp">trunk/tests/phpunit/tests/xmlrpc/wp/getOptions.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetPagephp">trunk/tests/phpunit/tests/xmlrpc/wp/getPage.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetPageListphp">trunk/tests/phpunit/tests/xmlrpc/wp/getPageList.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetPagesphp">trunk/tests/phpunit/tests/xmlrpc/wp/getPages.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetPostphp">trunk/tests/phpunit/tests/xmlrpc/wp/getPost.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetPostTypephp">trunk/tests/phpunit/tests/xmlrpc/wp/getPostType.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetPostTypesphp">trunk/tests/phpunit/tests/xmlrpc/wp/getPostTypes.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetPostsphp">trunk/tests/phpunit/tests/xmlrpc/wp/getPosts.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetProfilephp">trunk/tests/phpunit/tests/xmlrpc/wp/getProfile.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetRevisionsphp">trunk/tests/phpunit/tests/xmlrpc/wp/getRevisions.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetTaxonomiesphp">trunk/tests/phpunit/tests/xmlrpc/wp/getTaxonomies.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetTaxonomyphp">trunk/tests/phpunit/tests/xmlrpc/wp/getTaxonomy.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetTermphp">trunk/tests/phpunit/tests/xmlrpc/wp/getTerm.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetTermsphp">trunk/tests/phpunit/tests/xmlrpc/wp/getTerms.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetUserphp">trunk/tests/phpunit/tests/xmlrpc/wp/getUser.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpgetUsersphp">trunk/tests/phpunit/tests/xmlrpc/wp/getUsers.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpnewCommentphp">trunk/tests/phpunit/tests/xmlrpc/wp/newComment.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpnewPostphp">trunk/tests/phpunit/tests/xmlrpc/wp/newPost.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpnewTermphp">trunk/tests/phpunit/tests/xmlrpc/wp/newTerm.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwprestoreRevisionphp">trunk/tests/phpunit/tests/xmlrpc/wp/restoreRevision.php</a></li>
<li><a href="#trunktestsphpunittestsxmlrpcwpsetOptionsphp">trunk/tests/phpunit/tests/xmlrpc/wp/setOptions.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunktestsphpunitincludesabstracttestcasephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/includes/abstract-testcase.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/includes/abstract-testcase.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/includes/abstract-testcase.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -660,15 +660,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Asserts that two values have the same type and value, with EOL differences discarded.
+ *
+ * @since 5.6.0
+ *
+ * @param string $expected The expected value.
+ * @param string $actual The actual value.
+ */
+ public function assertSameIgnoreEOL( $expected, $actual ) {
+ $this->assertSame( str_replace( "\r\n", "\n", $expected ), str_replace( "\r\n", "\n", $actual ) );
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Asserts that two values are equal, with EOL differences discarded.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.4.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 5.6.0 Turned into an alias for `::assertSameIgnoreEOL()`.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $expected The expected value.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $actual The actual value.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function assertEqualsIgnoreEOL( $expected, $actual ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( str_replace( "\r\n", "\n", $expected ), str_replace( "\r\n", "\n", $actual ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsactionscallbacksphp"></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/actions/callbacks.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/actions/callbacks.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/actions/callbacks.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,8 +15,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( $tag, array( 'Class', 'method' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_action( $tag, array( 'Class', 'method' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_action( $tag, array( 'Class', 'method' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_action( $tag, 'Class::method' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_action( $tag, 'Class::method' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsactionsphp"></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/actions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/actions.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/actions.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,13 +15,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( $tag );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Only one event occurred for the hook, with empty args.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Only our hook was called.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $tag ), $a->get_tags() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $tag ), $a->get_tags() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $argsvar = $a->get_args();
</span><span class="cx" style="display: block; padding: 0 10px"> $args = array_pop( $argsvar );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( '' ), $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( '' ), $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_remove_action() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,14 +32,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( $tag );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure our hook was called correctly.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a->get_call_count() );
- $this->assertEquals( array( $tag ), $a->get_tags() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a->get_call_count() );
+ $this->assertSame( array( $tag ), $a->get_tags() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Now remove the action, do it again, and make sure it's not called this time.
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( $tag, array( &$a, 'action' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( $tag );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a->get_call_count() );
- $this->assertEquals( array( $tag ), $a->get_tags() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a->get_call_count() );
+ $this->assertSame( array( $tag ), $a->get_tags() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -50,7 +50,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_action( $tag, $func ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_action( $tag ) );
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( $tag, $func );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_action( $tag, $func ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_action( $tag, $func ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( has_action( $tag ) );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( $tag, $func );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_action( $tag, $func ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,8 +70,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( $tag );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Both actions called once each.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a1->get_call_count() );
- $this->assertEquals( 1, $a2->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a1->get_call_count() );
+ $this->assertSame( 1, $a2->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_action_args_1() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -84,9 +84,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( $tag, $val );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $call_count = $a->get_call_count();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $call_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $call_count );
</ins><span class="cx" style="display: block; padding: 0 10px"> $argsvar = $a->get_args();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $val ), array_pop( $argsvar ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $val ), array_pop( $argsvar ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_action_args_2() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,14 +104,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $call_count = $a1->get_call_count();
</span><span class="cx" style="display: block; padding: 0 10px"> // $a1 should be called with both args.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $call_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $call_count );
</ins><span class="cx" style="display: block; padding: 0 10px"> $argsvar1 = $a1->get_args();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $val1, $val2 ), array_pop( $argsvar1 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $val1, $val2 ), array_pop( $argsvar1 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // $a2 should be called with one only.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a2->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a2->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $argsvar2 = $a2->get_args();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $val1 ), array_pop( $argsvar2 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $val1 ), array_pop( $argsvar2 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -138,19 +138,19 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $call_count = $a1->get_call_count();
</span><span class="cx" style="display: block; padding: 0 10px"> // $a1 should be called with both args.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $call_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $call_count );
</ins><span class="cx" style="display: block; padding: 0 10px"> $argsvar1 = $a1->get_args();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $val1, $val2 ), array_pop( $argsvar1 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $val1, $val2 ), array_pop( $argsvar1 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // $a2 should be called with one only.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a2->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a2->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $argsvar2 = $a2->get_args();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $val1 ), array_pop( $argsvar2 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $val1 ), array_pop( $argsvar2 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // $a3 should be called with both args.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a3->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a3->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $argsvar3 = $a3->get_args();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $val1, $val2 ), array_pop( $argsvar3 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $val1, $val2 ), array_pop( $argsvar3 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -181,7 +181,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( $tag );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Two events, one per action.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $a->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $a->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><span class="cx" style="display: block; padding: 0 10px"> // 'action2' is called first because it has priority 9.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -198,7 +198,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $a->get_events() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $a->get_events() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_did_action() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -207,8 +207,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Do action $tag1 but not $tag2.
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( $tag1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, did_action( $tag1 ) );
- $this->assertEquals( 0, did_action( $tag2 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, did_action( $tag1 ) );
+ $this->assertSame( 0, did_action( $tag2 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Do action $tag2 a random number of times.
</span><span class="cx" style="display: block; padding: 0 10px"> $count = rand( 0, 10 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -217,8 +217,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // $tag1's count hasn't changed, $tag2 should be correct.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, did_action( $tag1 ) );
- $this->assertEquals( $count, did_action( $tag2 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, did_action( $tag1 ) );
+ $this->assertSame( $count, did_action( $tag2 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -229,7 +229,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add an 'all' action.
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'all', array( &$a, 'action' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_filter( 'all', array( &$a, 'action' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_filter( 'all', array( &$a, 'action' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Do some actions.
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( $tag1 );
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( $tag2 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -237,9 +237,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( $tag1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Our action should have been called once for each tag.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 4, $a->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 4, $a->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Only our hook was called.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $tag1, $tag2, $tag1, $tag1 ), $a->get_tags() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $tag1, $tag2, $tag1, $tag1 ), $a->get_tags() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'all', array( &$a, 'action' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_filter( 'all', array( &$a, 'action' ) ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -251,19 +251,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $tag = __FUNCTION__;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'all', array( &$a, 'action' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_filter( 'all', array( &$a, 'action' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_filter( 'all', array( &$a, 'action' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( $tag );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure our hook was called correctly.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a->get_call_count() );
- $this->assertEquals( array( $tag ), $a->get_tags() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a->get_call_count() );
+ $this->assertSame( array( $tag ), $a->get_tags() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Now remove the action, do it again, and make sure it's not called this time.
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'all', array( &$a, 'action' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_filter( 'all', array( &$a, 'action' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( $tag );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a->get_call_count() );
- $this->assertEquals( array( $tag ), $a->get_tags() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a->get_call_count() );
+ $this->assertSame( array( $tag ), $a->get_tags() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_action_ref_array() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -312,7 +312,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_action_self_removal() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'test_action_self_removal', array( $this, 'action_self_removal' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'test_action_self_removal' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, did_action( 'test_action_self_removal' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, did_action( 'test_action_self_removal' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function action_self_removal() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -332,8 +332,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( $tag, array( $this, 'action_that_causes_recursion' ), 12, 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( $tag, $tag );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $a->get_call_count(), 'recursive actions should call all callbacks with earlier priority' );
- $this->assertEquals( 2, $b->get_call_count(), 'recursive actions should call callbacks with later priority' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $a->get_call_count(), 'recursive actions should call all callbacks with earlier priority' );
+ $this->assertSame( 2, $b->get_call_count(), 'recursive actions should call callbacks with later priority' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function action_that_causes_recursion( $tag ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -364,11 +364,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( $tag, $tag, array( $a, $b, $c, $d, $e ) );
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( $tag, $tag, array( $a, $b, $c, $d, $e ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $a->get_call_count(), 'callbacks should run unless otherwise instructed' );
- $this->assertEquals( 1, $b->get_call_count(), 'callback removed by same priority callback should still get called' );
- $this->assertEquals( 1, $c->get_call_count(), 'callback added by same priority callback should not get called' );
- $this->assertEquals( 2, $d->get_call_count(), 'callback added by earlier priority callback should get called' );
- $this->assertEquals( 1, $e->get_call_count(), 'callback added by later priority callback should not get called' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $a->get_call_count(), 'callbacks should run unless otherwise instructed' );
+ $this->assertSame( 1, $b->get_call_count(), 'callback removed by same priority callback should still get called' );
+ $this->assertSame( 1, $c->get_call_count(), 'callback added by same priority callback should not get called' );
+ $this->assertSame( 2, $d->get_call_count(), 'callback added by earlier priority callback should get called' );
+ $this->assertSame( 1, $e->get_call_count(), 'callback added by later priority callback should not get called' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function action_that_manipulates_a_running_hook( $tag, $mocks ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -435,7 +435,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'accepted_args' => 1,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 11, has_action( $tag, '__return_null' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 11, has_action( $tag, '__return_null' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -448,7 +448,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_current_filter[] = 'first';
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_current_filter[] = 'second'; // Let's say a second action was invoked.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'second', current_action() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'second', current_action() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -498,7 +498,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'testing', array( $this, 'apply_testing_filter' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( has_action( 'testing' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_action( 'testing', array( $this, 'apply_testing_filter' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_action( 'testing', array( $this, 'apply_testing_filter' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> apply_filters( 'testing', '' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -519,7 +519,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'testing_nested', array( $this, 'apply_testing_nested_filter' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( has_action( 'testing_nested' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_action( 'testing_nested', array( $this, 'apply_testing_nested_filter' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_action( 'testing_nested', array( $this, 'apply_testing_nested_filter' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> apply_filters( 'testing_nested', '' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsadminincludesCommunityEventsphp"></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/admin/includesCommunityEvents.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/includesCommunityEvents.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/admin/includesCommunityEvents.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -164,8 +164,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $response );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSetsWithIndex( $this->get_user_location(), $response['location'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( gmdate( 'l, M j, Y', strtotime( 'next Sunday 1pm' ) ), $response['events'][0]['formatted_date'] );
- $this->assertEquals( '1:00 pm', $response['events'][0]['formatted_time'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( gmdate( 'l, M j, Y', strtotime( 'next Sunday 1pm' ) ), $response['events'][0]['formatted_date'] );
+ $this->assertSame( '1:00 pm', $response['events'][0]['formatted_time'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_http_request', array( $this, '_http_request_valid_response' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -185,8 +185,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $cached_events );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSetsWithIndex( $this->get_user_location(), $cached_events['location'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( gmdate( 'l, M j, Y', strtotime( 'next Sunday 1pm' ) ), $cached_events['events'][0]['formatted_date'] );
- $this->assertEquals( '1:00 pm', $cached_events['events'][0]['formatted_time'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( gmdate( 'l, M j, Y', strtotime( 'next Sunday 1pm' ) ), $cached_events['events'][0]['formatted_date'] );
+ $this->assertSame( '1:00 pm', $cached_events['events'][0]['formatted_time'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_http_request', array( $this, '_http_request_valid_response' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -273,9 +273,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * so that it remains in the list. The other events should remain unchanged.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 3, $response_body['events'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $response_body['events'][0]['title'], 'Flexbox + CSS Grid: Magic for Responsive Layouts' );
- $this->assertEquals( $response_body['events'][1]['title'], 'Part 3- Site Maintenance - Tools to Make It Easy' );
- $this->assertEquals( $response_body['events'][2]['title'], 'WordCamp San Diego' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $response_body['events'][0]['title'], 'Flexbox + CSS Grid: Magic for Responsive Layouts' );
+ $this->assertSame( $response_body['events'][1]['title'], 'Part 3- Site Maintenance - Tools to Make It Easy' );
+ $this->assertSame( $response_body['events'][2]['title'], 'WordCamp San Diego' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_http_request', array( $this, '_http_request_valid_response_unpinned_wordcamp' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -375,9 +375,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * WordCamp LA should not be stuck to the list, because San Diego already appears naturally.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 3, $response_body['events'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $response_body['events'][0]['title'], 'WordCamp San Diego' );
- $this->assertEquals( $response_body['events'][1]['title'], 'Part 3- Site Maintenance - Tools to Make It Easy' );
- $this->assertEquals( $response_body['events'][2]['title'], 'WordPress Q&A' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $response_body['events'][0]['title'], 'WordCamp San Diego' );
+ $this->assertSame( $response_body['events'][1]['title'], 'Part 3- Site Maintenance - Tools to Make It Easy' );
+ $this->assertSame( $response_body['events'][2]['title'], 'WordPress Q&A' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_http_request', array( $this, '_http_request_valid_response_multiple_wordcamps' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -488,7 +488,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTP_CLIENT_IP'] = $raw_ip;
</span><span class="cx" style="display: block; padding: 0 10px"> $actual_result = WP_Community_Events::get_unsafe_client_ip();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_result, $actual_result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_result, $actual_result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsadminincludesFilephp"></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/admin/includesFile.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/includesFile.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/admin/includesFile.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,19 +13,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $home = get_option( 'home' );
</span><span class="cx" style="display: block; padding: 0 10px"> $siteurl = get_option( 'siteurl' );
</span><span class="cx" style="display: block; padding: 0 10px"> $sfn = $_SERVER['SCRIPT_FILENAME'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( str_replace( '\\', '/', ABSPATH ), get_home_path() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( str_replace( '\\', '/', ABSPATH ), get_home_path() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'home', 'http://localhost' );
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'siteurl', 'http://localhost/wp' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['SCRIPT_FILENAME'] = 'D:\root\vhosts\site\httpdocs\wp\wp-admin\options-permalink.php';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'D:/root/vhosts/site/httpdocs/', get_home_path() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'D:/root/vhosts/site/httpdocs/', get_home_path() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['SCRIPT_FILENAME'] = '/Users/foo/public_html/trunk/wp/wp-admin/options-permalink.php';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/Users/foo/public_html/trunk/', get_home_path() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/Users/foo/public_html/trunk/', get_home_path() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['SCRIPT_FILENAME'] = 'S:/home/wordpress/trunk/wp/wp-admin/options-permalink.php';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'S:/home/wordpress/trunk/', get_home_path() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'S:/home/wordpress/trunk/', get_home_path() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'home', $home );
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'siteurl', $siteurl );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,7 +40,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $error = download_url( 'test_download_url_non_200' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'code' => 418,
</span><span class="cx" style="display: block; padding: 0 10px"> 'body' => 'This is an unexpected error message from your favorite server.',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,7 +52,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $error = download_url( 'test_download_url_non_200' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'code' => 418,
</span><span class="cx" style="display: block; padding: 0 10px"> 'body' => 'This ',
</span></span></pre></div>
<a id="trunktestsphpunittestsadminincludesMiscphp"></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/admin/includesMisc.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/includesMisc.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/admin/includesMisc.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> => 'wordpress.org/about/philosophy/#…', // Shorten to 32 if > 35 after cleaning.
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $tests as $k => $v ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $v, url_shorten( $k ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $v, url_shorten( $k ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsadminincludesPluginphp"></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/admin/includesPlugin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/includesPlugin.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/admin/includesPlugin.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,7 +23,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $default_headers as $name => $value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $data[ $name ] ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, $data[ $name ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, $data[ $name ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,7 +51,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected['testpages'] = 'http://example.com/wp-admin/edit.php?post_type=page&page=testpages';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $expected as $name => $value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, menu_page_url( $name, false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, menu_page_url( $name, false ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $current_user );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -349,7 +349,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_plugin_files_single() {
</span><span class="cx" style="display: block; padding: 0 10px"> $name = 'hello.php';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $name ), get_plugin_files( $name ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $name ), get_plugin_files( $name ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -369,7 +369,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'list_files_test_plugin/list_files_test_plugin.php',
</span><span class="cx" style="display: block; padding: 0 10px"> 'list_files_test_plugin/subdir/subfile.php',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $plugin_files );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $plugin_files );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $sub_dir . '/subfile.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $plugin[1] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -389,7 +389,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> mkdir( WPMU_PLUGIN_DIR );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), get_mu_plugins() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), get_mu_plugins() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Clean up.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $exists ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -410,7 +410,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> rmdir( WPMU_PLUGIN_DIR );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), get_mu_plugins() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), get_mu_plugins() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Clean up.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $exists ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -432,7 +432,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_create_plugin( '<?php\n//Silence is golden.', 'index.php', WPMU_PLUGIN_DIR );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), get_mu_plugins() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), get_mu_plugins() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Clean up.
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( WPMU_PLUGIN_DIR . '/index.php' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -457,7 +457,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_create_plugin( '<?php\n//Silence is not golden.', 'index.php', WPMU_PLUGIN_DIR );
</span><span class="cx" style="display: block; padding: 0 10px"> $found = get_mu_plugins();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'index.php' ), array_keys( $found ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'index.php' ), array_keys( $found ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Clean up.
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( WPMU_PLUGIN_DIR . '/index.php' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -483,7 +483,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_create_plugin( '<?php\n//Test', 'foo.php', WPMU_PLUGIN_DIR );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_create_plugin( '<?php\n//Test 2', 'bar.txt', WPMU_PLUGIN_DIR );
</span><span class="cx" style="display: block; padding: 0 10px"> $found = get_mu_plugins();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'foo.php' ), array_keys( $found ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'foo.php' ), array_keys( $found ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Clean up.
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( WPMU_PLUGIN_DIR . '/foo.php' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -501,7 +501,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test__sort_uname_callback() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertLessThan( 0, _sort_uname_callback( array( 'Name' => 'a' ), array( 'Name' => 'b' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertGreaterThan( 0, _sort_uname_callback( array( 'Name' => 'c' ), array( 'Name' => 'b' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, _sort_uname_callback( array( 'Name' => 'a' ), array( 'Name' => 'a' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, _sort_uname_callback( array( 'Name' => 'a' ), array( 'Name' => 'a' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -510,7 +510,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_dropins_empty() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_back_up_drop_ins();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), get_dropins() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), get_dropins() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Clean up.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_restore_drop_ins();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -526,7 +526,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $p2 = $this->_create_plugin( "<?php\n//Test", 'not-a-dropin.php', WP_CONTENT_DIR );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $dropins = get_dropins();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'advanced-cache.php' ), array_keys( $dropins ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'advanced-cache.php' ), array_keys( $dropins ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $p1[1] );
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $p2[1] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -590,7 +590,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::validate_active_plugins
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_validate_active_plugins_empty() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), validate_active_plugins() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), validate_active_plugins() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsadminincludesPostphp"></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/admin/includesPost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/includesPost.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/admin/includesPost.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,8 +37,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_results = _wp_translate_postdata( false, $_post_data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $_results );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $_post_data['post_author'], $_results['post_author'] );
- $this->assertEquals( 'draft', $_results['post_status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $_post_data['post_author'], $_results['post_author'] );
+ $this->assertSame( 'draft', $_results['post_status'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Submit post for approval.
</span><span class="cx" style="display: block; padding: 0 10px"> $_post_data = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,8 +48,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_results = _wp_translate_postdata( false, $_post_data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $_results );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $_post_data['post_author'], $_results['post_author'] );
- $this->assertEquals( 'pending', $_results['post_status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $_post_data['post_author'], $_results['post_author'] );
+ $this->assertSame( 'pending', $_results['post_status'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Create new draft post for another user.
</span><span class="cx" style="display: block; padding: 0 10px"> $_post_data = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,8 +59,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_results = _wp_translate_postdata( false, $_post_data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $_results );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'edit_others_posts', $_results->get_error_code() );
- $this->assertEquals( 'Sorry, you are not allowed to create posts as this user.', $_results->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'edit_others_posts', $_results->get_error_code() );
+ $this->assertSame( 'Sorry, you are not allowed to create posts as this user.', $_results->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Edit draft post for another user.
</span><span class="cx" style="display: block; padding: 0 10px"> $_post_data = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,8 +72,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_results = _wp_translate_postdata( true, $_post_data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $_results );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'edit_others_posts', $_results->get_error_code() );
- $this->assertEquals( 'Sorry, you are not allowed to edit posts as this user.', $_results->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'edit_others_posts', $_results->get_error_code() );
+ $this->assertSame( 'Sorry, you are not allowed to edit posts as this user.', $_results->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test__wp_translate_postdata_cap_checks_editor() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -87,8 +87,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_results = _wp_translate_postdata( false, $_post_data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $_results );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $_post_data['post_author'], $_results['post_author'] );
- $this->assertEquals( 'draft', $_results['post_status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $_post_data['post_author'], $_results['post_author'] );
+ $this->assertSame( 'draft', $_results['post_status'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Publish post.
</span><span class="cx" style="display: block; padding: 0 10px"> $_post_data = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -98,8 +98,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_results = _wp_translate_postdata( false, $_post_data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $_results );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $_post_data['post_author'], $_results['post_author'] );
- $this->assertEquals( 'publish', $_results['post_status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $_post_data['post_author'], $_results['post_author'] );
+ $this->assertSame( 'publish', $_results['post_status'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Create new draft post for another user.
</span><span class="cx" style="display: block; padding: 0 10px"> $_post_data = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -109,8 +109,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_results = _wp_translate_postdata( false, $_post_data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $_results );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $_post_data['post_author'], $_results['post_author'] );
- $this->assertEquals( 'draft', $_results['post_status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $_post_data['post_author'], $_results['post_author'] );
+ $this->assertSame( 'draft', $_results['post_status'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Edit draft post for another user.
</span><span class="cx" style="display: block; padding: 0 10px"> $_post_data = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -122,8 +122,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_results = _wp_translate_postdata( true, $_post_data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $_results );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $_post_data['post_author'], $_results['post_author'] );
- $this->assertEquals( 'draft', $_results['post_status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $_post_data['post_author'], $_results['post_author'] );
+ $this->assertSame( 'draft', $_results['post_status'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -134,7 +134,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_edit_post_auto_draft() {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = self::factory()->post->create_and_get( array( 'post_status' => 'auto-draft' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'auto-draft', $post->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'auto-draft', $post->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_data = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_title' => 'Post title',
</span><span class="cx" style="display: block; padding: 0 10px"> 'content' => 'Post content',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -142,7 +142,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_ID' => $post->ID,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> edit_post( $post_data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'draft', get_post( $post->ID )->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'draft', get_post( $post->ID )->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -252,10 +252,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post2 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that the first post's values don't stomp the second post.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'draft', $post->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'draft', $post->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( self::$author_ids[1], $post->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'closed', $post->comment_status );
- $this->assertEquals( 'closed', $post->ping_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'closed', $post->comment_status );
+ $this->assertSame( 'closed', $post->ping_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -314,7 +314,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function check_post_format( $post_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( self::$post_id === $post_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'aside', get_post_format( $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'aside', get_post_format( $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -538,7 +538,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = get_sample_permalink( $p );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2015-2', $found[1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2015-2', $found[1] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -554,7 +554,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = get_sample_permalink( $p );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2015', $found[1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2015', $found[1] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -570,7 +570,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = get_sample_permalink( $p );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '11-2', $found[1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '11-2', $found[1] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -586,7 +586,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = get_sample_permalink( $p );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '13', $found[1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '13', $found[1] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -602,7 +602,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = get_sample_permalink( $p );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '30-2', $found[1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '30-2', $found[1] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -624,7 +624,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = get_sample_permalink( $p );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '30-3', $found[1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '30-3', $found[1] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -640,7 +640,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = get_sample_permalink( $p );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '32', $found[1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '32', $found[1] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -656,7 +656,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = get_sample_permalink( $p );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '30', $found[1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '30', $found[1] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -825,8 +825,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_block_editor_server_block_settings() {
</span><span class="cx" style="display: block; padding: 0 10px"> $name = 'core/test';
</span><span class="cx" style="display: block; padding: 0 10px"> $settings = array(
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'icon' => 'text',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'category' => 'common',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'icon' => 'text',
</del><span class="cx" style="display: block; padding: 0 10px"> 'render_callback' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -837,12 +837,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> unregister_block_type( $name );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $name, $blocks );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'title' => '',
</span><span class="cx" style="display: block; padding: 0 10px"> 'description' => '',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'icon' => 'text',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'category' => 'common',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'icon' => 'text',
</del><span class="cx" style="display: block; padding: 0 10px"> 'keywords' => array(),
</span><span class="cx" style="display: block; padding: 0 10px"> 'usesContext' => array(),
</span><span class="cx" style="display: block; padding: 0 10px"> 'styles' => array(),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -865,7 +865,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotFalse( add_meta( $p ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_post_meta( $p, 'testkey', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_post_meta( $p, 'testkey', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsadminincludesSchemaphp"></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/admin/includesSchema.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/includesSchema.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/admin/includesSchema.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,7 +110,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wpdb->options = $orig_options;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $results );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_populate_options() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -119,8 +119,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> array(),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Random options to check.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'posts_per_rss' => 10,
- 'rss_use_excerpt' => 0,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'posts_per_rss' => '10',
+ 'rss_use_excerpt' => '0',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'mailserver_url' => 'mail.example.com',
</span><span class="cx" style="display: block; padding: 0 10px"> 'mailserver_login' => 'login@example.com',
</span><span class="cx" style="display: block; padding: 0 10px"> 'mailserver_pass' => 'password',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -128,13 +128,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'posts_per_rss' => 7,
- 'rss_use_excerpt' => 1,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'posts_per_rss' => '7',
+ 'rss_use_excerpt' => '1',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Random options to check.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'posts_per_rss' => 7,
- 'rss_use_excerpt' => 1,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'posts_per_rss' => '7',
+ 'rss_use_excerpt' => '1',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'mailserver_url' => 'mail.example.com',
</span><span class="cx" style="display: block; padding: 0 10px"> 'mailserver_login' => 'login@example.com',
</span><span class="cx" style="display: block; padding: 0 10px"> 'mailserver_pass' => 'password',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -147,8 +147,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Random options to check.
</span><span class="cx" style="display: block; padding: 0 10px"> 'custom_option' => '1',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'posts_per_rss' => 10,
- 'rss_use_excerpt' => 0,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'posts_per_rss' => '10',
+ 'rss_use_excerpt' => '0',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'mailserver_url' => 'mail.example.com',
</span><span class="cx" style="display: block; padding: 0 10px"> 'mailserver_login' => 'login@example.com',
</span><span class="cx" style="display: block; padding: 0 10px"> 'mailserver_pass' => 'password',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -200,7 +200,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wpdb->blogmeta = $orig_blogmeta;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $results );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_populate_site_meta() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -248,7 +248,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wpdb->sitemeta = $orig_sitemeta;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $results );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_populate_network_meta() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -258,8 +258,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Random meta to check.
</span><span class="cx" style="display: block; padding: 0 10px"> 'registration' => 'none',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'blog_upload_space' => 100,
- 'fileupload_maxk' => 1500,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'blog_upload_space' => '100',
+ 'fileupload_maxk' => '1500',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -271,8 +271,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Random meta to check.
</span><span class="cx" style="display: block; padding: 0 10px"> 'site_name' => 'My Great Network',
</span><span class="cx" style="display: block; padding: 0 10px"> 'registration' => 'none',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'blog_upload_space' => 100,
- 'fileupload_maxk' => 1500,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'blog_upload_space' => '100',
+ 'fileupload_maxk' => '1500',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'WPLANG' => 'fr_FR',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -284,8 +284,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Random meta to check.
</span><span class="cx" style="display: block; padding: 0 10px"> 'custom_meta' => '1',
</span><span class="cx" style="display: block; padding: 0 10px"> 'registration' => 'none',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'blog_upload_space' => 100,
- 'fileupload_maxk' => 1500,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'blog_upload_space' => '100',
+ 'fileupload_maxk' => '1500',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span></span></pre></div>
<a id="trunktestsphpunittestsadminincludesScreenphp"></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/admin/includesScreen.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/includesScreen.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/admin/includesScreen.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -203,18 +203,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['hook_suffix'] = $hook['path'];
</span><span class="cx" style="display: block; padding: 0 10px"> set_current_screen();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->id, $current_screen->id, $hook_name );
- $this->assertEquals( $screen->base, $current_screen->base, $hook_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->id, $current_screen->id, $hook_name );
+ $this->assertSame( $screen->base, $current_screen->base, $hook_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $screen->action ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->action, $current_screen->action, $hook_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->action, $current_screen->action, $hook_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $screen->post_type ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->post_type, $current_screen->post_type, $hook_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->post_type, $current_screen->post_type, $hook_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $current_screen->post_type, $hook_name );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $screen->taxonomy ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->taxonomy, $current_screen->taxonomy, $hook_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->taxonomy, $current_screen->taxonomy, $hook_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $current_screen->in_admin() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -237,9 +237,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_post_type_as_hookname() {
</span><span class="cx" style="display: block; padding: 0 10px"> $screen = convert_to_screen( 'page' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->post_type, 'page' );
- $this->assertEquals( $screen->base, 'post' );
- $this->assertEquals( $screen->id, 'page' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->post_type, 'page' );
+ $this->assertSame( $screen->base, 'post' );
+ $this->assertSame( $screen->id, 'page' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $screen->is_block_editor );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -246,15 +246,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_post_type_with_special_suffix_as_hookname() {
</span><span class="cx" style="display: block; padding: 0 10px"> register_post_type( 'value-add' );
</span><span class="cx" style="display: block; padding: 0 10px"> $screen = convert_to_screen( 'value-add' ); // The '-add' part is key.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->post_type, 'value-add' );
- $this->assertEquals( $screen->base, 'post' );
- $this->assertEquals( $screen->id, 'value-add' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->post_type, 'value-add' );
+ $this->assertSame( $screen->base, 'post' );
+ $this->assertSame( $screen->id, 'value-add' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $screen->is_block_editor ); // Post types do not support `show_in_rest` by default.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $screen = convert_to_screen( 'edit-value-add' ); // The '-add' part is key.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->post_type, 'value-add' );
- $this->assertEquals( $screen->base, 'edit' );
- $this->assertEquals( $screen->id, 'edit-value-add' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->post_type, 'value-add' );
+ $this->assertSame( $screen->base, 'edit' );
+ $this->assertSame( $screen->id, 'edit-value-add' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $screen->is_block_editor ); // Post types do not support `show_in_rest` by default.
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -261,9 +261,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_taxonomy_with_special_suffix_as_hookname() {
</span><span class="cx" style="display: block; padding: 0 10px"> register_taxonomy( 'old-or-new', 'post' );
</span><span class="cx" style="display: block; padding: 0 10px"> $screen = convert_to_screen( 'edit-old-or-new' ); // The '-new' part is key.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->taxonomy, 'old-or-new' );
- $this->assertEquals( $screen->base, 'edit-tags' );
- $this->assertEquals( $screen->id, 'edit-old-or-new' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->taxonomy, 'old-or-new' );
+ $this->assertSame( $screen->base, 'edit-tags' );
+ $this->assertSame( $screen->id, 'edit-old-or-new' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $screen->is_block_editor );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -270,15 +270,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_post_type_with_edit_prefix() {
</span><span class="cx" style="display: block; padding: 0 10px"> register_post_type( 'edit-some-thing' );
</span><span class="cx" style="display: block; padding: 0 10px"> $screen = convert_to_screen( 'edit-some-thing' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->post_type, 'edit-some-thing' );
- $this->assertEquals( $screen->base, 'post' );
- $this->assertEquals( $screen->id, 'edit-some-thing' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->post_type, 'edit-some-thing' );
+ $this->assertSame( $screen->base, 'post' );
+ $this->assertSame( $screen->id, 'edit-some-thing' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $screen->is_block_editor ); // Post types do not support `show_in_rest` by default.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $screen = convert_to_screen( 'edit-edit-some-thing' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->post_type, 'edit-some-thing' );
- $this->assertEquals( $screen->base, 'edit' );
- $this->assertEquals( $screen->id, 'edit-edit-some-thing' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->post_type, 'edit-some-thing' );
+ $this->assertSame( $screen->base, 'edit' );
+ $this->assertSame( $screen->id, 'edit-edit-some-thing' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $screen->is_block_editor ); // Post types do not support `show_in_rest` by default.
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -288,25 +288,25 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Sorry, core wins here.
</span><span class="cx" style="display: block; padding: 0 10px"> $screen = convert_to_screen( 'edit-comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->base, 'edit-comments' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->base, 'edit-comments' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The post type wins here. convert_to_screen( $post_type ) is only relevant for meta boxes anyway.
</span><span class="cx" style="display: block; padding: 0 10px"> $screen = convert_to_screen( 'comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->base, 'post' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->base, 'post' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Core wins.
</span><span class="cx" style="display: block; padding: 0 10px"> $screen = convert_to_screen( 'edit-tags' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->base, 'edit-tags' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->base, 'edit-tags' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $screen = convert_to_screen( 'tags' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->base, 'post' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->base, 'post' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_help_tabs() {
</span><span class="cx" style="display: block; padding: 0 10px"> $tab = __FUNCTION__;
</span><span class="cx" style="display: block; padding: 0 10px"> $tab_args = array(
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'title' => 'Help!',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'id' => $tab,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'title' => 'Help!',
</del><span class="cx" style="display: block; padding: 0 10px"> 'content' => 'Some content',
</span><span class="cx" style="display: block; padding: 0 10px"> 'callback' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -313,11 +313,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $screen = get_current_screen();
</span><span class="cx" style="display: block; padding: 0 10px"> $screen->add_help_tab( $tab_args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $screen->get_help_tab( $tab ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'title' => 'Help!',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'id' => $tab,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'title' => 'Help!',
</del><span class="cx" style="display: block; padding: 0 10px"> 'content' => 'Some content',
</span><span class="cx" style="display: block; padding: 0 10px"> 'callback' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> 'priority' => 10,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -331,7 +331,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $screen->get_help_tab( $tab ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $screen->remove_help_tabs();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->get_help_tabs(), array() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->get_help_tabs(), array() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -380,18 +380,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertequals( $screen->get_help_tab( $tab_1 ), $tab_1_args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $screen->add_help_tab( $tab_2_args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->get_help_tab( $tab_2 ), $tab_2_args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->get_help_tab( $tab_2 ), $tab_2_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $screen->add_help_tab( $tab_3_args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->get_help_tab( $tab_3 ), $tab_3_args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->get_help_tab( $tab_3 ), $tab_3_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $screen->add_help_tab( $tab_4_args );
</span><span class="cx" style="display: block; padding: 0 10px"> // Priority is added with the default for future calls.
</span><span class="cx" style="display: block; padding: 0 10px"> $tab_4_args['priority'] = 10;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->get_help_tab( $tab_4 ), $tab_4_args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->get_help_tab( $tab_4 ), $tab_4_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $tabs = $screen->get_help_tabs();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 4, count( $tabs ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 4, count( $tabs ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $tab_1, $tabs );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $tab_2, $tabs );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $tab_3, $tabs );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -426,7 +426,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 0, count( $screen->get_help_tabs() ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $screen->remove_help_tabs();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $screen->get_help_tabs() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $screen->get_help_tabs() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -443,7 +443,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $screen = get_current_screen();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $screen->add_option( $option, $option_args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->get_option( $option ), $option_args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->get_option( $option ), $option_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $options = $screen->get_options();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $option, $options );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -452,7 +452,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $screen->get_option( $option ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $screen->remove_options();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $screen->get_options(), array() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $screen->get_options(), array() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_in_admin() {
</span></span></pre></div>
<a id="trunktestsphpunittestsadminincludesThemephp"></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/admin/includesTheme.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/includesTheme.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/admin/includesTheme.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -95,7 +95,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> get_page_templates( null, 'post' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), get_page_templates( null, 'bar' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), get_page_templates( null, 'bar' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -166,7 +166,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> get_page_templates()
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), get_page_templates( null, 'bar' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), get_page_templates( null, 'bar' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsadminbarphp"></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/adminbar.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/adminbar.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/adminbar.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,7 +43,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $nodes = $admin_bar->get_nodes();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $nodes['new-content']->parent );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'new-content', $nodes['add-new-content']->parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'new-content', $nodes['add-new-content']->parent );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_post_type( 'content' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,7 +64,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $node1 = $admin_bar->get_node( 'test-node' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'class' => 'test-class' ), $node1->meta );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'class' => 'test-class' ), $node1->meta );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $admin_bar->add_node(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,7 +74,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $node2 = $admin_bar->get_node( 'test-node' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'class' => 'test-class',
</span><span class="cx" style="display: block; padding: 0 10px"> 'some-meta' => 'value',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -100,7 +100,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $node_edit_profile = $wp_admin_bar->get_node( 'edit-profile' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Site menu points to the home page instead of the admin URL.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( home_url( '/' ), $node_site_name->href );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( home_url( '/' ), $node_site_name->href );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // No profile links as the user doesn't have any permissions on the site.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $node_my_account->href );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,14 +125,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $node_edit_profile = $wp_admin_bar->get_node( 'edit-profile' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Site menu points to the admin URL.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( admin_url( '/' ), $node_site_name->href );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( admin_url( '/' ), $node_site_name->href );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $profile_url = admin_url( 'profile.php' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Profile URLs point to profile.php.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $profile_url, $node_my_account->href );
- $this->assertEquals( $profile_url, $node_user_info->href );
- $this->assertEquals( $profile_url, $node_edit_profile->href );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $profile_url, $node_my_account->href );
+ $this->assertSame( $profile_url, $node_user_info->href );
+ $this->assertSame( $profile_url, $node_edit_profile->href );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -177,9 +177,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $primary_profile_url, admin_url( 'profile.php' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Profile URLs should go to the user's primary blog.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $primary_profile_url, $node_my_account->href );
- $this->assertEquals( $primary_profile_url, $node_user_info->href );
- $this->assertEquals( $primary_profile_url, $node_edit_profile->href );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $primary_profile_url, $node_my_account->href );
+ $this->assertSame( $primary_profile_url, $node_user_info->href );
+ $this->assertSame( $primary_profile_url, $node_edit_profile->href );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> restore_current_blog();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -232,9 +232,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $user_profile_url, admin_url( 'profile.php' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Profile URLs should go to the user's primary blog.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user_profile_url, $node_my_account->href );
- $this->assertEquals( $user_profile_url, $node_user_info->href );
- $this->assertEquals( $user_profile_url, $node_edit_profile->href );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user_profile_url, $node_my_account->href );
+ $this->assertSame( $user_profile_url, $node_user_info->href );
+ $this->assertSame( $user_profile_url, $node_edit_profile->href );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> restore_current_blog();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -463,7 +463,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $about_node = $wp_admin_bar->get_node( 'about' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotNull( $wp_logo_node );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( false, $wp_logo_node->href );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $wp_logo_node->href );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'tabindex', $wp_logo_node->meta );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 0, $wp_logo_node->meta['tabindex'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $about_node );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -687,7 +687,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $parsed_url = wp_parse_url( $node->href );
</span><span class="cx" style="display: block; padding: 0 10px"> $query_params = array();
</span><span class="cx" style="display: block; padding: 0 10px"> wp_parse_str( $parsed_url['query'], $query_params );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $uuid, $query_params['changeset_uuid'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $uuid, $query_params['changeset_uuid'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( 'changeset_uuid', $query_params['url'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsajaxAddMetaphp"></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/ajax/AddMeta.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/ajax/AddMeta.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/ajax/AddMeta.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,7 +34,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $e );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_post_meta( $p, 'testkey', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_post_meta( $p, 'testkey', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -66,6 +66,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $e );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_post_meta( $p, 'testkey', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_post_meta( $p, 'testkey', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsajaxAttachmentsphp"></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/ajax/Attachments.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/ajax/Attachments.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/ajax/Attachments.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -58,7 +58,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure everything is correct.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $response['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $response['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $response['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -111,6 +111,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure everything is correct.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $response['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $response['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $response['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsajaxCompressionphp"></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/ajax/Compression.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/ajax/Compression.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/ajax/Compression.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -144,7 +144,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the site option is not changed due to lack of nonce.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, get_site_option( 'can_compress_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, get_site_option( 'can_compress_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add a nonce.
</span><span class="cx" style="display: block; padding: 0 10px"> $_GET['_ajax_nonce'] = wp_create_nonce( 'update_can_compress_scripts' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -157,7 +157,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the site option is changed.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, get_site_option( 'can_compress_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, get_site_option( 'can_compress_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -182,7 +182,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the site option is not changed due to lack of nonce.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, get_site_option( 'can_compress_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, get_site_option( 'can_compress_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add a nonce.
</span><span class="cx" style="display: block; padding: 0 10px"> $_GET['_ajax_nonce'] = wp_create_nonce( 'update_can_compress_scripts' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -195,7 +195,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the site option is changed.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, get_site_option( 'can_compress_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, get_site_option( 'can_compress_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsajaxCustomizeManagerphp"></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/ajax/CustomizeManager.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/ajax/CustomizeManager.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/ajax/CustomizeManager.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -115,7 +115,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_save' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'unauthenticated', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'unauthenticated', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Unauthorized.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$subscriber_user_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -141,7 +141,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_REQUEST['nonce'] = $nonce;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_save' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'not_preview', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'not_preview', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Bad nonce.
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['nonce'] = 'bad';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,7 +150,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize->setup_theme();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_save' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_nonce', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_nonce', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // User cannot create.
</span><span class="cx" style="display: block; padding: 0 10px"> $nonce = wp_create_nonce( 'save-customize_' . $wp_customize->get_stylesheet() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -161,7 +161,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type_obj->cap->create_posts = 'create_customize_changesets';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_save' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'cannot_create_changeset_post', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'cannot_create_changeset_post', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->overridden_caps[ $post_type_obj->cap->create_posts ] = true;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_save' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->_last_response_parsed['success'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -172,7 +172,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize->save_changeset_post( array( 'status' => 'publish' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_save' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'changeset_already_published', $this->_last_response_parsed['data']['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'changeset_already_published', $this->_last_response_parsed['data']['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_update_post(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'ID' => $wp_customize->changeset_post_id(),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -185,7 +185,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type_obj->cap->edit_post = 'edit_customize_changesets';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_save' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'cannot_edit_changeset_post', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'cannot_edit_changeset_post', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->overridden_caps[ $post_type_obj->cap->edit_post ] = true;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_save' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->_last_response_parsed['success'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -195,7 +195,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['customize_changeset_data'] = '[MALFORMED]';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_save' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_customize_changeset_data', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_customize_changeset_data', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Bad customize_changeset_status.
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['customize_changeset_data'] = '{}';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -202,7 +202,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['customize_changeset_status'] = 'unrecognized';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_save' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bad_customize_changeset_status', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bad_customize_changeset_status', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Disallowed publish posts if not allowed.
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type_obj = get_post_type_object( 'customize_changeset' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -210,11 +210,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['customize_changeset_status'] = 'publish';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_save' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'changeset_publish_unauthorized', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'changeset_publish_unauthorized', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $_POST['customize_changeset_status'] = 'future';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_save' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'changeset_publish_unauthorized', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'changeset_publish_unauthorized', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_type_obj->cap->publish_posts = 'customize'; // Restore.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Validate date.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -222,11 +222,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['customize_changeset_date'] = 'BAD DATE';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_save' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bad_customize_changeset_date', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bad_customize_changeset_date', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $_POST['customize_changeset_date'] = '2010-01-01 00:00:00';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_save' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'not_future_date', $this->_last_response_parsed['data']['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'not_future_date', $this->_last_response_parsed['data']['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $_POST['customize_changeset_date'] = ( gmdate( 'Y' ) + 1 ) . '-01-01 00:00:00';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_save' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->_last_response_parsed['success'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -234,7 +234,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['customize_changeset_date'] = '+10 minutes';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_save' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'future', get_post_status( $wp_customize->changeset_post_id() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'future', get_post_status( $wp_customize->changeset_post_id() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_update_post(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'ID' => $wp_customize->changeset_post_id(),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -288,11 +288,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->_last_response_parsed['success'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $this->_last_response_parsed['data'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'publish', $this->_last_response_parsed['data']['changeset_status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'publish', $this->_last_response_parsed['data']['changeset_status'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'next_changeset_uuid', $this->_last_response_parsed['data'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( wp_is_uuid( $this->_last_response_parsed['data']['next_changeset_uuid'], 4 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Success Changeset', get_post( $wp_customize->changeset_post_id() )->post_title );
- $this->assertEquals( 'Successful Site Title', get_option( 'blogname' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Success Changeset', get_post( $wp_customize->changeset_post_id() )->post_title );
+ $this->assertSame( 'Successful Site Title', get_option( 'blogname' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -327,11 +327,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->_last_response_parsed['success'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $this->_last_response_parsed['data'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'publish', $this->_last_response_parsed['data']['changeset_status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'publish', $this->_last_response_parsed['data']['changeset_status'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'next_changeset_uuid', $this->_last_response_parsed['data'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( wp_is_uuid( $this->_last_response_parsed['data']['next_changeset_uuid'], 4 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'New Site Title', get_option( 'blogname' ) );
- $this->assertEquals( 'Published', get_post( $post_id )->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'New Site Title', get_option( 'blogname' ) );
+ $this->assertSame( 'Published', get_post( $post_id )->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -368,7 +368,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->_last_response_parsed['success'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'changeset_date', $this->_last_response_parsed['data'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $changeset_post_schedule = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $future_date, $changeset_post_schedule->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $future_date, $changeset_post_schedule->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Success future changeset change to draft keeping existing date.
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $_POST['customize_changeset_date'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -377,7 +377,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->_last_response_parsed['success'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'changeset_date', $this->_last_response_parsed['data'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $changeset_post_draft = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $future_date, $changeset_post_draft->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $future_date, $changeset_post_draft->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Success if date is not passed with schedule changeset and stored changeset have future date.
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['customize_changeset_status'] = 'future';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -385,7 +385,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->_last_response_parsed['success'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'changeset_date', $this->_last_response_parsed['data'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $changeset_post_schedule = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $future_date, $changeset_post_schedule->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $future_date, $changeset_post_schedule->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Success if draft with past date.
</span><span class="cx" style="display: block; padding: 0 10px"> $now = current_time( 'mysql' );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_post(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -402,7 +402,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $_POST['customize_changeset_date'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_save' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'not_future_date', $this->_last_response_parsed['data']['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'not_future_date', $this->_last_response_parsed['data']['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Success publish changeset reset date to current.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_post(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -423,11 +423,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $future_date, $changeset_post_publish->post_date );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check response when trying to update an already-published post.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'trash', get_post_status( $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'trash', get_post_status( $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $_POST['customize_changeset_status'] = 'publish';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_save' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'changeset_already_published', $this->_last_response_parsed['data']['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'changeset_already_published', $this->_last_response_parsed['data']['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'next_changeset_uuid', $this->_last_response_parsed['data'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( wp_is_uuid( $this->_last_response_parsed['data']['next_changeset_uuid'], 4 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -470,7 +470,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['customize_changeset_autosave'] = 'on';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_save' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'draft', $this->_last_response_parsed['data']['changeset_status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'draft', $this->_last_response_parsed['data']['changeset_status'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $autosave_revision = wp_get_post_autosave( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $autosave_revision );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -490,7 +490,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_trash' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_nonce', $this->_last_response_parsed['data']['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_nonce', $this->_last_response_parsed['data']['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $nonce = wp_create_nonce( 'trash_customize_changeset' );
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['nonce'] = $nonce;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -498,7 +498,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_REQUEST['nonce'] = $nonce;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_trash' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'non_existent_changeset', $this->_last_response_parsed['data']['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'non_existent_changeset', $this->_last_response_parsed['data']['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize->register_controls(); // And settings too.
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize->set_post_value( 'blogname', 'HELLO' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -511,7 +511,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'map_meta_cap', array( $this, 'return_do_not_allow' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_trash' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'changeset_trash_unauthorized', $this->_last_response_parsed['data']['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'changeset_trash_unauthorized', $this->_last_response_parsed['data']['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'map_meta_cap', array( $this, 'return_do_not_allow' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $lock_user_id = static::factory()->user->create( array( 'role' => 'administrator' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -521,7 +521,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $previous_user );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_trash' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'changeset_locked', $this->_last_response_parsed['data']['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'changeset_locked', $this->_last_response_parsed['data']['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> delete_post_meta( $wp_customize->changeset_post_id(), '_edit_lock' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_post(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -532,7 +532,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_trash' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'changeset_already_trashed', $this->_last_response_parsed['data']['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'changeset_already_trashed', $this->_last_response_parsed['data']['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_post(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -545,16 +545,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'pre_trash_post', '__return_false' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_trash' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'changeset_trash_failure', $this->_last_response_parsed['data']['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'changeset_trash_failure', $this->_last_response_parsed['data']['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_trash_post', '__return_false' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $wp_trash_post_count, did_action( 'wp_trash_post' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $wp_trash_post_count, did_action( 'wp_trash_post' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_trash_post_count = did_action( 'wp_trash_post' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'draft', get_post_status( $wp_customize->changeset_post_id() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'draft', get_post_status( $wp_customize->changeset_post_id() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_trash' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'trash', get_post_status( $wp_customize->changeset_post_id() ) );
- $this->assertEquals( $wp_trash_post_count + 1, did_action( 'wp_trash_post' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'trash', get_post_status( $wp_customize->changeset_post_id() ) );
+ $this->assertSame( $wp_trash_post_count + 1, did_action( 'wp_trash_post' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -582,12 +582,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_dismiss_autosave_or_lock' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'unauthenticated', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'unauthenticated', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $valid_user_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_dismiss_autosave_or_lock' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_nonce', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_nonce', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $nonce = wp_create_nonce( 'customize_dismiss_autosave_or_lock' );
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['nonce'] = $nonce;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -599,7 +599,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_REQUEST['dismiss_lock'] = true;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_dismiss_autosave_or_lock' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'no_changeset_to_dismiss_lock', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'no_changeset_to_dismiss_lock', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['dismiss_autosave'] = true;
</span><span class="cx" style="display: block; padding: 0 10px"> $_GET['dismiss_autosave'] = true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -606,7 +606,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_REQUEST['dismiss_autosave'] = true;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_dismiss_autosave_or_lock' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'no_auto_draft_to_delete', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'no_auto_draft_to_delete', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $other_user_id = $this->factory()->user->create();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -640,13 +640,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_dismiss_autosave_or_lock' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'auto_draft_dismissed', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'auto_draft_dismissed', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $user_auto_draft_ids as $post_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'auto-draft', get_post_status( $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'auto-draft', get_post_status( $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( (bool) get_post_meta( $post_id, '_customize_restore_dismissed', true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $other_user_auto_draft_ids as $post_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'auto-draft', get_post_status( $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'auto-draft', get_post_status( $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( (bool) get_post_meta( $post_id, '_customize_restore_dismissed', true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -653,7 +653,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Subsequent test results in none dismissed.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_dismiss_autosave_or_lock' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'no_auto_draft_to_delete', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'no_auto_draft_to_delete', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Save a changeset as a draft.
</span><span class="cx" style="display: block; padding: 0 10px"> $r = $wp_customize->save_changeset_post(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -672,7 +672,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_REQUEST['dismiss_autosave'] = false;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_dismiss_autosave_or_lock' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'changeset_lock_dismissed', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'changeset_lock_dismissed', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['dismiss_autosave'] = true;
</span><span class="cx" style="display: block; padding: 0 10px"> $_GET['dismiss_autosave'] = true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -684,7 +684,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Since no autosave yet, confirm no action.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_dismiss_autosave_or_lock' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'no_autosave_revision_to_delete', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'no_autosave_revision_to_delete', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add the autosave revision.
</span><span class="cx" style="display: block; padding: 0 10px"> $r = $wp_customize->save_changeset_post(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -706,12 +706,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Confirm autosave gets deleted.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_dismiss_autosave_or_lock' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'autosave_revision_deleted', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'autosave_revision_deleted', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wp_get_post_autosave( $wp_customize->changeset_post_id() ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Since no autosave yet, confirm no action.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize_dismiss_autosave_or_lock' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->_last_response_parsed['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'no_autosave_revision_to_delete', $this->_last_response_parsed['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'no_autosave_revision_to_delete', $this->_last_response_parsed['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsajaxCustomizeMenusphp"></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/ajax/CustomizeMenus.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/ajax/CustomizeMenus.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/ajax/CustomizeMenus.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -549,7 +549,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = json_decode( $this->_last_response, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $post_args['search'] ) && 'test' === $post_args['search'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertsame( true, $response['success'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertTrue( $response['success'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 6, count( $response['data']['items'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $item_ids = wp_list_pluck( $response['data']['items'], 'id' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'post-' . $included_auto_draft_post->ID, $item_ids );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -628,11 +628,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'post_id', $response['data'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'url', $response['data'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $response['data']['post_id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Hello World', $post->post_title );
- $this->assertEquals( 'post', $post->post_type );
- $this->assertEquals( '', $post->post_name );
- $this->assertEquals( 'hello-world', get_post_meta( $post->ID, '_customize_draft_post_name', true ) );
- $this->assertEquals( $this->wp_customize->changeset_uuid(), get_post_meta( $post->ID, '_customize_changeset_uuid', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Hello World', $post->post_title );
+ $this->assertSame( 'post', $post->post_type );
+ $this->assertSame( '', $post->post_name );
+ $this->assertSame( 'hello-world', get_post_meta( $post->ID, '_customize_draft_post_name', true ) );
+ $this->assertSame( $this->wp_customize->changeset_uuid(), get_post_meta( $post->ID, '_customize_changeset_uuid', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -647,7 +647,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize-nav-menus-insert-auto-draft' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = json_decode( $this->_last_response, true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $response['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bad_nonce', $response['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bad_nonce', $response['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Bad nonce.
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST = wp_slash(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -659,7 +659,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize-nav-menus-insert-auto-draft' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = json_decode( $this->_last_response, true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $response['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bad_nonce', $response['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bad_nonce', $response['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Bad nonce.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $this->factory()->user->create( array( 'role' => 'subscriber' ) ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -672,7 +672,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize-nav-menus-insert-auto-draft' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = json_decode( $this->_last_response, true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $response['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'customize_not_allowed', $response['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'customize_not_allowed', $response['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Missing params.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $this->factory()->user->create( array( 'role' => 'administrator' ) ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -685,7 +685,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize-nav-menus-insert-auto-draft' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = json_decode( $this->_last_response, true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $response['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'missing_params', $response['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'missing_params', $response['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // insufficient_post_permissions.
</span><span class="cx" style="display: block; padding: 0 10px"> register_post_type( 'privilege', array( 'capability_type' => 'privilege' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -701,7 +701,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize-nav-menus-insert-auto-draft' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = json_decode( $this->_last_response, true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $response['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'insufficient_post_permissions', $response['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'insufficient_post_permissions', $response['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // insufficient_post_permissions.
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST = wp_slash(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -716,7 +716,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize-nav-menus-insert-auto-draft' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = json_decode( $this->_last_response, true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $response['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'missing_post_type_param', $response['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'missing_post_type_param', $response['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // missing_post_title.
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST = wp_slash(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -732,7 +732,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize-nav-menus-insert-auto-draft' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = json_decode( $this->_last_response, true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $response['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'missing_post_title', $response['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'missing_post_title', $response['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // illegal_params.
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST = wp_slash(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -750,6 +750,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->make_ajax_call( 'customize-nav-menus-insert-auto-draft' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = json_decode( $this->_last_response, true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $response['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'illegal_params', $response['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'illegal_params', $response['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsajaxDeleteCommentphp"></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/ajax/DeleteComment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/ajax/DeleteComment.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/ajax/DeleteComment.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -88,8 +88,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $xml = simplexml_load_string( $this->_last_response, 'SimpleXMLElement', LIBXML_NOCDATA );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure everything is correct.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $comment->comment_ID, (string) $xml->response[0]->comment['id'] );
- $this->assertEquals( 'delete-comment_' . $comment->comment_ID, (string) $xml->response['action'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $comment->comment_ID, (string) $xml->response[0]->comment['id'] );
+ $this->assertSame( 'delete-comment_' . $comment->comment_ID, (string) $xml->response['action'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertGreaterThanOrEqual( time() - 10, (int) $xml->response[0]->comment[0]->supplemental[0]->time[0] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertLessThanOrEqual( time(), (int) $xml->response[0]->comment[0]->supplemental[0]->time[0] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -202,7 +202,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_handleAjax( 'delete-comment' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->fail( 'Expected exception: WPAjaxDieStopException' );
</span><span class="cx" style="display: block; padding: 0 10px"> } catch ( WPAjaxDieStopException $e ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, strlen( $e->getMessage() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, strlen( $e->getMessage() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_numeric( $e->getMessage() ) );
</span><span class="cx" style="display: block; padding: 0 10px"> } catch ( Exception $e ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->fail( 'Unexpected exception type: ' . get_class( $e ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -252,7 +252,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_handleAjax( 'delete-comment' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->fail( 'Expected exception: WPAjaxDieStopException' );
</span><span class="cx" style="display: block; padding: 0 10px"> } catch ( WPAjaxDieStopException $e ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, strlen( $e->getMessage() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, strlen( $e->getMessage() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_numeric( $e->getMessage() ) );
</span><span class="cx" style="display: block; padding: 0 10px"> } catch ( Exception $e ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->fail( 'Unexpected exception type: ' . get_class( $e ) );
</span></span></pre></div>
<a id="trunktestsphpunittestsajaxDimCommentphp"></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/ajax/DimComment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/ajax/DimComment.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/ajax/DimComment.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -82,8 +82,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $xml = simplexml_load_string( $this->_last_response, 'SimpleXMLElement', LIBXML_NOCDATA );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure everything is correct.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $comment->comment_ID, (string) $xml->response[0]->comment['id'] );
- $this->assertEquals( 'dim-comment_' . $comment->comment_ID, (string) $xml->response['action'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $comment->comment_ID, (string) $xml->response[0]->comment['id'] );
+ $this->assertSame( 'dim-comment_' . $comment->comment_ID, (string) $xml->response['action'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertGreaterThanOrEqual( time() - 10, (int) $xml->response[0]->comment[0]->supplemental[0]->time[0] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertLessThanOrEqual( time(), (int) $xml->response[0]->comment[0]->supplemental[0]->time[0] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,9 +90,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the status.
</span><span class="cx" style="display: block; padding: 0 10px"> $current = wp_get_comment_status( $comment->comment_ID );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( in_array( $prev_status, array( 'unapproved', 'spam' ), true ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'approved', $current );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'approved', $current );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'unapproved', $current );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'unapproved', $current );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The total is calculated based on a page break -OR- a random number. Let's look for both possible outcomes.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -193,8 +193,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $xml = simplexml_load_string( $this->_last_response, 'SimpleXMLElement', LIBXML_NOCDATA );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure everything is correct.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0', (string) $xml->response[0]->comment['id'] );
- $this->assertEquals( 'dim-comment_0', (string) $xml->response['action'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0', (string) $xml->response[0]->comment['id'] );
+ $this->assertSame( 'dim-comment_0', (string) $xml->response['action'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'Comment ' . $_POST['id'] . ' does not exist', $this->_last_response );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> } catch ( Exception $e ) {
</span></span></pre></div>
<a id="trunktestsphpunittestsajaxEditCommentphp"></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/ajax/EditComment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/ajax/EditComment.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/ajax/EditComment.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -66,9 +66,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $xml = simplexml_load_string( $this->_last_response, 'SimpleXMLElement', LIBXML_NOCDATA );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the meta data.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( -1, (string) $xml->response[0]->edit_comment['position'] );
- $this->assertEquals( $comment->comment_ID, (string) $xml->response[0]->edit_comment['id'] );
- $this->assertEquals( 'edit-comment_' . $comment->comment_ID, (string) $xml->response['action'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '-1', (string) $xml->response[0]->edit_comment['position'] );
+ $this->assertSame( $comment->comment_ID, (string) $xml->response[0]->edit_comment['id'] );
+ $this->assertSame( 'edit-comment_' . $comment->comment_ID, (string) $xml->response['action'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the payload.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( (string) $xml->response[0]->edit_comment[0]->response_data );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -114,9 +114,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $xml = simplexml_load_string( $this->_last_response, 'SimpleXMLElement', LIBXML_NOCDATA );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the meta data.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( -1, (string) $xml->response[0]->edit_comment['position'] );
- $this->assertEquals( $comment->comment_ID, (string) $xml->response[0]->edit_comment['id'] );
- $this->assertEquals( 'edit-comment_' . $comment->comment_ID, (string) $xml->response['action'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '-1', (string) $xml->response[0]->edit_comment['position'] );
+ $this->assertSame( $comment->comment_ID, (string) $xml->response[0]->edit_comment['id'] );
+ $this->assertSame( 'edit-comment_' . $comment->comment_ID, (string) $xml->response['action'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the payload.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( (string) $xml->response[0]->edit_comment[0]->response_data );
</span></span></pre></div>
<a id="trunktestsphpunittestsajaxGetCommentsphp"></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/ajax/GetComments.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/ajax/GetComments.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/ajax/GetComments.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,9 +63,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $xml = simplexml_load_string( $this->_last_response, 'SimpleXMLElement', LIBXML_NOCDATA );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the meta data.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, (string) $xml->response[0]->comments['position'] );
- $this->assertEquals( 0, (string) $xml->response[0]->comments['id'] );
- $this->assertEquals( 'get-comments_0', (string) $xml->response['action'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1', (string) $xml->response[0]->comments['position'] );
+ $this->assertSame( '0', (string) $xml->response[0]->comments['id'] );
+ $this->assertSame( 'get-comments_0', (string) $xml->response['action'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the payload.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( (string) $xml->response[0]->comments[0]->response_data );
</span></span></pre></div>
<a id="trunktestsphpunittestsajaxReplytoCommentphp"></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/ajax/ReplytoComment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/ajax/ReplytoComment.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/ajax/ReplytoComment.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,7 +77,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $xml = simplexml_load_string( $this->_last_response, 'SimpleXMLElement', LIBXML_NOCDATA );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the meta data.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( -1, (string) $xml->response[0]->comment['position'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '-1', (string) $xml->response[0]->comment['position'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertGreaterThan( 0, (int) $xml->response[0]->comment['id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( (string) $xml->response['action'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsajaxTagSearchphp"></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/ajax/TagSearch.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/ajax/TagSearch.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/ajax/TagSearch.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -57,7 +57,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure we found the right match.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->_last_response, 'chattels' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->_last_response, 'chattels' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -98,7 +98,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure we found the right match.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->_last_response, 'chattels' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->_last_response, 'chattels' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsattachmentslashesphp"></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/attachment/slashes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/attachment/slashes.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/attachment/slashes.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,9 +37,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_1 ), $post->post_title );
- $this->assertEquals( wp_unslash( $this->slash_3 ), $post->post_content_filtered );
- $this->assertEquals( wp_unslash( $this->slash_5 ), $post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_1 ), $post->post_title );
+ $this->assertSame( wp_unslash( $this->slash_3 ), $post->post_content_filtered );
+ $this->assertSame( wp_unslash( $this->slash_5 ), $post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $id = wp_insert_attachment(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,9 +52,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_2 ), $post->post_title );
- $this->assertEquals( wp_unslash( $this->slash_4 ), $post->post_content_filtered );
- $this->assertEquals( wp_unslash( $this->slash_6 ), $post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_2 ), $post->post_title );
+ $this->assertSame( wp_unslash( $this->slash_4 ), $post->post_content_filtered );
+ $this->assertSame( wp_unslash( $this->slash_6 ), $post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsauthphp"></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/auth.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/auth.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/auth.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,7 +37,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_auth_cookie_valid() {
</span><span class="cx" style="display: block; padding: 0 10px"> $cookie = wp_generate_auth_cookie( self::$user_id, time() + 3600, 'auth' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$user_id, wp_validate_auth_cookie( $cookie, 'auth' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$user_id, wp_validate_auth_cookie( $cookie, 'auth' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_auth_cookie_invalid() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,25 +45,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // as an ajax test may have defined DOING_AJAX, failing the test.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $cookie = wp_generate_auth_cookie( self::$user_id, time() - 7200, 'auth' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, wp_validate_auth_cookie( $cookie, 'auth' ), 'expired cookie' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( wp_validate_auth_cookie( $cookie, 'auth' ), 'expired cookie' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $cookie = wp_generate_auth_cookie( self::$user_id, time() + 3600, 'auth' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, wp_validate_auth_cookie( $cookie, 'logged_in' ), 'wrong auth scheme' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( wp_validate_auth_cookie( $cookie, 'logged_in' ), 'wrong auth scheme' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $cookie = wp_generate_auth_cookie( self::$user_id, time() + 3600, 'auth' );
</span><span class="cx" style="display: block; padding: 0 10px"> list($a, $b, $c) = explode( '|', $cookie );
</span><span class="cx" style="display: block; padding: 0 10px"> $cookie = $a . '|' . ( $b + 1 ) . '|' . $c;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, wp_validate_auth_cookie( self::$user_id, 'auth' ), 'altered cookie' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( wp_validate_auth_cookie( self::$user_id, 'auth' ), 'altered cookie' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_auth_cookie_scheme() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Arbitrary scheme name.
</span><span class="cx" style="display: block; padding: 0 10px"> $cookie = wp_generate_auth_cookie( self::$user_id, time() + 3600, 'foo' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$user_id, wp_validate_auth_cookie( $cookie, 'foo' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$user_id, wp_validate_auth_cookie( $cookie, 'foo' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Wrong scheme name - should fail.
</span><span class="cx" style="display: block; padding: 0 10px"> $cookie = wp_generate_auth_cookie( self::$user_id, time() + 3600, 'foo' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, wp_validate_auth_cookie( $cookie, 'bar' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( wp_validate_auth_cookie( $cookie, 'bar' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -82,7 +82,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $authed_user = wp_authenticate( $this->user->user_login, $password_to_test );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_User', $authed_user );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->user->ID, $authed_user->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->user->ID, $authed_user->ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -136,7 +136,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_verify_nonce( $nonce, 'nonce_test_action' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( ( $count + 1 ), did_action( $this->nonce_failure_hook ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( ( $count + 1 ), did_action( $this->nonce_failure_hook ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -148,7 +148,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_verify_nonce( $nonce, 'nonce_test_action' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $count, did_action( $this->nonce_failure_hook ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $count, did_action( $this->nonce_failure_hook ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -201,7 +201,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user = wp_authenticate( $this->user->user_login, $limit );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_User', $user );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$user_id, $user->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$user_id, $user->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // One char too many.
</span><span class="cx" style="display: block; padding: 0 10px"> $user = wp_authenticate( $this->user->user_login, $limit . 'a' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -211,7 +211,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_password( $limit . 'a', self::$user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_user_by( 'id', self::$user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> // Password broken by setting it to be too long.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '*', $user->data->user_pass );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '*', $user->data->user_pass );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user = wp_authenticate( $this->user->user_login, '*' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $user );
</span></span></pre></div>
<a id="trunktestsphpunittestsavatarphp"></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/avatar.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/avatar.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/avatar.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,7 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_avatar_url_gravatar_url() {
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_avatar_url( 1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( preg_match( '|^http?://[0-9]+.gravatar.com/avatar/[0-9a-f]{32}\?|', $url ), 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( preg_match( '|^http?://[0-9]+.gravatar.com/avatar/[0-9a-f]{32}\?|', $url ), 1 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -19,11 +19,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_avatar_url_size() {
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_avatar_url( 1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( preg_match( '|\?.*s=96|', $url ), 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( preg_match( '|\?.*s=96|', $url ), 1 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args = array( 'size' => 100 );
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_avatar_url( 1, $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( preg_match( '|\?.*s=100|', $url ), 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( preg_match( '|\?.*s=100|', $url ), 1 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,16 +31,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_avatar_url_default() {
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_avatar_url( 1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( preg_match( '|\?.*d=mm|', $url ), 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( preg_match( '|\?.*d=mm|', $url ), 1 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args = array( 'default' => 'wavatar' );
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_avatar_url( 1, $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( preg_match( '|\?.*d=wavatar|', $url ), 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( preg_match( '|\?.*d=wavatar|', $url ), 1 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( preg_match( '|\?.*f=y|', $url ), 0 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( preg_match( '|\?.*f=y|', $url ), 0 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $args = array( 'force_default' => true );
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_avatar_url( 1, $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( preg_match( '|\?.*f=y|', $url ), 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( preg_match( '|\?.*f=y|', $url ), 1 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,11 +48,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_avatar_url_rating() {
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_avatar_url( 1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( preg_match( '|\?.*r=g|', $url ), 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( preg_match( '|\?.*r=g|', $url ), 1 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args = array( 'rating' => 'M' );
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_avatar_url( 1, $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( preg_match( '|\?.*r=m|', $url ), 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( preg_match( '|\?.*r=m|', $url ), 1 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,15 +60,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_avatar_url_scheme() {
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_avatar_url( 1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( preg_match( '|^http://|', $url ), 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( preg_match( '|^http://|', $url ), 1 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args = array( 'scheme' => 'https' );
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_avatar_url( 1, $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( preg_match( '|^https://|', $url ), 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( preg_match( '|^https://|', $url ), 1 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args = array( 'scheme' => 'lolcat' );
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_avatar_url( 1, $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( preg_match( '|^lolcat://|', $url ), 0 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( preg_match( '|^lolcat://|', $url ), 0 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,19 +78,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_avatar_url( 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $url2 = get_avatar_url( WP_TESTS_EMAIL );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $url, $url2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $url, $url2 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $url2 = get_avatar_url( md5( WP_TESTS_EMAIL ) . '@md5.gravatar.com' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $url, $url2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $url, $url2 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_user_by( 'id', 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $url2 = get_avatar_url( $user );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $url, $url2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $url, $url2 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_author' => 1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $url2 = get_avatar_url( $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $url, $url2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $url, $url2 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment_id = self::factory()->comment->create(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -100,7 +100,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $comment_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $url2 = get_avatar_url( $comment );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $url, $url2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $url, $url2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected $fake_url;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -114,7 +114,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_avatar_url( 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_get_avatar_data', array( $this, 'pre_get_avatar_url_filter' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $url, $this->fake_url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $url, $this->fake_url );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> public function pre_get_avatar_url_filter( $args ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $args['url'] = $this->fake_url;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -131,7 +131,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_avatar_url( 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'get_avatar_url', array( $this, 'get_avatar_url_filter' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $url, $this->fake_url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $url, $this->fake_url );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_avatar_url_filter( $url ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->fake_url;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -160,7 +160,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url2 = get_avatar_url( $comment );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'get_avatar_comment_types', array( $this, 'get_avatar_comment_types_filter' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $url, $url2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $url, $url2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_avatar_comment_types_filter( $comment_types ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $comment_types[] = 'pingback';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -169,30 +169,30 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_avatar() {
</span><span class="cx" style="display: block; padding: 0 10px"> $img = get_avatar( 1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( preg_match( "|^<img alt='[^']*' src='[^']*' srcset='[^']*' class='[^']*' height='[^']*' width='[^']*' loading='lazy'/>$|", $img ), 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( preg_match( "|^<img alt='[^']*' src='[^']*' srcset='[^']*' class='[^']*' height='[^']*' width='[^']*' loading='lazy'/>$|", $img ), 1 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_avatar_size() {
</span><span class="cx" style="display: block; padding: 0 10px"> $size = '100';
</span><span class="cx" style="display: block; padding: 0 10px"> $img = get_avatar( 1, $size );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( preg_match( "|^<img .*height='$size'.*width='$size'|", $img ), 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( preg_match( "|^<img .*height='$size'.*width='$size'|", $img ), 1 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_avatar_alt() {
</span><span class="cx" style="display: block; padding: 0 10px"> $alt = 'Mr Hyde';
</span><span class="cx" style="display: block; padding: 0 10px"> $img = get_avatar( 1, 96, '', $alt );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( preg_match( "|^<img alt='$alt'|", $img ), 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( preg_match( "|^<img alt='$alt'|", $img ), 1 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_avatar_class() {
</span><span class="cx" style="display: block; padding: 0 10px"> $class = 'first';
</span><span class="cx" style="display: block; padding: 0 10px"> $img = get_avatar( 1, 96, '', '', array( 'class' => $class ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( preg_match( "|^<img .*class='[^']*{$class}[^']*'|", $img ), 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( preg_match( "|^<img .*class='[^']*{$class}[^']*'|", $img ), 1 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_avatar_default_class() {
</span><span class="cx" style="display: block; padding: 0 10px"> $img = get_avatar( 1, 96, '', '', array( 'force_default' => true ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( preg_match( "|^<img .*class='[^']*avatar-default[^']*'|", $img ), 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( preg_match( "|^<img .*class='[^']*avatar-default[^']*'|", $img ), 1 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_avatar_force_display() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -218,7 +218,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $img = get_avatar( 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_get_avatar', array( $this, 'pre_get_avatar_filter' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $img, $this->fake_img );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $img, $this->fake_img );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> public function pre_get_avatar_filter( $img ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->fake_img;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -234,7 +234,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $img = get_avatar( 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'get_avatar', array( $this, 'get_avatar_filter' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $img, $this->fake_url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $img, $this->fake_url );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_avatar_filter( $img ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->fake_url;
</span></span></pre></div>
<a id="trunktestsphpunittestsbasicphp"></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/basic.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/basic.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/basic.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,7 +14,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $license = file_get_contents( ABSPATH . 'license.txt' );
</span><span class="cx" style="display: block; padding: 0 10px"> preg_match( '#Copyright 2011-(\d+) by the contributors#', $license, $matches );
</span><span class="cx" style="display: block; padding: 0 10px"> $this_year = gmdate( 'Y' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this_year, trim( $matches[1] ), "license.txt's year needs to be updated to $this_year." );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this_year, trim( $matches[1] ), "license.txt's year needs to be updated to $this_year." );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_security_md() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,7 +25,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> preg_match( '#\d.\d.x#', $security, $matches );
</span><span class="cx" style="display: block; padding: 0 10px"> $current_version = substr( $GLOBALS['wp_version'], 0, 3 );
</span><span class="cx" style="display: block; padding: 0 10px"> $latest_stable = sprintf( '%s.x', (float) $current_version - 0.1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $latest_stable, trim( $matches[0] ), "SECURITY.md's version needs to be updated to $latest_stable." );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $latest_stable, trim( $matches[0] ), "SECURITY.md's version needs to be updated to $latest_stable." );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_package_json() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 1 === substr_count( $version, '.' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $version .= '.0';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $version, $package_json['version'], "package.json's version needs to be updated to $version." );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $version, $package_json['version'], "package.json's version needs to be updated to $version." );
</ins><span class="cx" style="display: block; padding: 0 10px"> return $package_json;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -53,9 +53,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Test some helper utility functions.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_strip_ws() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', strip_ws( '' ) );
- $this->assertEquals( 'foo', strip_ws( 'foo' ) );
- $this->assertEquals( '', strip_ws( "\r\n\t \n\r\t" ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', strip_ws( '' ) );
+ $this->assertSame( 'foo', strip_ws( 'foo' ) );
+ $this->assertSame( '', strip_ws( "\r\n\t \n\r\t" ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $in = "asdf\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $in .= "asdf asdf\n";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,7 +75,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "foo bar\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= 'foo';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, strip_ws( $in ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, strip_ws( $in ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -93,6 +93,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <p>If a new user is created by WordPress, the password will be set, by default, to "changeme". Quite suggestive, eh? ;)</p>
</span><span class="cx" style="display: block; padding: 0 10px"> <ol id="authors"><form action="?import=wordpress&step=2&id=" method="post"><input type="hidden" name="_wpnonce" value="***" /><input type="hidden" name="_wp_http_referer" value="wp-test.php" /><li>Current author: <strong>Alex Shiels</strong><br />Create user <input type="text" value="Alex Shiels" name="user[]" maxlength="30"> <br /> or map to existing<select name="userselect[0]">
</span><span class="cx" style="display: block; padding: 0 10px"> EOF;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, mask_input_value( $in ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, mask_input_value( $in ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsblocksblockcontextphp"></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/blocks/block-context.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/block-context.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/blocks/block-context.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -131,7 +131,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> render_block( $parsed_blocks[0] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'gutenberg/contextWithDefault' => 0,
</span><span class="cx" style="display: block; padding: 0 10px"> 'gutenberg/contextWithAssigned' => 10,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -167,7 +167,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> render_block( $parsed_blocks[0] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'postId' => $post->ID,
</span><span class="cx" style="display: block; padding: 0 10px"> 'postType' => $post->post_type,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -209,7 +209,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'render_block_context', $filter_block_context );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'example' => 'ok' ), $provided_context[0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'example' => 'ok' ), $provided_context[0] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsblocksblocklistphp"></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/blocks/block-list.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/block-list.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/blocks/block-list.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,12 +54,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $blocks[0] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test "offsetGet".
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'core/example', $blocks[0]->name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'core/example', $blocks[0]->name );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test "offsetSet".
</span><span class="cx" style="display: block; padding: 0 10px"> $parsed_blocks[0]['blockName'] = 'core/updated';
</span><span class="cx" style="display: block; padding: 0 10px"> $blocks[0] = new WP_Block( $parsed_blocks[0], $context, $this->registry );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'core/updated', $blocks[0]->name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'core/updated', $blocks[0]->name );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test "offsetUnset".
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $blocks[0] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,10 +76,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $assertions = 0;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $blocks as $block ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'core/example', $block->name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'core/example', $block->name );
</ins><span class="cx" style="display: block; padding: 0 10px"> $assertions++;
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $block->inner_blocks as $inner_block ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'core/example', $inner_block->name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'core/example', $inner_block->name );
</ins><span class="cx" style="display: block; padding: 0 10px"> $assertions++;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -88,14 +88,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> while ( $blocks->valid() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $key = $blocks->key();
</span><span class="cx" style="display: block; padding: 0 10px"> $block = $blocks->current();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $key );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $key );
</ins><span class="cx" style="display: block; padding: 0 10px"> $assertions++;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'core/example', $block->name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'core/example', $block->name );
</ins><span class="cx" style="display: block; padding: 0 10px"> $assertions++;
</span><span class="cx" style="display: block; padding: 0 10px"> $blocks->next();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 4, $assertions );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 4, $assertions );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -106,7 +106,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $context = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $blocks = new WP_Block_List( $parsed_blocks, $context, $this->registry );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $blocks ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $blocks ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsblocksblockparserphp"></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/blocks/block-parser.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/block-parser.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/blocks/block-parser.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -69,7 +69,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $parser = new WP_Block_Parser();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = json_decode( json_encode( $parser->parse( $html ) ), true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $expected_parsed,
</span><span class="cx" style="display: block; padding: 0 10px"> $result,
</span><span class="cx" style="display: block; padding: 0 10px"> "File '$parsed_json_filename' does not match expected value"
</span></span></pre></div>
<a id="trunktestsphpunittestsblocksblocktyperegistryphp"></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/blocks/block-type-registry.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/block-type-registry.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/blocks/block-type-registry.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -106,9 +106,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $block_type = $this->registry->register( $name, $settings );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $name, $block_type->name );
- $this->assertEquals( $settings['icon'], $block_type->icon );
- $this->assertEquals( $block_type, $this->registry->get_registered( $name ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $name, $block_type->name );
+ $this->assertSame( $settings['icon'], $block_type->icon );
+ $this->assertSame( $block_type, $this->registry->get_registered( $name ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -167,8 +167,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->registry->register( $name, $settings );
</span><span class="cx" style="display: block; padding: 0 10px"> $block_type = $this->registry->unregister( $name );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $name, $block_type->name );
- $this->assertEquals( $settings['icon'], $block_type->icon );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $name, $block_type->name );
+ $this->assertSame( $settings['icon'], $block_type->icon );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->registry->is_registered( $name ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsblocksblocktypephp"></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/blocks/block-type.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/block-type.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/blocks/block-type.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -100,7 +100,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = $block_type->render( $attributes );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $attributes, json_decode( $output, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $attributes, json_decode( $output, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -123,7 +123,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = $block_type->render( $attributes, $content );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, json_decode( $output, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, json_decode( $output, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -133,7 +133,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $block_type = new WP_Block_Type( 'core/fake', array() );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = $block_type->render();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $output );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -223,7 +223,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $prepared_attributes = $block_type->prepare_attributes_for_render( $attributes );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $attributes, $prepared_attributes );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $attributes, $prepared_attributes );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsblocksblockphp"></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/blocks/block.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/block.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/blocks/block.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -57,10 +57,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $block = new WP_Block( $parsed_block, $context, $this->registry );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $parsed_block, $block->parsed_block );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $parsed_block['blockName'], $block->name );
- $this->assertEquals( $parsed_block['attrs'], $block->attributes );
- $this->assertEquals( $parsed_block['innerContent'], $block->inner_content );
- $this->assertEquals( $parsed_block['innerHTML'], $block->inner_html );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $parsed_block['blockName'], $block->name );
+ $this->assertSame( $parsed_block['attrs'], $block->attributes );
+ $this->assertSame( $parsed_block['innerContent'], $block->inner_content );
+ $this->assertSame( $parsed_block['innerHTML'], $block->inner_html );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -82,7 +82,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $block = new WP_Block( $parsed_block, $context, $this->registry );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( WP_Block_Type::class, $block->block_type );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $block_type_settings['attributes'],
</span><span class="cx" style="display: block; padding: 0 10px"> $block->block_type->attributes
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,10 +113,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $context = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $block = new WP_Block( $parsed_block, $context, $this->registry );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'explicit' => 20,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'defaulted' => 10,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'explicit' => 20,
</del><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $block->attributes
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -145,9 +145,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $context = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $block = new WP_Block( $parsed_block, $context, $this->registry );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'defaulted' => 10 ), $block->attributes );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'defaulted' => 10 ), $block->attributes );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Intentionally call a second time, to ensure property was assigned.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'defaulted' => 10 ), $block->attributes );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'defaulted' => 10 ), $block->attributes );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -168,7 +168,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $block = new WP_Block( $parsed_block, $context, $this->registry );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'requested' => 'included' ), $block->context );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'requested' => 'included' ), $block->context );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -184,7 +184,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $block->inner_blocks );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( WP_Block::class, $block->inner_blocks[0] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'core/example', $block->inner_blocks[0]->name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'core/example', $block->inner_blocks[0]->name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -217,7 +217,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $block = new WP_Block( $parsed_block, $context, $this->registry );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 0, $block->context );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'core/recordId' => 10 ),
</span><span class="cx" style="display: block; padding: 0 10px"> $block->inner_blocks[0]->context
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -253,15 +253,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $context = array( 'core/value' => 'original' );
</span><span class="cx" style="display: block; padding: 0 10px"> $block = new WP_Block( $parsed_block, $context, $this->registry );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'core/value' => 'original' ),
</span><span class="cx" style="display: block; padding: 0 10px"> $block->context
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'core/value' => 'merged' ),
</span><span class="cx" style="display: block; padding: 0 10px"> $block->inner_blocks[0]->context
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'core/value' => null ),
</span><span class="cx" style="display: block; padding: 0 10px"> $block->inner_blocks[0]->inner_blocks[0]->context
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span></span></pre></div>
<a id="trunktestsphpunittestsblocksregisterphp"></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/blocks/register.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/register.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/blocks/register.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -292,7 +292,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'star', $result->icon );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'Shows warning, error or success notices…', $result->description );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'alert', 'message' ), $result->keywords );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'message' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'string',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -302,7 +302,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $result->attributes
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'my-plugin/message' => 'message',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -309,7 +309,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result->provides_context
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'groupId' ), $result->uses_context );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'align' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'lightBlockWrapper' => true,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -316,7 +316,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $result->supports
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'name' => 'default',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -330,7 +330,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $result->styles
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'attributes' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'message' => 'This is a notice!',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -396,6 +396,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $registry = WP_Block_Type_Registry::get_instance();
</span><span class="cx" style="display: block; padding: 0 10px"> $block_type = $registry->get_registered( 'core/test-filtered' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'boolean', $block_type->attributes['core/test-filtered']['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'boolean', $block_type->attributes['core/test-filtered']['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsblocksrenderphp"></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/blocks/render.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/render.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/blocks/render.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,7 +60,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $actual_html = do_blocks( $original_html );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected_html, $actual_html );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected_html, $actual_html );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -80,7 +80,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_shortcode( 'someshortcode' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( trim( $classic_filtered_content ), trim( $block_filtered_content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( trim( $classic_filtered_content ), trim( $block_filtered_content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function handle_shortcode( $atts, $content ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -121,7 +121,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<!-- wp:core/test -->' . $content . '<!-- /wp:core/test -->';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'deep inside', do_blocks( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'deep inside', do_blocks( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_can_nest_at_least_so_deep_with_dynamic_blocks() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -142,7 +142,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $minimum_depth, (int) do_blocks( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $minimum_depth, (int) do_blocks( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function render_dynamic_incrementer( $attrs, $content ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -160,7 +160,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $filtered_content = trim( apply_filters( 'the_content', $test_content ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_content, $filtered_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_content, $filtered_content );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that wpautop() is still defined in the same place.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $current_priority, has_action( 'the_content', 'wpautop' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -174,7 +174,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $filtered_content = trim( apply_filters( 'the_content', $test_content ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_content, $filtered_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_content, $filtered_content );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $current_priority, has_action( 'the_content', 'wpautop' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_action( 'the_content', '_restore_wpautop_hook' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -222,7 +222,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $html = do_blocks( self::strip_r( file_get_contents( $html_path ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_html = self::strip_r( file_get_contents( $server_html_path ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $expected_html,
</span><span class="cx" style="display: block; padding: 0 10px"> $html,
</span><span class="cx" style="display: block; padding: 0 10px"> "File '$html_path' does not match expected value"
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -252,7 +252,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'after';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $updated_post_content = do_blocks( $post_content );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $updated_post_content,
</span><span class="cx" style="display: block; padding: 0 10px"> 'before' .
</span><span class="cx" style="display: block; padding: 0 10px"> '1:b1' .
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -286,7 +286,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $global_post = $post;
</span><span class="cx" style="display: block; padding: 0 10px"> do_blocks( '<!-- wp:core/test /-->' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $global_post, $post );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $global_post, $post );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_render_latest_comments_on_password_protected_post() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -342,7 +342,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = unserialize( base64_decode( $output ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'inner', $data[1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'inner', $data[1] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_dynamic_block_gets_rendered_inner_blocks() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -370,7 +370,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = unserialize( base64_decode( $output ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'before10after', $data[1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'before10after', $data[1] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_dynamic_block_gets_rendered_inner_dynamic_blocks() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -390,7 +390,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $inner = $this->render_serialize_dynamic_block( array(), 'deep inner' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $data[1], 'before' . $inner . 'after' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $data[1], 'before' . $inner . 'after' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsblocksserializationphp"></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/blocks/serialization.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/serialization.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/blocks/serialization.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,7 +25,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = serialize_blocks( $blocks );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = $original;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_serialize_identity_from_parsed() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,10 +51,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_serialized_block_name() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( null, strip_core_block_namespace( null ) );
- $this->assertEquals( 'example', strip_core_block_namespace( 'example' ) );
- $this->assertEquals( 'example', strip_core_block_namespace( 'core/example' ) );
- $this->assertEquals( 'plugin/example', strip_core_block_namespace( 'plugin/example' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( strip_core_block_namespace( null ) );
+ $this->assertSame( 'example', strip_core_block_namespace( 'example' ) );
+ $this->assertSame( 'example', strip_core_block_namespace( 'core/example' ) );
+ $this->assertSame( 'plugin/example', strip_core_block_namespace( 'plugin/example' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestscachephp"></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/cache.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/cache.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/cache.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -35,7 +35,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $val = 'val';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->cache->add( $key, $val );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_add_get_0() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,7 +44,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // You can store zero in the cache.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->cache->add( $key, $val );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_add_get_null() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,10 +63,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add $key to the cache.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->cache->add( $key, $val1 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val1, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val1, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // $key is in the cache, so reject new calls to add().
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->cache->add( $key, $val2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val1, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val1, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replace() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,9 +78,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->cache->replace( $key, $val ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->cache->get( $key ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->cache->add( $key, $val ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->cache->replace( $key, $val2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val2, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val2, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_set() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,10 +90,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // memcached accepts set() if the key does not exist.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->cache->set( $key, $val1 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val1, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val1, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Second set() with same key should be allowed.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->cache->set( $key, $val2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val2, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val2, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_flush() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -108,7 +108,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->cache->add( $key, $val );
</span><span class="cx" style="display: block; padding: 0 10px"> // Item is visible to both cache objects.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->cache->flush();
</span><span class="cx" style="display: block; padding: 0 10px"> // If there is no value get returns false.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->cache->get( $key ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -122,9 +122,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->cache->set( $key, $object_a );
</span><span class="cx" style="display: block; padding: 0 10px"> $object_a->foo = 'bravo';
</span><span class="cx" style="display: block; padding: 0 10px"> $object_b = $this->cache->get( $key );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'alpha', $object_b->foo );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'alpha', $object_b->foo );
</ins><span class="cx" style="display: block; padding: 0 10px"> $object_b->foo = 'charlie';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bravo', $object_a->foo );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bravo', $object_a->foo );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $key = __FUNCTION__ . '_2';
</span><span class="cx" style="display: block; padding: 0 10px"> $object_a = new stdClass;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -132,9 +132,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->cache->add( $key, $object_a );
</span><span class="cx" style="display: block; padding: 0 10px"> $object_a->foo = 'bravo';
</span><span class="cx" style="display: block; padding: 0 10px"> $object_b = $this->cache->get( $key );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'alpha', $object_b->foo );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'alpha', $object_b->foo );
</ins><span class="cx" style="display: block; padding: 0 10px"> $object_b->foo = 'charlie';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bravo', $object_a->foo );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bravo', $object_a->foo );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incr() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -144,10 +144,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->cache->set( $key, 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->cache->incr( $key );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->cache->incr( $key, 2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_cache_incr() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -157,10 +157,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_set( $key, 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_incr( $key );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, wp_cache_get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, wp_cache_get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_incr( $key, 2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, wp_cache_get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, wp_cache_get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_decr() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -170,14 +170,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->cache->set( $key, 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->cache->decr( $key );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->cache->set( $key, 3 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->cache->decr( $key );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->cache->decr( $key, 2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -190,14 +190,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_set( $key, 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_decr( $key );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, wp_cache_get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, wp_cache_get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_set( $key, 3 );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_decr( $key );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, wp_cache_get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, wp_cache_get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_decr( $key, 2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, wp_cache_get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, wp_cache_get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_delete() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -206,7 +206,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify set.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->cache->set( $key, $val ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify successful delete.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->cache->delete( $key ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -221,7 +221,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify set.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( wp_cache_set( $key, $val ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, wp_cache_get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, wp_cache_get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify successful delete.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( wp_cache_delete( $key ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -246,38 +246,38 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_multisite() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Single site ingnores switch_to_blog().
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->cache->set( $key, $val ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->cache->switch_to_blog( 999 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->cache->set( $key, $val2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val2, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val2, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->cache->switch_to_blog( get_current_blog_id() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val2, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val2, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> // Multisite should have separate per-blog caches.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->cache->set( $key, $val ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->cache->switch_to_blog( 999 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->cache->get( $key ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->cache->set( $key, $val2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val2, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val2, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->cache->switch_to_blog( get_current_blog_id() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->cache->switch_to_blog( 999 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val2, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val2, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->cache->switch_to_blog( get_current_blog_id() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, $this->cache->get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, $this->cache->get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Global group.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->cache->set( $key, $val, 'global-cache-test' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, $this->cache->get( $key, 'global-cache-test' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, $this->cache->get( $key, 'global-cache-test' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->cache->switch_to_blog( 999 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, $this->cache->get( $key, 'global-cache-test' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, $this->cache->get( $key, 'global-cache-test' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->cache->set( $key, $val2, 'global-cache-test' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val2, $this->cache->get( $key, 'global-cache-test' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val2, $this->cache->get( $key, 'global-cache-test' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->cache->switch_to_blog( get_current_blog_id() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val2, $this->cache->get( $key, 'global-cache-test' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val2, $this->cache->get( $key, 'global-cache-test' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_cache_init() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -303,11 +303,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Save the first value to cache and verify.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_set( $key, $val1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val1, wp_cache_get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val1, wp_cache_get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Replace the value and verify.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_replace( $key, $val2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val2, wp_cache_get( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val2, wp_cache_get( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Non-existant key should fail.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wp_cache_replace( $fake_key, $val1 ) );
</span></span></pre></div>
<a id="trunktestsphpunittestscanonicalhttpsphp"></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/canonical/https.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/canonical/https.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/canonical/https.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,11 +24,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 27954
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_http_request_with_http_home() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> $redirect = redirect_canonical( $this->http, false );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $redirect, false );
-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $redirect );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -35,11 +33,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 27954
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_https_request_with_http_home() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> $redirect = redirect_canonical( $this->https, false );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $redirect, false );
-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $redirect );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,15 +42,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 27954
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_https_request_with_https_home() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'home_url', array( $this, 'set_https' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $redirect = redirect_canonical( $this->https, false );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $redirect, false );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $redirect );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'home_url', array( $this, 'set_https' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestscanonicalphp"></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/canonical.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/canonical.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/canonical.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -252,7 +252,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( '/child-page-1' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'wp', redirect_guess_404_permalink() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'wp', redirect_guess_404_permalink() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -268,7 +268,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( 'strict-redirect' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test default 'non-strict' redirect guess.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_permalink( $post ), redirect_guess_404_permalink() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_permalink( $post ), redirect_guess_404_permalink() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test 'strict' redirect guess.
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'strict_redirect_guess_404_permalink', '__return_true' );
</span></span></pre></div>
<a id="trunktestsphpunittestscategoryphp"></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/category.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/category.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/category.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,7 +29,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Validate length is 1 + created due to uncategorized.
</span><span class="cx" style="display: block; padding: 0 10px"> $cat_ids = get_all_category_ids();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $cat_ids ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $cat_ids ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -53,9 +53,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Validate category is returned by slug.
</span><span class="cx" style="display: block; padding: 0 10px"> $ret_testcat = get_category_by_slug( 'testcat' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $testcat->term_id, $ret_testcat->term_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $testcat->term_id, $ret_testcat->term_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $ret_testcat = get_category_by_slug( 'TeStCaT' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $testcat->term_id, $ret_testcat->term_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $testcat->term_id, $ret_testcat->term_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Validate unknown category returns false.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_category_by_slug( 'testcat3' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -107,36 +107,36 @@
</span><span class="cx" style="display: block; padding: 0 10px"> _make_cat_compat( $testcat2_array );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Validate compatibility object.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $testcat->cat_ID, $testcat->term_id );
- $this->assertEquals( $testcat->category_count, $testcat->count );
- $this->assertEquals( $testcat->category_description, $testcat->description );
- $this->assertEquals( $testcat->cat_name, $testcat->name );
- $this->assertEquals( $testcat->category_nicename, $testcat->slug );
- $this->assertEquals( $testcat->category_parent, $testcat->parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $testcat->cat_ID, $testcat->term_id );
+ $this->assertSame( $testcat->category_count, $testcat->count );
+ $this->assertSame( $testcat->category_description, $testcat->description );
+ $this->assertSame( $testcat->cat_name, $testcat->name );
+ $this->assertSame( $testcat->category_nicename, $testcat->slug );
+ $this->assertSame( $testcat->category_parent, $testcat->parent );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Validate compatibility object with parent.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $testcat->cat_ID, $testcat->term_id );
- $this->assertEquals( $testcat->category_count, $testcat->count );
- $this->assertEquals( $testcat->category_description, $testcat->description );
- $this->assertEquals( $testcat->cat_name, $testcat->name );
- $this->assertEquals( $testcat->category_nicename, $testcat->slug );
- $this->assertEquals( $testcat->category_parent, $testcat->parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $testcat->cat_ID, $testcat->term_id );
+ $this->assertSame( $testcat->category_count, $testcat->count );
+ $this->assertSame( $testcat->category_description, $testcat->description );
+ $this->assertSame( $testcat->cat_name, $testcat->name );
+ $this->assertSame( $testcat->category_nicename, $testcat->slug );
+ $this->assertSame( $testcat->category_parent, $testcat->parent );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Validate compatibility array.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $testcat_array['cat_ID'], $testcat_array['term_id'] );
- $this->assertEquals( $testcat_array['category_count'], $testcat_array['count'] );
- $this->assertEquals( $testcat_array['category_description'], $testcat_array['description'] );
- $this->assertEquals( $testcat_array['cat_name'], $testcat_array['name'] );
- $this->assertEquals( $testcat_array['category_nicename'], $testcat_array['slug'] );
- $this->assertEquals( $testcat_array['category_parent'], $testcat_array['parent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $testcat_array['cat_ID'], $testcat_array['term_id'] );
+ $this->assertSame( $testcat_array['category_count'], $testcat_array['count'] );
+ $this->assertSame( $testcat_array['category_description'], $testcat_array['description'] );
+ $this->assertSame( $testcat_array['cat_name'], $testcat_array['name'] );
+ $this->assertSame( $testcat_array['category_nicename'], $testcat_array['slug'] );
+ $this->assertSame( $testcat_array['category_parent'], $testcat_array['parent'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Validate compatibility array with parent.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $testcat_array['cat_ID'], $testcat_array['term_id'] );
- $this->assertEquals( $testcat_array['category_count'], $testcat_array['count'] );
- $this->assertEquals( $testcat_array['category_description'], $testcat_array['description'] );
- $this->assertEquals( $testcat_array['cat_name'], $testcat_array['name'] );
- $this->assertEquals( $testcat_array['category_nicename'], $testcat_array['slug'] );
- $this->assertEquals( $testcat_array['category_parent'], $testcat_array['parent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $testcat_array['cat_ID'], $testcat_array['term_id'] );
+ $this->assertSame( $testcat_array['category_count'], $testcat_array['count'] );
+ $this->assertSame( $testcat_array['category_description'], $testcat_array['description'] );
+ $this->assertSame( $testcat_array['cat_name'], $testcat_array['name'] );
+ $this->assertSame( $testcat_array['category_nicename'], $testcat_array['slug'] );
+ $this->assertSame( $testcat_array['category_parent'], $testcat_array['parent'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -153,9 +153,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Validate.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $testcat->name, get_cat_name( $testcat->term_id ) );
- $this->assertEquals( '', get_cat_name( -1 ) );
- $this->assertEquals( '', get_cat_name( $testcat->term_id + 100 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $testcat->name, get_cat_name( $testcat->term_id ) );
+ $this->assertSame( '', get_cat_name( -1 ) );
+ $this->assertSame( '', get_cat_name( $testcat->term_id + 100 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -173,9 +173,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Validate.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $testcat->term_id, get_cat_ID( $testcat->name ) );
- $this->assertEquals( 0, get_cat_ID( 'NO CAT' ) );
- $this->assertEquals( 0, get_cat_ID( 12 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $testcat->term_id, get_cat_ID( $testcat->name ) );
+ $this->assertSame( 0, get_cat_ID( 'NO CAT' ) );
+ $this->assertSame( 0, get_cat_ID( 12 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -229,17 +229,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Validate full match.
</span><span class="cx" style="display: block; padding: 0 10px"> $ret_cat = get_category_by_path( '/root/level-1', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $root_level_id, $ret_cat->term_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $root_level_id, $ret_cat->term_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( get_category_by_path( 'level-1', true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( get_category_by_path( 'nocat/nocat/', true ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Validate partial match.
</span><span class="cx" style="display: block; padding: 0 10px"> $ret_cat = get_category_by_path( 'level-1', false );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $root_level_id, $ret_cat->term_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $root_level_id, $ret_cat->term_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $ret_cat = get_category_by_path( 'root/cat/level-1', false );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $root_level_id, $ret_cat->term_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $root_level_id, $ret_cat->term_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $ret_cat = get_category_by_path( 'root$2Fcat%20%2Flevel-1', false );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $root_level_id, $ret_cat->term_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $root_level_id, $ret_cat->term_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( get_category_by_path( 'nocat/nocat/', false ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestscommentdateQueryphp"></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/comment/dateQuery.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment/dateQuery.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/comment/dateQuery.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,6 +77,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '2008-12-10 13:06:27',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_dates, wp_list_pluck( $comments, 'comment_date' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_dates, wp_list_pluck( $comments, 'comment_date' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestscommentgetCommentAuthorEmailLinkphp"></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/comment/getCommentAuthorEmailLink.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment/getCommentAuthorEmailLink.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/comment/getCommentAuthorEmailLink.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_global_comment_with_default_parameters() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<a href="mailto:foo@example.org">foo@example.org</a>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_comment_author_email_link() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_comment_author_email_link() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -53,7 +53,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = sprintf( '%1$s<a href="mailto:%2$s">%3$s</a>%4$s', $before, $email, $linktext, $after );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_comment_author_email_link( $linktext, $before, $after, $comment ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_comment_author_email_link( $linktext, $before, $after, $comment ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_all_parameters_with_global_comment() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,25 +63,25 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = sprintf( '%1$s<a href="mailto:foo@example.org">%2$s</a>%3$s', $before, $linktext, $after );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_comment_author_email_link( $linktext, $before, $after ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_comment_author_email_link( $linktext, $before, $after ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_linktext() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = sprintf( '<a href="mailto:foo@example.org">%1$s</a>', $linktext = 'linktext' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_comment_author_email_link( $linktext ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_comment_author_email_link( $linktext ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_before() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = sprintf( '%1$s<a href="mailto:foo@example.org">foo@example.org</a>', $before = 'before' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_comment_author_email_link( '', $before ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_comment_author_email_link( '', $before ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_after() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = sprintf( '<a href="mailto:foo@example.org">foo@example.org</a>%1$s', $after = 'after' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_comment_author_email_link( '', '', $after ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_comment_author_email_link( '', '', $after ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -96,6 +96,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = sprintf( '<a href="mailto:%1$s">%2$s</a>', $email, $email );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_comment_author_email_link( '', '', '', $comment ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_comment_author_email_link( '', '', '', $comment ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestscommentgetCommentAuthorUrlLinkphp"></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/comment/getCommentAuthorUrlLink.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment/getCommentAuthorUrlLink.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/comment/getCommentAuthorUrlLink.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_no_comment() {
</span><span class="cx" style="display: block; padding: 0 10px"> $url_link = get_comment_author_url_link();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "<a href='' rel='external'></a>", $url_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "<a href='' rel='external'></a>", $url_link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_global_comment() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $url_link = get_comment_author_url_link();
</span><span class="cx" style="display: block; padding: 0 10px"> $link = $this->parseCommentAuthorUrl( $comment );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $link, $url_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $link, $url_link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_comment_arg() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,7 +44,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $url_link = get_comment_author_url_link( '', '', '', $comment );
</span><span class="cx" style="display: block; padding: 0 10px"> $link = $this->parseCommentAuthorUrl( $comment );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $link, $url_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $link, $url_link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_linktext() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,7 +52,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $url_link = get_comment_author_url_link( 'Burrito', '', '', $comment );
</span><span class="cx" style="display: block; padding: 0 10px"> $link = $this->parseCommentAuthorUrl( $comment, 'Burrito' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $link, $url_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $link, $url_link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_before() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,7 +60,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $url_link = get_comment_author_url_link( 'Burrito', 'I would love a ', '', $comment );
</span><span class="cx" style="display: block; padding: 0 10px"> $link = 'I would love a ' . $this->parseCommentAuthorUrl( $comment, 'Burrito' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $link, $url_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $link, $url_link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_after() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,7 +68,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $url_link = get_comment_author_url_link( 'Burrito', '', ' is my favorite word.', $comment );
</span><span class="cx" style="display: block; padding: 0 10px"> $link = $this->parseCommentAuthorUrl( $comment, 'Burrito' ) . ' is my favorite word.';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $link, $url_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $link, $url_link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_before_after() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,6 +76,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $url_link = get_comment_author_url_link( 'Burrito', 'I would love a ', ' right now.', $comment );
</span><span class="cx" style="display: block; padding: 0 10px"> $link = 'I would love a ' . $this->parseCommentAuthorUrl( $comment, 'Burrito' ) . ' right now.';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $link, $url_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $link, $url_link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestscommentgetCommentExcerptphp"></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/comment/getCommentExcerpt.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment/getCommentExcerpt.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/comment/getCommentExcerpt.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,7 +22,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $excerpt = get_comment_excerpt( $comment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 20, count( explode( ' ', $excerpt ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 20, count( explode( ' ', $excerpt ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_comment_excerpt_filtered() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $excerpt = get_comment_excerpt( $comment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, count( explode( ' ', $excerpt ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, count( explode( ' ', $excerpt ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function _filter_comment_excerpt_length() {
</span></span></pre></div>
<a id="trunktestsphpunittestscommentgetCommentsPagesCountphp"></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/comment/getCommentsPagesCount.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment/getCommentsPagesCount.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/comment/getCommentsPagesCount.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,12 +52,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comments = get_comments( array( 'post_id' => $post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, get_comment_pages_count( $comments, 10, false ) );
- $this->assertEquals( 0, get_comment_pages_count( $comments, 1, false ) );
- $this->assertEquals( 0, get_comment_pages_count( $comments, 0, false ) );
- $this->assertEquals( 0, get_comment_pages_count( $comments, 10, true ) );
- $this->assertEquals( 0, get_comment_pages_count( $comments, 5 ) );
- $this->assertEquals( 0, get_comment_pages_count( $comments ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, get_comment_pages_count( $comments, 10, false ) );
+ $this->assertSame( 0, get_comment_pages_count( $comments, 1, false ) );
+ $this->assertSame( 0, get_comment_pages_count( $comments, 0, false ) );
+ $this->assertSame( 0, get_comment_pages_count( $comments, 10, true ) );
+ $this->assertSame( 0, get_comment_pages_count( $comments, 5 ) );
+ $this->assertSame( 0, get_comment_pages_count( $comments ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertequals( 0, get_comment_pages_count( null, 1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestscommentgetPageOfCommentphp"></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/comment/getPageOfComment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment/getPageOfComment.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/comment/getPageOfComment.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,11 +28,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> self::factory()->comment->create_post_comments( $p, 1, array( 'comment_date' => '2013-09-15 00:00:00' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $comment_first = self::factory()->comment->create_post_comments( $p, 1, array( 'comment_date' => '2013-09-14 00:00:00' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 4, get_page_of_comment( $comment_last[0], array( 'per_page' => 3 ) ) );
- $this->assertEquals( 2, get_page_of_comment( $comment_last[0], array( 'per_page' => 10 ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 4, get_page_of_comment( $comment_last[0], array( 'per_page' => 3 ) ) );
+ $this->assertSame( 2, get_page_of_comment( $comment_last[0], array( 'per_page' => 10 ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, get_page_of_comment( $comment_first[0], array( 'per_page' => 3 ) ) );
- $this->assertEquals( 1, get_page_of_comment( $comment_first[0], array( 'per_page' => 10 ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, get_page_of_comment( $comment_first[0], array( 'per_page' => 3 ) ) );
+ $this->assertSame( 1, get_page_of_comment( $comment_first[0], array( 'per_page' => 10 ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_type_pings() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,7 +63,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $now -= 10 * $i;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> 2,
</span><span class="cx" style="display: block; padding: 0 10px"> get_page_of_comment(
</span><span class="cx" style="display: block; padding: 0 10px"> $trackbacks[0],
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -73,7 +73,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> 3,
</span><span class="cx" style="display: block; padding: 0 10px"> get_page_of_comment(
</span><span class="cx" style="display: block; padding: 0 10px"> $pingbacks[0],
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,7 +83,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> 5,
</span><span class="cx" style="display: block; padding: 0 10px"> get_page_of_comment(
</span><span class="cx" style="display: block; padding: 0 10px"> $trackbacks[0],
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -148,7 +148,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'trackback',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $page_trackbacks );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $page_trackbacks );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px"> $page_comments = get_page_of_comment(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -158,7 +158,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'comment',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $page_comments );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $page_comments );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $num_queries, $wpdb->num_queries );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -243,11 +243,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, get_page_of_comment( $c1, array( 'per_page' => 2 ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, get_page_of_comment( $c1, array( 'per_page' => 2 ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_comment_status( $c3, '1' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, get_page_of_comment( $c1, array( 'per_page' => 2 ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, get_page_of_comment( $c1, array( 'per_page' => 2 ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -275,10 +275,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found_0 = get_page_of_comment( $comments_0[0], array( 'per_page' => 2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, $found_0 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, $found_0 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found_1 = get_page_of_comment( $comments_1[1], array( 'per_page' => 2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $found_1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $found_1 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -357,7 +357,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'page_comments', 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'comments_per_page', 2 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, get_page_of_comment( $c1 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, get_page_of_comment( $c1 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -397,7 +397,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'page_comments', 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'comments_per_page', 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, get_page_of_comment( $c3 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, get_page_of_comment( $c3 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -437,7 +437,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'page_comments', 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'comments_per_page', 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, get_page_of_comment( $c3 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, get_page_of_comment( $c3 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestscommentqueryphp"></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/comment/query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment/query.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/comment/query.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -722,7 +722,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $c2 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $c2 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -758,7 +758,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $c2 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $c2 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -874,7 +874,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $c2 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $c2 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -910,7 +910,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $c2 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $c2 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1016,7 +1016,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $c2 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $c2 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1044,7 +1044,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $c1 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $c1 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_status_custom() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1075,7 +1075,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $c2 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $c2 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_status_all() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1293,8 +1293,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px"> self::factory()->comment->create_post_comments( $post_id, $limit );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $comments = get_comments( array( 'post_id' => $post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $limit, count( $comments ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $limit, count( $comments ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $comments as $comment ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $post_id, $comment->comment_post_ID );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1301,8 +1302,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id2 = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px"> self::factory()->comment->create_post_comments( $post_id2, $limit );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $comments = get_comments( array( 'post_id' => $post_id2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $limit, count( $comments ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $limit, count( $comments ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $comments as $comment ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $post_id2, $comment->comment_post_ID );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1309,8 +1311,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id3 = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px"> self::factory()->comment->create_post_comments( $post_id3, $limit, array( 'comment_approved' => '0' ) );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $comments = get_comments( array( 'post_id' => $post_id3 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $limit, count( $comments ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $limit, count( $comments ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $comments as $comment ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $post_id3, $comment->comment_post_ID );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1321,7 +1324,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'status' => 'hold',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $limit, count( $comments ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $limit, count( $comments ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $comments as $comment ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $post_id3, $comment->comment_post_ID );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1332,11 +1335,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'status' => 'approve',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $comments ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $comments ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> self::factory()->comment->create_post_comments( $post_id3, $limit, array( 'comment_approved' => '1' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $comments = get_comments( array( 'post_id' => $post_id3 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $limit * 2, count( $comments ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $limit * 2, count( $comments ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $comments as $comment ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $post_id3, $comment->comment_post_ID );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1363,7 +1366,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'orderby' => array( 'key' ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $comments ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $comments ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $comment_id2, $comments[0]->comment_ID );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $comment_id, $comments[1]->comment_ID );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1373,7 +1376,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'orderby' => array( 'meta_value' ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $comments ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $comments ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $comment_id2, $comments[0]->comment_ID );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $comment_id, $comments[1]->comment_ID );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1384,7 +1387,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'order' => 'ASC',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $comments ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $comments ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $comment_id, $comments[0]->comment_ID );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $comment_id2, $comments[1]->comment_ID );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1395,7 +1398,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'order' => 'ASC',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $comments ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $comments ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $comment_id, $comments[0]->comment_ID );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $comment_id2, $comments[1]->comment_ID );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1423,7 +1426,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'orderby' => array( 'key' ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $comments ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $comments ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comments = get_comments(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1431,7 +1434,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'orderby' => array( 'meta_value' ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $comments ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $comments ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1458,7 +1461,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $comments[1], $comments[2], $comments[0] ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $comments[1], $comments[2], $comments[0] ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1502,7 +1505,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $c3, $c1, $c2 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $c3, $c1, $c2 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1539,7 +1542,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $comments[2], $comments[0], $comments[1] ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $comments[2], $comments[0], $comments[1] ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1565,7 +1568,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $comments[2] ), $q->get_comments() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $comments[2] ), $q->get_comments() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1591,7 +1594,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $comments[0] ), $q->get_comments() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $comments[0] ), $q->get_comments() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2896,7 +2899,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2937,7 +2940,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3672,7 +3675,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $c2, $c3 ), $ids->comments );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $c2, $c3 ), $ids->comments );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3689,8 +3692,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $q->found_comments );
- $this->assertEquals( 0, $q->max_num_pages );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $q->found_comments );
+ $this->assertSame( 0, $q->max_num_pages );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3707,8 +3710,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $q->found_comments );
- $this->assertEquals( 0, $q->max_num_pages );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $q->found_comments );
+ $this->assertSame( 0, $q->max_num_pages );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3725,7 +3728,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, $q->found_comments );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, $q->found_comments );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 2, $q->max_num_pages );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3795,7 +3798,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $top_level_comments[0], $top_level_comments[1] ), $q->comments );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $top_level_comments[0], $top_level_comments[1] ), $q->comments );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4676,7 +4679,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'count' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $number_of_queries + 1, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $number_of_queries + 1, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4705,7 +4708,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'count' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $number_of_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $number_of_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4733,7 +4736,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $number_of_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $number_of_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4905,7 +4908,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( array( 555 ), $results );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure manually setting total_users doesn't get overwritten.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $q->found_comments );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $q->found_comments );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public static function filter_comments_pre_query( $comments, $query ) {
</span></span></pre></div>
<a id="trunktestsphpunittestscommentslashesphp"></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/comment/slashes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment/slashes.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/comment/slashes.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,8 +43,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_1 ), $comment->comment_author );
- $this->assertEquals( wp_unslash( $this->slash_7 ), $comment->comment_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_1 ), $comment->comment_author );
+ $this->assertSame( wp_unslash( $this->slash_7 ), $comment->comment_content );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'comment_post_ID' => $post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -58,8 +58,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_2 ), $comment->comment_author );
- $this->assertEquals( wp_unslash( $this->slash_4 ), $comment->comment_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_2 ), $comment->comment_author );
+ $this->assertSame( wp_unslash( $this->slash_4 ), $comment->comment_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -88,8 +88,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> edit_comment();
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $comment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->slash_1, $comment->comment_author );
- $this->assertEquals( $this->slash_7, $comment->comment_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->slash_1, $comment->comment_author );
+ $this->assertSame( $this->slash_7, $comment->comment_content );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['comment_ID'] = $comment_id;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,8 +104,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> edit_comment();
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $comment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->slash_2, $comment->comment_author );
- $this->assertEquals( $this->slash_4, $comment->comment_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->slash_2, $comment->comment_author );
+ $this->assertSame( $this->slash_4, $comment->comment_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -123,8 +123,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $comment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_1 ), $comment->comment_author );
- $this->assertEquals( wp_unslash( $this->slash_7 ), $comment->comment_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_1 ), $comment->comment_author );
+ $this->assertSame( wp_unslash( $this->slash_7 ), $comment->comment_content );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment_id = wp_insert_comment(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -135,8 +135,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $comment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_2 ), $comment->comment_author );
- $this->assertEquals( wp_unslash( $this->slash_4 ), $comment->comment_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_2 ), $comment->comment_author );
+ $this->assertSame( wp_unslash( $this->slash_4 ), $comment->comment_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -159,8 +159,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $comment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_1 ), $comment->comment_author );
- $this->assertEquals( wp_unslash( $this->slash_7 ), $comment->comment_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_1 ), $comment->comment_author );
+ $this->assertSame( wp_unslash( $this->slash_7 ), $comment->comment_content );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_comment(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -171,8 +171,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $comment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_2 ), $comment->comment_author );
- $this->assertEquals( wp_unslash( $this->slash_4 ), $comment->comment_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_2 ), $comment->comment_author );
+ $this->assertSame( wp_unslash( $this->slash_4 ), $comment->comment_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestscommenttemplatephp"></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/comment/template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment/template.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/comment/template.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,14 +7,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_comments_number() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, get_comments_number( 0 ) );
- $this->assertEquals( 0, get_comments_number( $post_id ) );
- $this->assertEquals( 0, get_comments_number( get_post( $post_id ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, get_comments_number( 0 ) );
+ $this->assertSame( '0', get_comments_number( $post_id ) );
+ $this->assertSame( '0', get_comments_number( get_post( $post_id ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> self::factory()->comment->create_post_comments( $post_id, 12 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 12, get_comments_number( $post_id ) );
- $this->assertEquals( 12, get_comments_number( get_post( $post_id ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '12', get_comments_number( $post_id ) );
+ $this->assertSame( '12', get_comments_number( get_post( $post_id ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_comments_number_without_arg() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,12 +22,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $permalink = get_permalink( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( $permalink );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, get_comments_number() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0', get_comments_number() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> self::factory()->comment->create_post_comments( $post_id, 12 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( $permalink );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 12, get_comments_number() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '12', get_comments_number() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,13 +39,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comments_number_text = get_comments_number_text( false, false, false, $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( _n( '%s Comment', '%s Comments', 6 ), '6' ), $comments_number_text );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( _n( '%s Comment', '%s Comments', 6 ), '6' ), $comments_number_text );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> comments_number( false, false, false, $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $comments_number_text = ob_get_clean();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( _n( '%s Comment', '%s Comments', 6 ), '6' ), $comments_number_text );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( _n( '%s Comment', '%s Comments', 6 ), '6' ), $comments_number_text );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -57,17 +57,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $permalink = get_permalink( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( $permalink );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( __( 'No Comments' ), get_comments_number_text() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( __( 'No Comments' ), get_comments_number_text() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->factory->comment->create_post_comments( $post_id, 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( $permalink );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( __( '1 Comment' ), get_comments_number_text() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( __( '1 Comment' ), get_comments_number_text() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->factory->comment->create_post_comments( $post_id, 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( $permalink );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( _n( '%s Comment', '%s Comments', 2 ), '2' ), get_comments_number_text() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( _n( '%s Comment', '%s Comments', 2 ), '2' ), get_comments_number_text() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -84,7 +84,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'gettext_with_context', array( $this, '_enable_comment_number_declension' ), 10, 4 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $output, get_comments_number_text( false, false, $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $output, get_comments_number_text( false, false, $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'gettext_with_context', array( $this, '_enable_comment_number_declension' ), 10, 4 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestscommentwpBatchUpdateCommentTypephp"></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/comment/wpBatchUpdateCommentType.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment/wpBatchUpdateCommentType.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/comment/wpBatchUpdateCommentType.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,7 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $comment_ids as $comment_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $updated_comment = get_comment( $comment_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'comment', $updated_comment->comment_type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'comment', $updated_comment->comment_type );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestscommentwpCountCommentsphp"></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/comment/wpCountComments.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment/wpCountComments.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/comment/wpCountComments.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,13 +5,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_count_comments() {
</span><span class="cx" style="display: block; padding: 0 10px"> $count = wp_count_comments();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $count->approved );
- $this->assertEquals( 0, $count->moderated );
- $this->assertEquals( 0, $count->spam );
- $this->assertEquals( 0, $count->trash );
- $this->assertEquals( 0, $count->{'post-trashed'} );
- $this->assertEquals( 0, $count->total_comments );
- $this->assertEquals( 0, $count->all );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $count->approved );
+ $this->assertSame( 0, $count->moderated );
+ $this->assertSame( 0, $count->spam );
+ $this->assertSame( 0, $count->trash );
+ $this->assertSame( 0, $count->{'post-trashed'} );
+ $this->assertSame( 0, $count->total_comments );
+ $this->assertSame( 0, $count->all );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_count_comments_approved() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,13 +23,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $count = wp_count_comments();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $count->approved );
- $this->assertEquals( 0, $count->moderated );
- $this->assertEquals( 0, $count->spam );
- $this->assertEquals( 0, $count->trash );
- $this->assertEquals( 0, $count->{'post-trashed'} );
- $this->assertEquals( 1, $count->total_comments );
- $this->assertEquals( 1, $count->all );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $count->approved );
+ $this->assertSame( 0, $count->moderated );
+ $this->assertSame( 0, $count->spam );
+ $this->assertSame( 0, $count->trash );
+ $this->assertSame( 0, $count->{'post-trashed'} );
+ $this->assertSame( 1, $count->total_comments );
+ $this->assertSame( 1, $count->all );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_count_comments_awaiting() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,13 +41,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $count = wp_count_comments();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $count->approved );
- $this->assertEquals( 1, $count->moderated );
- $this->assertEquals( 0, $count->spam );
- $this->assertEquals( 0, $count->trash );
- $this->assertEquals( 0, $count->{'post-trashed'} );
- $this->assertEquals( 1, $count->total_comments );
- $this->assertEquals( 1, $count->all );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $count->approved );
+ $this->assertSame( 1, $count->moderated );
+ $this->assertSame( 0, $count->spam );
+ $this->assertSame( 0, $count->trash );
+ $this->assertSame( 0, $count->{'post-trashed'} );
+ $this->assertSame( 1, $count->total_comments );
+ $this->assertSame( 1, $count->all );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_count_comments_spam() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,13 +59,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $count = wp_count_comments();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $count->approved );
- $this->assertEquals( 0, $count->moderated );
- $this->assertEquals( 1, $count->spam );
- $this->assertEquals( 0, $count->trash );
- $this->assertEquals( 0, $count->{'post-trashed'} );
- $this->assertEquals( 1, $count->total_comments );
- $this->assertEquals( 0, $count->all );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $count->approved );
+ $this->assertSame( 0, $count->moderated );
+ $this->assertSame( 1, $count->spam );
+ $this->assertSame( 0, $count->trash );
+ $this->assertSame( 0, $count->{'post-trashed'} );
+ $this->assertSame( 1, $count->total_comments );
+ $this->assertSame( 0, $count->all );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_count_comments_trash() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,13 +77,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $count = wp_count_comments();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $count->approved );
- $this->assertEquals( 0, $count->moderated );
- $this->assertEquals( 0, $count->spam );
- $this->assertEquals( 1, $count->trash );
- $this->assertEquals( 0, $count->{'post-trashed'} );
- $this->assertEquals( 0, $count->total_comments );
- $this->assertEquals( 0, $count->all );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $count->approved );
+ $this->assertSame( 0, $count->moderated );
+ $this->assertSame( 0, $count->spam );
+ $this->assertSame( 1, $count->trash );
+ $this->assertSame( 0, $count->{'post-trashed'} );
+ $this->assertSame( 0, $count->total_comments );
+ $this->assertSame( 0, $count->all );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_count_comments_post_trashed() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -95,13 +95,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $count = wp_count_comments();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $count->approved );
- $this->assertEquals( 0, $count->moderated );
- $this->assertEquals( 0, $count->spam );
- $this->assertEquals( 0, $count->trash );
- $this->assertEquals( 1, $count->{'post-trashed'} );
- $this->assertEquals( 0, $count->total_comments );
- $this->assertEquals( 0, $count->all );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $count->approved );
+ $this->assertSame( 0, $count->moderated );
+ $this->assertSame( 0, $count->spam );
+ $this->assertSame( 0, $count->trash );
+ $this->assertSame( 1, $count->{'post-trashed'} );
+ $this->assertSame( 0, $count->total_comments );
+ $this->assertSame( 0, $count->all );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_count_comments_cache() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -119,88 +119,88 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $count1 = wp_count_comments( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $count1->approved );
- $this->assertEquals( 0, $count1->moderated );
- $this->assertEquals( 0, $count1->spam );
- $this->assertEquals( 0, $count1->trash );
- $this->assertEquals( 0, $count1->{'post-trashed'} );
- $this->assertEquals( 1, $count1->total_comments );
- $this->assertEquals( 1, $count1->all );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $count1->approved );
+ $this->assertSame( 0, $count1->moderated );
+ $this->assertSame( 0, $count1->spam );
+ $this->assertSame( 0, $count1->trash );
+ $this->assertSame( 0, $count1->{'post-trashed'} );
+ $this->assertSame( 1, $count1->total_comments );
+ $this->assertSame( 1, $count1->all );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $all_count1 = wp_count_comments();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $all_count1->approved );
- $this->assertEquals( 0, $all_count1->moderated );
- $this->assertEquals( 0, $all_count1->spam );
- $this->assertEquals( 0, $all_count1->trash );
- $this->assertEquals( 0, $all_count1->{'post-trashed'} );
- $this->assertEquals( 1, $all_count1->total_comments );
- $this->assertEquals( 1, $all_count1->all );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $all_count1->approved );
+ $this->assertSame( 0, $all_count1->moderated );
+ $this->assertSame( 0, $all_count1->spam );
+ $this->assertSame( 0, $all_count1->trash );
+ $this->assertSame( 0, $all_count1->{'post-trashed'} );
+ $this->assertSame( 1, $all_count1->total_comments );
+ $this->assertSame( 1, $all_count1->all );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_spam_comment( $comment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $count2 = wp_count_comments( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $count2->approved );
- $this->assertEquals( 0, $count2->moderated );
- $this->assertEquals( 1, $count2->spam );
- $this->assertEquals( 0, $count2->trash );
- $this->assertEquals( 0, $count2->{'post-trashed'} );
- $this->assertEquals( 1, $count2->total_comments );
- $this->assertEquals( 0, $count2->all );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $count2->approved );
+ $this->assertSame( 0, $count2->moderated );
+ $this->assertSame( 1, $count2->spam );
+ $this->assertSame( 0, $count2->trash );
+ $this->assertSame( 0, $count2->{'post-trashed'} );
+ $this->assertSame( 1, $count2->total_comments );
+ $this->assertSame( 0, $count2->all );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $all_count2 = wp_count_comments();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $all_count2->approved );
- $this->assertEquals( 0, $all_count2->moderated );
- $this->assertEquals( 1, $all_count2->spam );
- $this->assertEquals( 0, $all_count2->trash );
- $this->assertEquals( 0, $all_count2->{'post-trashed'} );
- $this->assertEquals( 1, $all_count2->total_comments );
- $this->assertEquals( 0, $all_count2->all );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $all_count2->approved );
+ $this->assertSame( 0, $all_count2->moderated );
+ $this->assertSame( 1, $all_count2->spam );
+ $this->assertSame( 0, $all_count2->trash );
+ $this->assertSame( 0, $all_count2->{'post-trashed'} );
+ $this->assertSame( 1, $all_count2->total_comments );
+ $this->assertSame( 0, $all_count2->all );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_trash_comment( $comment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $count3 = wp_count_comments( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $count3->approved );
- $this->assertEquals( 0, $count3->moderated );
- $this->assertEquals( 0, $count3->spam );
- $this->assertEquals( 1, $count3->trash );
- $this->assertEquals( 0, $count3->{'post-trashed'} );
- $this->assertEquals( 0, $count3->total_comments );
- $this->assertEquals( 0, $count3->all );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $count3->approved );
+ $this->assertSame( 0, $count3->moderated );
+ $this->assertSame( 0, $count3->spam );
+ $this->assertSame( 1, $count3->trash );
+ $this->assertSame( 0, $count3->{'post-trashed'} );
+ $this->assertSame( 0, $count3->total_comments );
+ $this->assertSame( 0, $count3->all );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $all_count3 = wp_count_comments();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $all_count3->approved );
- $this->assertEquals( 0, $all_count3->moderated );
- $this->assertEquals( 0, $all_count3->spam );
- $this->assertEquals( 1, $all_count3->trash );
- $this->assertEquals( 0, $all_count3->{'post-trashed'} );
- $this->assertEquals( 0, $all_count3->total_comments );
- $this->assertEquals( 0, $all_count3->all );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $all_count3->approved );
+ $this->assertSame( 0, $all_count3->moderated );
+ $this->assertSame( 0, $all_count3->spam );
+ $this->assertSame( 1, $all_count3->trash );
+ $this->assertSame( 0, $all_count3->{'post-trashed'} );
+ $this->assertSame( 0, $all_count3->total_comments );
+ $this->assertSame( 0, $all_count3->all );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_untrash_comment( $comment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $count4 = wp_count_comments( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $count4->approved );
- $this->assertEquals( 0, $count4->moderated );
- $this->assertEquals( 1, $count4->spam );
- $this->assertEquals( 0, $count4->trash );
- $this->assertEquals( 0, $count4->{'post-trashed'} );
- $this->assertEquals( 1, $count4->total_comments );
- $this->assertEquals( 0, $count4->all );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $count4->approved );
+ $this->assertSame( 0, $count4->moderated );
+ $this->assertSame( 1, $count4->spam );
+ $this->assertSame( 0, $count4->trash );
+ $this->assertSame( 0, $count4->{'post-trashed'} );
+ $this->assertSame( 1, $count4->total_comments );
+ $this->assertSame( 0, $count4->all );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $all_count4 = wp_count_comments();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $all_count4->approved );
- $this->assertEquals( 0, $all_count4->moderated );
- $this->assertEquals( 1, $all_count4->spam );
- $this->assertEquals( 0, $all_count4->trash );
- $this->assertEquals( 0, $all_count4->{'post-trashed'} );
- $this->assertEquals( 1, $all_count4->total_comments );
- $this->assertEquals( 0, $all_count4->all );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $all_count4->approved );
+ $this->assertSame( 0, $all_count4->moderated );
+ $this->assertSame( 1, $all_count4->spam );
+ $this->assertSame( 0, $all_count4->trash );
+ $this->assertSame( 0, $all_count4->{'post-trashed'} );
+ $this->assertSame( 1, $all_count4->total_comments );
+ $this->assertSame( 0, $all_count4->all );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestscommentsubmissionphp"></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/comment-submission.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment-submission.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/comment-submission.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -774,7 +774,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'preprocess_comment', array( $this, 'filter_preprocess_comment' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $comment );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'comment_post_ID' => self::$post->ID,
</span><span class="cx" style="display: block; padding: 0 10px"> 'comment_author' => $user->display_name,
</span></span></pre></div>
<a id="trunktestsphpunittestscommentphp"></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/comment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/comment.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,7 +52,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'comment_parent' => $comments[1],
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $comments[0] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $comments[1], $comment->comment_parent );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,7 +63,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'comment_parent' => $comments[1],
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = wp_update_comment(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,7 +90,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $comment_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'pingback', $comment->comment_type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'pingback', $comment->comment_type );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -109,7 +109,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'fire', get_comment_meta( $comment_id, 'sauce', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'fire', get_comment_meta( $comment_id, 'sauce', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -147,7 +147,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 1, $update );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $comment_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $updated_comment_text, $comment->comment_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $updated_comment_text, $comment->comment_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -162,7 +162,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'comment_post_ID' => self::$post_id,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( false, $update );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $update );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $update = wp_update_comment(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -170,7 +170,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'comment_post_ID' => -1,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( false, $update );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $update );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -290,8 +290,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $data['comment_date'], $comment->comment_date );
- $this->assertEquals( $data['comment_date_gmt'], $comment->comment_date_gmt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $data['comment_date'], $comment->comment_date );
+ $this->assertSame( $data['comment_date_gmt'], $comment->comment_date_gmt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -312,7 +312,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $data['comment_author_IP'], $comment->comment_author_IP );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $data['comment_author_IP'], $comment->comment_author_IP );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -333,7 +333,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $data['comment_author_IP'], $comment->comment_author_IP );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $data['comment_author_IP'], $comment->comment_author_IP );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -355,7 +355,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $data['comment_agent'], $comment->comment_agent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $data['comment_agent'], $comment->comment_agent );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -377,7 +377,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53 Opera/9.80 (X11; Linux i686; Ubuntu/14.10) Presto/2.12.388 Version/12.16 Mozilla/5.0 (Macintosh; U; PPC Mac OS ', $comment->comment_agent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53 Opera/9.80 (X11; Linux i686; Ubuntu/14.10) Presto/2.12.388 Version/12.16 Mozilla/5.0 (Macintosh; U; PPC Mac OS ', $comment->comment_agent );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -399,7 +399,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $data['comment_agent'], $comment->comment_agent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $data['comment_agent'], $comment->comment_agent );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -419,7 +419,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( strlen( $comment->comment_content ), 65535 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( strlen( $comment->comment_content ), 65535 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -568,7 +568,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'fire', get_comment_meta( $c, 'sauce', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'fire', get_comment_meta( $c, 'sauce', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestscompatphp"></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/compat.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/compat.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/compat.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider utf8_string_lengths
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_mb_strlen( $string, $expected_character_length ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_character_length, _mb_strlen( $string, 'UTF-8' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_character_length, _mb_strlen( $string, 'UTF-8' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,7 +44,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_mb_strlen_via_regex( $string, $expected_character_length ) {
</span><span class="cx" style="display: block; padding: 0 10px"> _wp_can_use_pcre_u( false );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_character_length, _mb_strlen( $string, 'UTF-8' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_character_length, _mb_strlen( $string, 'UTF-8' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> _wp_can_use_pcre_u( 'reset' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,7 +52,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider utf8_string_lengths
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_8bit_mb_strlen( $string, $expected_character_length, $expected_byte_length ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_byte_length, _mb_strlen( $string, '8bit' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_byte_length, _mb_strlen( $string, '8bit' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,7 +59,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider utf8_substrings
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_mb_substr( $string, $start, $length, $expected_character_substring ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_character_substring, _mb_substr( $string, $start, $length, 'UTF-8' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_character_substring, _mb_substr( $string, $start, $length, 'UTF-8' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,7 +67,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_mb_substr_via_regex( $string, $start, $length, $expected_character_substring ) {
</span><span class="cx" style="display: block; padding: 0 10px"> _wp_can_use_pcre_u( false );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_character_substring, _mb_substr( $string, $start, $length, 'UTF-8' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_character_substring, _mb_substr( $string, $start, $length, 'UTF-8' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> _wp_can_use_pcre_u( 'reset' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,7 +75,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider utf8_substrings
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_8bit_mb_substr( $string, $start, $length, $expected_character_substring, $expected_byte_substring ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_byte_substring, _mb_substr( $string, $start, $length, '8bit' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_byte_substring, _mb_substr( $string, $start, $length, '8bit' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_mb_substr_phpcore() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,12 +83,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $string_ascii = 'ABCDEF';
</span><span class="cx" style="display: block; padding: 0 10px"> $string_mb = base64_decode( '5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'DEF', _mb_substr( $string_ascii, 3 ) );
- $this->assertEquals( 'DEF', _mb_substr( $string_ascii, 3, 5, 'ISO-8859-1' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'DEF', _mb_substr( $string_ascii, 3 ) );
+ $this->assertSame( 'DEF', _mb_substr( $string_ascii, 3, 5, 'ISO-8859-1' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Specific latin-1 as that is the default the core PHP test operates under.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'peacrOiqng==', base64_encode( _mb_substr( $string_mb, 2, 7, 'latin-1' ) ) );
- $this->assertEquals( '6Kqe44OG44Kt44K544OI44Gn44GZ', base64_encode( _mb_substr( $string_mb, 2, 7, 'utf-8' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'peacrOiqng==', base64_encode( _mb_substr( $string_mb, 2, 7, 'latin-1' ) ) );
+ $this->assertSame( '6Kqe44OG44Kt44K544OI44Gn44GZ', base64_encode( _mb_substr( $string_mb, 2, 7, 'utf-8' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* https://github.com/php/php-src/blob/php-5.6.8/ext/mbstring/tests/mb_substr_variation1.phpt */
</span><span class="cx" style="display: block; padding: 0 10px"> $start = 0;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -158,7 +158,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $iterator = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $inputs as $input ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $outputs[ $iterator ], _mb_substr( $input, $start, $length ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $outputs[ $iterator ], _mb_substr( $input, $start, $length ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $iterator++;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -165,18 +165,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_hash_hmac_simple() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '140d1cb79fa12e2a31f32d35ad0a2723', _hash_hmac( 'md5', 'simple', 'key' ) );
- $this->assertEquals( '993003b95758e0ac2eba451a4c5877eb1bb7b92a', _hash_hmac( 'sha1', 'simple', 'key' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '140d1cb79fa12e2a31f32d35ad0a2723', _hash_hmac( 'md5', 'simple', 'key' ) );
+ $this->assertSame( '993003b95758e0ac2eba451a4c5877eb1bb7b92a', _hash_hmac( 'sha1', 'simple', 'key' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_hash_hmac_padding() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '3c1399103807cf12ec38228614416a8c', _hash_hmac( 'md5', 'simple', '65 character key 65 character key 65 character key 65 character k' ) );
- $this->assertEquals( '4428826d20003e309d6c2a6515891370daf184ea', _hash_hmac( 'sha1', 'simple', '65 character key 65 character key 65 character key 65 character k' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '3c1399103807cf12ec38228614416a8c', _hash_hmac( 'md5', 'simple', '65 character key 65 character key 65 character key 65 character k' ) );
+ $this->assertSame( '4428826d20003e309d6c2a6515891370daf184ea', _hash_hmac( 'sha1', 'simple', '65 character key 65 character key 65 character key 65 character k' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_hash_hmac_output() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 1 => '140d1cb79fa12e2a31f32d35ad0a2723' ), unpack( 'H32', _hash_hmac( 'md5', 'simple', 'key', true ) ) );
- $this->assertEquals( array( 1 => '993003b95758e0ac2eba451a4c5877eb1bb7b92a' ), unpack( 'H40', _hash_hmac( 'sha1', 'simple', 'key', true ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 1 => '140d1cb79fa12e2a31f32d35ad0a2723' ), unpack( 'H32', _hash_hmac( 'md5', 'simple', 'key', true ) ) );
+ $this->assertSame( array( 1 => '993003b95758e0ac2eba451a4c5877eb1bb7b92a' ), unpack( 'H40', _hash_hmac( 'sha1', 'simple', 'key', true ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,8 +186,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require_once ABSPATH . WPINC . '/class-json.php';
</span><span class="cx" style="display: block; padding: 0 10px"> $json = new Services_JSON();
</span><span class="cx" style="display: block; padding: 0 10px"> // Super basic test to verify Services_JSON is intact and working.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '["foo"]', $json->encodeUnsafe( array( 'foo' ) ) );
- $this->assertEquals( array( 'foo' ), $json->decode( '["foo"]' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '["foo"]', $json->encodeUnsafe( array( 'foo' ) ) );
+ $this->assertSame( array( 'foo' ), $json->decode( '["foo"]' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestscronphp"></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/cron.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/cron.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/cron.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,10 +43,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $scheduled = wp_schedule_single_event( $timestamp, $hook );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $scheduled );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $timestamp, wp_next_scheduled( $hook ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $timestamp, wp_next_scheduled( $hook ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // It's a non-recurring event.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', wp_get_schedule( $hook ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( wp_get_schedule( $hook ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,13 +59,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $scheduled = wp_schedule_single_event( $timestamp, $hook, $args );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $scheduled );
</span><span class="cx" style="display: block; padding: 0 10px"> // This returns the timestamp only if we provide matching args.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $timestamp, wp_next_scheduled( $hook, $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $timestamp, wp_next_scheduled( $hook, $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // These don't match so return nothing.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, wp_next_scheduled( $hook ) );
- $this->assertEquals( false, wp_next_scheduled( $hook, array( 'bar' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( wp_next_scheduled( $hook ) );
+ $this->assertFalse( wp_next_scheduled( $hook, array( 'bar' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // It's a non-recurring event.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', wp_get_schedule( $hook, $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( wp_get_schedule( $hook, $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_schedule_event() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,9 +77,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $scheduled = wp_schedule_event( $timestamp, $recur, $hook );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $scheduled );
</span><span class="cx" style="display: block; padding: 0 10px"> // It's scheduled for the right time.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $timestamp, wp_next_scheduled( $hook ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $timestamp, wp_next_scheduled( $hook ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // It's a recurring event.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $recur, wp_get_schedule( $hook ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $recur, wp_get_schedule( $hook ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_schedule_event_args() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,12 +92,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $scheduled = wp_schedule_event( $timestamp, 'hourly', $hook, $args );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $scheduled );
</span><span class="cx" style="display: block; padding: 0 10px"> // This returns the timestamp only if we provide matching args.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $timestamp, wp_next_scheduled( $hook, $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $timestamp, wp_next_scheduled( $hook, $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // These don't match so return nothing.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, wp_next_scheduled( $hook ) );
- $this->assertEquals( false, wp_next_scheduled( $hook, array( 'bar' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( wp_next_scheduled( $hook ) );
+ $this->assertFalse( wp_next_scheduled( $hook, array( 'bar' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $recur, wp_get_schedule( $hook, $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $recur, wp_get_schedule( $hook, $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -107,12 +107,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $timestamp = strtotime( '+1 hour' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_schedule_single_event( $timestamp, $hook );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $timestamp, wp_next_scheduled( $hook ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $timestamp, wp_next_scheduled( $hook ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Now unschedule it and make sure it's gone.
</span><span class="cx" style="display: block; padding: 0 10px"> $unscheduled = wp_unschedule_event( $timestamp, $hook );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $unscheduled );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, wp_next_scheduled( $hook ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( wp_next_scheduled( $hook ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_clear_schedule() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -275,7 +275,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wp_schedule_single_event( $ts2, $hook, $args ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The next event should be at +5 minutes, not +3.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $ts1, wp_next_scheduled( $hook, $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $ts1, wp_next_scheduled( $hook, $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -294,10 +294,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( wp_schedule_single_event( $ts2, $hook, $args ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The next event should be at +3 minutes, even though that one was scheduled second.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $ts2, wp_next_scheduled( $hook, $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $ts2, wp_next_scheduled( $hook, $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_unschedule_event( $ts2, $hook, $args );
</span><span class="cx" style="display: block; padding: 0 10px"> // Following event at +30 minutes should be there too.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $ts1, wp_next_scheduled( $hook, $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $ts1, wp_next_scheduled( $hook, $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_not_duplicate_event_reversed() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -313,10 +313,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( wp_schedule_single_event( $ts2, $hook, $args ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The next event should be at +3 minutes.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $ts1, wp_next_scheduled( $hook, $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $ts1, wp_next_scheduled( $hook, $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_unschedule_event( $ts1, $hook, $args );
</span><span class="cx" style="display: block; padding: 0 10px"> // Following event should be there too.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $ts2, wp_next_scheduled( $hook, $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $ts2, wp_next_scheduled( $hook, $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -470,7 +470,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $expected, $actual );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected->timestamp, $actual2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected->timestamp, $actual2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function filter_pre_scheduled_event_hooks() {
</span></span></pre></div>
<a id="trunktestsphpunittestscustomizecustomcsssettingphp"></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/customize/custom-css-setting.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/customize/custom-css-setting.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/customize/custom-css-setting.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -79,9 +79,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_construct() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( post_type_exists( 'custom_css' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'custom_css', $this->setting->type );
- $this->assertEquals( get_stylesheet(), $this->setting->stylesheet );
- $this->assertEquals( 'edit_css', $this->setting->capability );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'custom_css', $this->setting->type );
+ $this->assertSame( get_stylesheet(), $this->setting->stylesheet );
+ $this->assertSame( 'edit_css', $this->setting->capability );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $exception = null;
</span><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,7 +113,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_crud() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->setting->default = '/* Hello World */';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->setting->default, $this->setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->setting->default, $this->setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( wp_get_custom_css_post() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( wp_get_custom_css_post( $this->setting->stylesheet ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -143,14 +143,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_theme_mod( 'custom_css_post_id' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_id, wp_get_custom_css_post()->ID );
- $this->assertEquals( $post_id, wp_get_custom_css_post( $this->setting->stylesheet )->ID );
- $this->assertEquals( $twentyten_post_id, wp_get_custom_css_post( 'twentyten' )->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_id, wp_get_custom_css_post()->ID );
+ $this->assertSame( $post_id, wp_get_custom_css_post( $this->setting->stylesheet )->ID );
+ $this->assertSame( $twentyten_post_id, wp_get_custom_css_post( 'twentyten' )->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $original_css, wp_get_custom_css( $this->setting->stylesheet ) );
- $this->assertEquals( $original_css, $this->setting->value() );
- $this->assertEquals( $twentyten_css, wp_get_custom_css( 'twentyten' ) );
- $this->assertEquals( $twentyten_css, $twentyten_setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $original_css, wp_get_custom_css( $this->setting->stylesheet ) );
+ $this->assertSame( $original_css, $this->setting->value() );
+ $this->assertSame( $twentyten_css, wp_get_custom_css( 'twentyten' ) );
+ $this->assertSame( $twentyten_css, $twentyten_setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $updated_css = 'body { color: blue; }';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->wp_customize->set_post_value( $this->setting->id, $updated_css );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -157,15 +157,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $saved = $this->setting->save();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotFalse( $saved );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $updated_css, $this->setting->value() );
- $this->assertEquals( $updated_css, wp_get_custom_css( $this->setting->stylesheet ) );
- $this->assertEquals( $updated_css, get_post( $post_id )->post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $updated_css, $this->setting->value() );
+ $this->assertSame( $updated_css, wp_get_custom_css( $this->setting->stylesheet ) );
+ $this->assertSame( $updated_css, get_post( $post_id )->post_content );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $previewed_css = 'body { color: red; }';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->wp_customize->set_post_value( $this->setting->id, $previewed_css );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->setting->preview();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $previewed_css, $this->setting->value() );
- $this->assertEquals( $previewed_css, wp_get_custom_css( $this->setting->stylesheet ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $previewed_css, $this->setting->value() );
+ $this->assertSame( $previewed_css, wp_get_custom_css( $this->setting->stylesheet ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure that wp_update_custom_css_post() works as expected for updates.
</span><span class="cx" style="display: block; padding: 0 10px"> $r = wp_update_custom_css_post(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -176,13 +176,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $r );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_id, $r->ID );
- $this->assertEquals( 'body { color:red; }', get_post( $r )->post_content );
- $this->assertEquals( "body\n\tcolor:red;", get_post( $r )->post_content_filtered );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_id, $r->ID );
+ $this->assertSame( 'body { color:red; }', get_post( $r )->post_content );
+ $this->assertSame( "body\n\tcolor:red;", get_post( $r )->post_content_filtered );
</ins><span class="cx" style="display: block; padding: 0 10px"> $r = wp_update_custom_css_post( 'body { content: "\o/"; }' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->wp_customize->get_stylesheet(), get_post( $r )->post_name );
- $this->assertEquals( 'body { content: "\o/"; }', get_post( $r )->post_content );
- $this->assertEquals( '', get_post( $r )->post_content_filtered );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->wp_customize->get_stylesheet(), get_post( $r )->post_name );
+ $this->assertSame( 'body { content: "\o/"; }', get_post( $r )->post_content );
+ $this->assertSame( '', get_post( $r )->post_content_filtered );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure that wp_update_custom_css_post() works as expected for insertion.
</span><span class="cx" style="display: block; padding: 0 10px"> $r = wp_update_custom_css_post(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -192,18 +192,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $r );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'other', get_post( $r )->post_name );
- $this->assertEquals( 'body { background:black; }', get_post( $r )->post_content );
- $this->assertEquals( 'publish', get_post( $r )->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'other', get_post( $r )->post_name );
+ $this->assertSame( 'body { background:black; }', get_post( $r )->post_content );
+ $this->assertSame( 'publish', get_post( $r )->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test deletion.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( wp_get_custom_css_post() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( wp_get_custom_css_post( get_stylesheet() ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $previewed_css, wp_get_custom_css( get_stylesheet() ), 'Previewed value remains in spite of deleted post.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $previewed_css, wp_get_custom_css( get_stylesheet() ), 'Previewed value remains in spite of deleted post.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_delete_post( $twentyten_post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( wp_get_custom_css_post( 'twentyten' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', wp_get_custom_css( 'twentyten' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', wp_get_custom_css( 'twentyten' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -271,7 +271,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_value_filter() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'customize_value_custom_css', array( $this, 'filter_value' ), 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->setting->default = '/*default*/';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/*default*//*filtered*/', $this->setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/*default*//*filtered*/', $this->setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->factory()->post->create(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -283,11 +283,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_theme_mod( 'custom_css_post_id' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/*custom*//*filtered*/', $this->setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/*custom*//*filtered*/', $this->setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->wp_customize->set_post_value( $this->setting->id, '/*overridden*/' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->setting->preview();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/*overridden*/', $this->setting->value(), 'Expected value to not be filtered since post value is present.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/*overridden*/', $this->setting->value(), 'Expected value to not be filtered since post value is present.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -330,7 +330,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->setting->save();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $original_title, $post->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $original_title, $post->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $overridden_css, $post->post_content );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '/* filtered post_content */', $post->post_content );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '/* filtered post_content_filtered */', $post->post_content_filtered );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -346,11 +346,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function filter_update_custom_css_data( $data, $args ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'css', 'preprocessed' ), array_keys( $data ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $data['preprocessed'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $data['preprocessed'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $args );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'css', 'preprocessed', 'stylesheet' ), array_keys( $args ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $args['css'], $data['css'] );
- $this->assertEquals( $args['preprocessed'], $data['preprocessed'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $args['css'], $data['css'] );
+ $this->assertSame( $args['preprocessed'], $data['preprocessed'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data['css'] .= '/* filtered post_content */';
</span><span class="cx" style="display: block; padding: 0 10px"> $data['preprocessed'] = '/* filtered post_content_filtered */';
</span></span></pre></div>
<a id="trunktestsphpunittestscustomizemanagerphp"></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/customize/manager.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/customize/manager.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/customize/manager.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -119,9 +119,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'messenger_channel' => $messenger_channel,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $uuid, $wp_customize->changeset_uuid() );
- $this->assertEquals( $theme, $wp_customize->get_stylesheet() );
- $this->assertEquals( $messenger_channel, $wp_customize->get_messenger_channel() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $uuid, $wp_customize->changeset_uuid() );
+ $this->assertSame( $theme, $wp_customize->get_stylesheet() );
+ $this->assertSame( $messenger_channel, $wp_customize->get_messenger_channel() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $wp_customize->autosaved() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $wp_customize->branching() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,13 +137,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_REQUEST['theme'] = $theme;
</span><span class="cx" style="display: block; padding: 0 10px"> $_REQUEST['customize_messenger_channel'] = $messenger_channel;
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize = new WP_Customize_Manager( array( 'changeset_uuid' => $uuid ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $theme, $wp_customize->get_stylesheet() );
- $this->assertEquals( $messenger_channel, $wp_customize->get_messenger_channel() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $theme, $wp_customize->get_stylesheet() );
+ $this->assertSame( $messenger_channel, $wp_customize->get_messenger_channel() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $theme = 'twentyfourteen';
</span><span class="cx" style="display: block; padding: 0 10px"> $_REQUEST['customize_theme'] = $theme;
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize = new WP_Customize_Manager();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $theme, $wp_customize->get_stylesheet() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $theme, $wp_customize->get_stylesheet() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( wp_is_uuid( $wp_customize->changeset_uuid(), 4 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -198,8 +198,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'branching' => false, // To cause drafted changeset to be autoloaded.
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $uuid2, $wp_customize->changeset_uuid() );
- $this->assertEquals( $post_id, $wp_customize->changeset_post_id() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $uuid2, $wp_customize->changeset_uuid() );
+ $this->assertSame( $post_id, $wp_customize->changeset_post_id() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize = new WP_Customize_Manager(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -264,7 +264,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure that starter content import gets queued on a fresh site.
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'fresh_site', '1' );
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize->setup_theme();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 100, has_action( 'after_setup_theme', array( $wp_customize, 'import_theme_starter_content' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 100, has_action( 'after_setup_theme', array( $wp_customize, 'import_theme_starter_content' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -279,7 +279,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure fresh site flag is cleared when publishing a changeset.
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'fresh_site', '1' );
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'customize_save_after', $wp_customize );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0', get_option( 'fresh_site' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0', get_option( 'fresh_site' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Simulate a new, uncached request.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_delete( 'alloptions', 'options' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -333,10 +333,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_settings_previewed() {
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize = new WP_Customize_Manager( array( 'settings_previewed' => false ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( false, $wp_customize->settings_previewed() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $wp_customize->settings_previewed() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize = new WP_Customize_Manager();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( true, $wp_customize->settings_previewed() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertTrue( $wp_customize->settings_previewed() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -387,7 +387,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_changeset_uuid() {
</span><span class="cx" style="display: block; padding: 0 10px"> $uuid = wp_generate_uuid4();
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize = new WP_Customize_Manager( array( 'changeset_uuid' => $uuid ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $uuid, $wp_customize->changeset_uuid() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $uuid, $wp_customize->changeset_uuid() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -406,8 +406,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $title, get_option( 'blogname' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize->wp_loaded();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $wp_customize->is_preview() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $title, $wp_customize->get_setting( 'blogname' )->value() );
- $this->assertEquals( $title, get_option( 'blogname' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $title, $wp_customize->get_setting( 'blogname' )->value() );
+ $this->assertSame( $title, get_option( 'blogname' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -429,7 +429,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize = new WP_Customize_Manager();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $wp_customize->find_changeset_post_id( wp_generate_uuid4() ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_id, $wp_customize->find_changeset_post_id( $uuid ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_id, $wp_customize->find_changeset_post_id( $uuid ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify that the found post ID was cached under the given UUID, not the manager's UUID.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $post_id, $wp_customize->find_changeset_post_id( $wp_customize->changeset_uuid() ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -456,7 +456,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_content' => '{}',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_id, $wp_customize->changeset_post_id() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_id, $wp_customize->changeset_post_id() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -469,7 +469,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $uuid = wp_generate_uuid4();
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize = new WP_Customize_Manager( array( 'changeset_uuid' => $uuid ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $wp_customize->changeset_data() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $wp_customize->changeset_data() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $uuid = wp_generate_uuid4();
</span><span class="cx" style="display: block; padding: 0 10px"> $data = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -485,7 +485,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize = new WP_Customize_Manager( array( 'changeset_uuid' => $uuid ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $data, $wp_customize->changeset_data() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $data, $wp_customize->changeset_data() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Autosave.
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize->set_post_value( 'blogname', 'Hola Mundo' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -506,7 +506,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize->register_controls(); // That is, settings.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $wp_customize->autosaved() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $data, $wp_customize->changeset_data() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $data, $wp_customize->changeset_data() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // No change to data if not requesting autosave.
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize = new WP_Customize_Manager(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -517,7 +517,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $wp_customize->autosaved() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $data, $wp_customize->changeset_data() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array_merge(
</span><span class="cx" style="display: block; padding: 0 10px"> wp_list_pluck( $data, 'value' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'blogname' => 'Hola Mundo' )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -533,7 +533,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'autosaved' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $data, $wp_customize->changeset_data() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $data, $wp_customize->changeset_data() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -683,7 +683,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'title', $instance_data );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'text-2', 'meta-3' ), $changeset_values['sidebars_widgets[sidebar-1]'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'text-2', 'meta-3' ), $changeset_values['sidebars_widgets[sidebar-1]'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts_by_name = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 7, $changeset_values['nav_menus_created_posts'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -693,11 +693,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $changeset_values['nav_menus_created_posts'] as $post_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $post->ID === $existing_published_home_page_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'publish', $post->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'publish', $post->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( $post->ID === $existing_canola_attachment_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'inherit', $post->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'inherit', $post->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'auto-draft', $post->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'auto-draft', $post->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $post->post_name );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $post_name = $post->post_name;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -706,30 +706,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $posts_by_name[ $post_name ] = $post->ID;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'waffles', 'canola', 'home', 'about', 'blog', 'custom', 'unknown-cpt' ), array_keys( $posts_by_name ) );
- $this->assertEquals( 'Custom', get_post( $posts_by_name['custom'] )->post_title );
- $this->assertEquals( 'sample-page-template.php', get_page_template_slug( $posts_by_name['about'] ) );
- $this->assertEquals( '', get_page_template_slug( $posts_by_name['blog'] ) );
- $this->assertEquals( $posts_by_name['waffles'], get_post_thumbnail_id( $posts_by_name['custom'] ) );
- $this->assertEquals( 0, get_post_thumbnail_id( $posts_by_name['blog'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'waffles', 'canola', 'home', 'about', 'blog', 'custom', 'unknown-cpt' ), array_keys( $posts_by_name ) );
+ $this->assertSame( 'Custom', get_post( $posts_by_name['custom'] )->post_title );
+ $this->assertSame( 'sample-page-template.php', get_page_template_slug( $posts_by_name['about'] ) );
+ $this->assertSame( '', get_page_template_slug( $posts_by_name['blog'] ) );
+ $this->assertSame( $posts_by_name['waffles'], get_post_thumbnail_id( $posts_by_name['custom'] ) );
+ $this->assertSame( 0, get_post_thumbnail_id( $posts_by_name['blog'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $attachment_metadata = wp_get_attachment_metadata( $posts_by_name['waffles'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Waffles', get_post( $posts_by_name['waffles'] )->post_title );
- $this->assertEquals( 'waffles', get_post_meta( $posts_by_name['waffles'], '_customize_draft_post_name', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Waffles', get_post( $posts_by_name['waffles'] )->post_title );
+ $this->assertSame( 'waffles', get_post_meta( $posts_by_name['waffles'], '_customize_draft_post_name', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'file', $attachment_metadata );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'waffles', $attachment_metadata['file'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'page', $changeset_values['show_on_front'] );
- $this->assertEquals( $posts_by_name['home'], $changeset_values['page_on_front'] );
- $this->assertEquals( $posts_by_name['blog'], $changeset_values['page_for_posts'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'page', $changeset_values['show_on_front'] );
+ $this->assertSame( $posts_by_name['home'], $changeset_values['page_on_front'] );
+ $this->assertSame( $posts_by_name['blog'], $changeset_values['page_for_posts'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( -1, $changeset_values['nav_menu_locations[top]'] );
- $this->assertEquals( 0, $changeset_values['nav_menu_item[-1]']['object_id'] );
- $this->assertEquals( 'custom', $changeset_values['nav_menu_item[-1]']['type'] );
- $this->assertEquals( home_url( '/' ), $changeset_values['nav_menu_item[-1]']['url'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( -1, $changeset_values['nav_menu_locations[top]'] );
+ $this->assertSame( 0, $changeset_values['nav_menu_item[-1]']['object_id'] );
+ $this->assertSame( 'custom', $changeset_values['nav_menu_item[-1]']['type'] );
+ $this->assertSame( home_url( '/' ), $changeset_values['nav_menu_item[-1]']['url'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $wp_customize->changeset_data() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $wp_customize->changeset_post_id() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1000, has_action( 'customize_register', array( $wp_customize, '_save_starter_content_changeset' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1000, has_action( 'customize_register', array( $wp_customize, '_save_starter_content_changeset' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'customize_register', $wp_customize ); // This will trigger the changeset save.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'int', $wp_customize->changeset_post_id() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $wp_customize->changeset_data() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -771,7 +771,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $changeset_data = $wp_customize->changeset_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $previous_blogname, $changeset_data['blogname']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $previous_blogname, $changeset_data['blogname']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'starter_content', $changeset_data['blogname'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $previous_blogdescription, $changeset_data['blogdescription']['value'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'starter_content', $changeset_data['blogdescription'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -783,14 +783,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( get_theme_mod( 'custom_logo' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( get_theme_mod( 'header_image' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( get_theme_mod( 'background_image' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'auto-draft', get_post( $posts_by_name['about'] )->post_status );
- $this->assertEquals( 'auto-draft', get_post( $posts_by_name['waffles'] )->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'auto-draft', get_post( $posts_by_name['about'] )->post_status );
+ $this->assertSame( 'auto-draft', get_post( $posts_by_name['waffles'] )->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $changeset_data['blogname']['value'], get_option( 'blogname' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $r = $wp_customize->save_changeset_post( array( 'status' => 'publish' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $r );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'publish', get_post( $posts_by_name['about'] )->post_status );
- $this->assertEquals( 'inherit', get_post( $posts_by_name['waffles'] )->post_status );
- $this->assertEquals( $changeset_data['blogname']['value'], get_option( 'blogname' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'publish', get_post( $posts_by_name['about'] )->post_status );
+ $this->assertSame( 'inherit', get_post( $posts_by_name['waffles'] )->post_status );
+ $this->assertSame( $changeset_data['blogname']['value'], get_option( 'blogname' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( get_theme_mod( 'custom_logo' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( get_theme_mod( 'header_image' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( get_theme_mod( 'background_image' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -800,7 +800,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'canola', get_custom_logo() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'waffles', get_header_image() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'waffles', get_background_image() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'waffles', get_post( $posts_by_name['waffles'] )->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'waffles', get_post( $posts_by_name['waffles'] )->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( get_post_meta( $posts_by_name['waffles'], '_customize_draft_post_name', true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -891,15 +891,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $did_action_customize_preview_init = did_action( 'customize_preview_init' );
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize = new WP_Customize_Manager();
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize->customize_preview_init();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $did_action_customize_preview_init + 1, did_action( 'customize_preview_init' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $did_action_customize_preview_init + 1, did_action( 'customize_preview_init' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_action( 'wp_head', 'wp_no_robots' ) );
- $this->assertEquals( 10, has_action( 'wp_head', array( $wp_customize, 'remove_frameless_preview_messenger_channel' ) ) );
- $this->assertEquals( 10, has_filter( 'wp_headers', array( $wp_customize, 'filter_iframe_security_headers' ) ) );
- $this->assertEquals( 10, has_filter( 'wp_redirect', array( $wp_customize, 'add_state_query_params' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_action( 'wp_head', 'wp_no_robots' ) );
+ $this->assertSame( 10, has_action( 'wp_head', array( $wp_customize, 'remove_frameless_preview_messenger_channel' ) ) );
+ $this->assertSame( 10, has_filter( 'wp_headers', array( $wp_customize, 'filter_iframe_security_headers' ) ) );
+ $this->assertSame( 10, has_filter( 'wp_redirect', array( $wp_customize, 'add_state_query_params' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( wp_script_is( 'customize-preview', 'enqueued' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_action( 'wp_head', array( $wp_customize, 'customize_preview_loading_style' ) ) );
- $this->assertEquals( 20, has_action( 'wp_footer', array( $wp_customize, 'customize_preview_settings' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_action( 'wp_head', array( $wp_customize, 'customize_preview_loading_style' ) ) );
+ $this->assertSame( 20, has_action( 'wp_footer', array( $wp_customize, 'customize_preview_settings' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test unauthorized user outside preview (no messenger_channel).
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$subscriber_user_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -934,8 +934,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $wp_customize->filter_iframe_security_headers( array() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'X-Frame-Options', $headers );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'Content-Security-Policy', $headers );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'SAMEORIGIN', $headers['X-Frame-Options'] );
- $this->assertEquals( "frame-ancestors 'self'", $headers['Content-Security-Policy'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'SAMEORIGIN', $headers['X-Frame-Options'] );
+ $this->assertSame( "frame-ancestors 'self'", $headers['Content-Security-Policy'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -961,8 +961,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'customize_messenger_channel', $query_params );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'customize_changeset_uuid', $query_params );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'customize_theme', $query_params );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $uuid, $query_params['customize_changeset_uuid'] );
- $this->assertEquals( $messenger_channel, $query_params['customize_messenger_channel'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $uuid, $query_params['customize_changeset_uuid'] );
+ $this->assertSame( $messenger_channel, $query_params['customize_messenger_channel'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $uuid = wp_generate_uuid4();
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize = new WP_Customize_Manager(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -978,8 +978,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'customize_messenger_channel', $query_params );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'customize_changeset_uuid', $query_params );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'customize_theme', $query_params );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $uuid, $query_params['customize_changeset_uuid'] );
- $this->assertEquals( $preview_theme, $query_params['customize_theme'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $uuid, $query_params['customize_changeset_uuid'] );
+ $this->assertSame( $preview_theme, $query_params['customize_theme'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $uuid = wp_generate_uuid4();
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize = new WP_Customize_Manager(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1043,23 +1043,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $r );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $did_action['customize_save_validation_before'] + 1, did_action( 'customize_save_validation_before' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $did_action['customize_save_validation_before'] + 1, did_action( 'customize_save_validation_before' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = $manager->find_changeset_post_id( $uuid );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotNull( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $saved_data = json_decode( get_post( $post_id )->post_content, true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $manager->unsanitized_post_values(), wp_list_pluck( $saved_data, 'value' ) );
- $this->assertEquals( $pre_saved_data['blogname']['value'], $saved_data['blogname']['value'] );
- $this->assertEquals( $pre_saved_data['blogdescription']['custom'], $saved_data['blogdescription']['custom'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $manager->unsanitized_post_values(), wp_list_pluck( $saved_data, 'value' ) );
+ $this->assertSame( $pre_saved_data['blogname']['value'], $saved_data['blogname']['value'] );
+ $this->assertSame( $pre_saved_data['blogdescription']['custom'], $saved_data['blogdescription']['custom'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $saved_data as $setting_id => $setting_params ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'type', $setting_params );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'option', $setting_params['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'option', $setting_params['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'user_id', $setting_params );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$admin_user_id, $setting_params['user_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$admin_user_id, $setting_params['user_id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Auto Draft', get_post( $post_id )->post_title );
- $this->assertEquals( 'auto-draft', get_post( $post_id )->post_status );
- $this->assertEquals( $date, get_post( $post_id )->post_date_gmt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Auto Draft', get_post( $post_id )->post_title );
+ $this->assertSame( 'auto-draft', get_post( $post_id )->post_status );
+ $this->assertSame( $date, get_post( $post_id )->post_date_gmt );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( 'Changeset Title', get_option( 'blogname' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'setting_validities', $r );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1097,7 +1097,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $r );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'transaction_fail', $r->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'transaction_fail', $r->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $r->get_error_data() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'setting_validities', $r->get_error_data() );
</span><span class="cx" style="display: block; padding: 0 10px"> $error_data = $r->get_error_data();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1105,16 +1105,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $error_data['setting_validities']['blogname'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'foo_unauthorized', $error_data['setting_validities'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $error_data['setting_validities']['foo_unauthorized'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'unauthorized', $error_data['setting_validities']['foo_unauthorized']->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'unauthorized', $error_data['setting_validities']['foo_unauthorized']->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'bar_unknown', $error_data['setting_validities'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $error_data['setting_validities']['bar_unknown'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'unrecognized', $error_data['setting_validities']['bar_unknown']->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'unrecognized', $error_data['setting_validities']['bar_unknown']->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'baz_illegal', $error_data['setting_validities'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $error_data['setting_validities']['baz_illegal'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'illegal', $error_data['setting_validities']['baz_illegal']->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'illegal', $error_data['setting_validities']['baz_illegal']->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Since transactional, ensure no changes have been made.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $previous_saved_data, json_decode( get_post( $post_id )->post_content, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $previous_saved_data, json_decode( get_post( $post_id )->post_content, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Attempt a non-transactional/incremental update.
</span><span class="cx" style="display: block; padding: 0 10px"> $manager = new WP_Customize_Manager(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1143,7 +1143,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $r['setting_validities']['bar_unknown'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $saved_data = json_decode( get_post( $post_id )->post_content, true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $previous_saved_data, $saved_data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Non-Transactional \o/ <script>unsanitized</script>', $saved_data['blogname']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Non-Transactional \o/ <script>unsanitized</script>', $saved_data['blogname']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure the filter applies.
</span><span class="cx" style="display: block; padding: 0 10px"> $customize_changeset_save_data_call_count = $this->customize_changeset_save_data_call_count;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1158,7 +1158,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $customize_changeset_save_data_call_count + 1, $this->customize_changeset_save_data_call_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $customize_changeset_save_data_call_count + 1, $this->customize_changeset_save_data_call_count );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Publish the changeset: actions will be doubled since also trashed.
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_actions = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1205,17 +1205,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $r );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Do it live \o/', get_option( 'blogname' ) );
- $this->assertEquals( 'trash', get_post_status( $post_id ) ); // Auto-trashed.
- $this->assertEquals( $original_capabilities, wp_list_pluck( $manager->settings(), 'capability' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Do it live \o/', get_option( 'blogname' ) );
+ $this->assertSame( 'trash', get_post_status( $post_id ) ); // Auto-trashed.
+ $this->assertSame( $original_capabilities, wp_list_pluck( $manager->settings(), 'capability' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '<script>', get_post( $post_id )->post_content );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $manager->changeset_uuid(), get_post( $post_id )->post_name, 'Expected that the "__trashed" suffix to not be added.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $manager->changeset_uuid(), get_post( $post_id )->post_name, 'Expected that the "__trashed" suffix to not be added.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_user_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'publish', get_post_meta( $post_id, '_wp_trash_meta_status', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'publish', get_post_meta( $post_id, '_wp_trash_meta_status', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_numeric( get_post_meta( $post_id, '_wp_trash_meta_time', true ) ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( array_keys( $expected_actions ) as $action_name ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_actions[ $action_name ] + $action_counts[ $action_name ], did_action( $action_name ), "Action: $action_name" );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_actions[ $action_name ] + $action_counts[ $action_name ], did_action( $action_name ), "Action: $action_name" );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test revisions.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1293,8 +1293,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $autosave_revision = wp_get_post_autosave( $wp_customize->changeset_post_id(), get_current_user_id() );
</span><span class="cx" style="display: block; padding: 0 10px"> $saved_data = json_decode( $autosave_revision->post_content, true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $options['custom_html_1'], $saved_data['custom_html_1']['value'] );
- $this->assertEquals( $options['custom_html_2'], $saved_data['custom_html_2']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $options['custom_html_1'], $saved_data['custom_html_1']['value'] );
+ $this->assertSame( $options['custom_html_2'], $saved_data['custom_html_2']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update post to discard autosave.
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize->save_changeset_post(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1309,8 +1309,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize = $this->get_manager_for_testing_json_corruption_protection( $uuid );
</span><span class="cx" style="display: block; padding: 0 10px"> $saved_data = json_decode( get_post( $wp_customize->changeset_post_id() )->post_content, true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $options['custom_html_1'], $saved_data['custom_html_1']['value'] );
- $this->assertEquals( $options['custom_html_2'], $saved_data['custom_html_2']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $options['custom_html_1'], $saved_data['custom_html_1']['value'] );
+ $this->assertSame( $options['custom_html_2'], $saved_data['custom_html_2']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="cx" style="display: block; padding: 0 10px"> * Ensure that the unsanitized value (the "POST data") is preserved in the revisions' content.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1319,8 +1319,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $revisions = wp_get_post_revisions( $wp_customize->changeset_post_id() );
</span><span class="cx" style="display: block; padding: 0 10px"> $revision = array_shift( $revisions );
</span><span class="cx" style="display: block; padding: 0 10px"> $saved_data = json_decode( $revision->post_content, true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $options['custom_html_1'], $saved_data['custom_html_1']['value'] );
- $this->assertEquals( $options['custom_html_2'], $saved_data['custom_html_2']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $options['custom_html_1'], $saved_data['custom_html_1']['value'] );
+ $this->assertSame( $options['custom_html_2'], $saved_data['custom_html_2']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="cx" style="display: block; padding: 0 10px"> * Now when publishing the changeset, the unsanitized values will be read from the changeset
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1476,9 +1476,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_values = $manager->unsanitized_post_values();
</span><span class="cx" style="display: block; padding: 0 10px"> $manager->save_changeset_post( array( 'status' => 'publish' ) ); // Activate.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '#123456', $post_values['background_color'] );
- $this->assertEquals( $preview_theme, get_stylesheet() );
- $this->assertEquals( 'Hello Preview Theme', get_option( 'blogname' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '#123456', $post_values['background_color'] );
+ $this->assertSame( $preview_theme, get_stylesheet() );
+ $this->assertSame( 'Hello Preview Theme', get_option( 'blogname' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1513,15 +1513,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $r );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array_fill_keys( array( 'blogname', 'scratchpad', 'background_color' ), true ),
</span><span class="cx" style="display: block; padding: 0 10px"> $r['setting_validities']
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = $wp_customize->find_changeset_post_id( $uuid );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = json_decode( get_post( $post_id )->post_content, true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$admin_user_id, $data['blogname']['user_id'] );
- $this->assertEquals( self::$admin_user_id, $data['scratchpad']['user_id'] );
- $this->assertEquals( self::$admin_user_id, $data[ $this->manager->get_stylesheet() . '::background_color' ]['user_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$admin_user_id, $data['blogname']['user_id'] );
+ $this->assertSame( self::$admin_user_id, $data['scratchpad']['user_id'] );
+ $this->assertSame( self::$admin_user_id, $data[ $this->manager->get_stylesheet() . '::background_color' ]['user_id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Attempt to save just one setting under a different user.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $other_admin_user_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1540,17 +1540,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $r );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array_fill_keys( array( 'blogname', 'background_color' ), true ),
</span><span class="cx" style="display: block; padding: 0 10px"> $r['setting_validities']
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = json_decode( get_post( $post_id )->post_content, true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Admin 2 Title', $data['blogname']['value'] );
- $this->assertEquals( $other_admin_user_id, $data['blogname']['user_id'] );
- $this->assertEquals( 'Admin 1 Scratch', $data['scratchpad']['value'] );
- $this->assertEquals( self::$admin_user_id, $data['scratchpad']['user_id'] );
- $this->assertEquals( '#FFFFFF', $data[ $this->manager->get_stylesheet() . '::background_color' ]['value'] );
- $this->assertEquals( $other_admin_user_id, $data[ $this->manager->get_stylesheet() . '::background_color' ]['user_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Admin 2 Title', $data['blogname']['value'] );
+ $this->assertSame( $other_admin_user_id, $data['blogname']['user_id'] );
+ $this->assertSame( 'Admin 1 Scratch', $data['scratchpad']['value'] );
+ $this->assertSame( self::$admin_user_id, $data['scratchpad']['user_id'] );
+ $this->assertSame( '#FFFFFF', $data[ $this->manager->get_stylesheet() . '::background_color' ]['value'] );
+ $this->assertSame( $other_admin_user_id, $data[ $this->manager->get_stylesheet() . '::background_color' ]['user_id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Attempt to save now as under-privileged user.
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize = $this->create_test_manager( $uuid );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1569,14 +1569,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $r );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
- array_fill_keys( array( 'scratchpad', 'blogname' ), true ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
+ array_fill_keys( array( 'blogname', 'scratchpad' ), true ),
</ins><span class="cx" style="display: block; padding: 0 10px"> $r['setting_validities']
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = json_decode( get_post( $post_id )->post_content, true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $other_admin_user_id, $data['blogname']['user_id'], 'Expected setting to be untouched.' );
- $this->assertEquals( self::$subscriber_user_id, $data['scratchpad']['user_id'] );
- $this->assertEquals( $other_admin_user_id, $data[ $this->manager->get_stylesheet() . '::background_color' ]['user_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $other_admin_user_id, $data['blogname']['user_id'], 'Expected setting to be untouched.' );
+ $this->assertSame( self::$subscriber_user_id, $data['scratchpad']['user_id'] );
+ $this->assertSame( $other_admin_user_id, $data[ $this->manager->get_stylesheet() . '::background_color' ]['user_id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Manually update the changeset so that the user_id context is not included.
</span><span class="cx" style="display: block; padding: 0 10px"> $data = json_decode( get_post( $post_id )->post_content, true );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1609,14 +1609,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( array_keys( $data ) as $setting_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $setting_id = preg_replace( '/^.+::/', '', $setting_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $save_counts[ $setting_id ] + 1, did_action( sprintf( 'customize_save_%s', $setting_id ) ), $setting_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $save_counts[ $setting_id ] + 1, did_action( sprintf( 'customize_save_%s', $setting_id ) ), $setting_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'blogname', 'blogdescription', 'background_color', 'scratchpad' ), array_keys( $this->filtered_setting_current_user_ids ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $other_admin_user_id, $this->filtered_setting_current_user_ids['blogname'] );
- $this->assertEquals( 0, $this->filtered_setting_current_user_ids['blogdescription'] );
- $this->assertEquals( self::$subscriber_user_id, $this->filtered_setting_current_user_ids['scratchpad'] );
- $this->assertEquals( $other_admin_user_id, $this->filtered_setting_current_user_ids['background_color'] );
- $this->assertEquals( 'Subscriber Scratch', get_option( 'scratchpad' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $other_admin_user_id, $this->filtered_setting_current_user_ids['blogname'] );
+ $this->assertSame( 0, $this->filtered_setting_current_user_ids['blogdescription'] );
+ $this->assertSame( self::$subscriber_user_id, $this->filtered_setting_current_user_ids['scratchpad'] );
+ $this->assertSame( $other_admin_user_id, $this->filtered_setting_current_user_ids['background_color'] );
+ $this->assertSame( 'Subscriber Scratch', get_option( 'scratchpad' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1746,10 +1746,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $r['setting_validities']['unknownsetting'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'unrecognized', $r['setting_validities']['unknownsetting']->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'unrecognized', $r['setting_validities']['unknownsetting']->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $r['setting_validities']['blogterminated'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'unauthorized', $r['setting_validities']['blogterminated']->get_error_code() );
- $this->assertEquals( $data, get_post( $wp_customize->changeset_post_id() )->post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'unauthorized', $r['setting_validities']['blogterminated']->get_error_code() );
+ $this->assertSame( $data, get_post( $wp_customize->changeset_post_id() )->post_content );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test submitting data with changed and unchanged settings, creating a new instance so that the post_values are cleared.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $other_admin_user_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1776,14 +1776,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Note that blogfounded is not included among setting_validities because no value was supplied and it is not unrecognized/unauthorized.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array_fill_keys( array( 'blogname', 'blogdescription', 'scratchpad' ), true ), $r['setting_validities'], 'Expected blogname even though unchanged.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array_fill_keys( array( 'blogname', 'blogdescription', 'scratchpad' ), true ), $r['setting_validities'], 'Expected blogname even though unchanged.' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = json_decode( get_post( $wp_customize->changeset_post_id() )->post_content, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$admin_user_id, $data['blogname']['user_id'], 'Expected unchanged user_id since value was unchanged.' );
- $this->assertEquals( $other_admin_user_id, $data['blogdescription']['user_id'] );
- $this->assertEquals( $other_admin_user_id, $data['blogfounded']['user_id'] );
- $this->assertEquals( $other_admin_user_id, $data['scratchpad']['user_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$admin_user_id, $data['blogname']['user_id'], 'Expected unchanged user_id since value was unchanged.' );
+ $this->assertSame( $other_admin_user_id, $data['blogdescription']['user_id'] );
+ $this->assertSame( $other_admin_user_id, $data['blogfounded']['user_id'] );
+ $this->assertSame( $other_admin_user_id, $data['scratchpad']['user_id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1855,7 +1855,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $r );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'illegal_autosave_with_date_gmt', $r->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'illegal_autosave_with_date_gmt', $r->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fail: illegal_autosave_with_status.
</span><span class="cx" style="display: block; padding: 0 10px"> $r = $wp_customize->save_changeset_post(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1864,7 +1864,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'status' => 'pending',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'illegal_autosave_with_status', $r->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'illegal_autosave_with_status', $r->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fail: illegal_autosave_with_non_current_user.
</span><span class="cx" style="display: block; padding: 0 10px"> $r = $wp_customize->save_changeset_post(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1873,7 +1873,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'user_id' => $this->factory()->user->create( array( 'role' => 'administrator' ) ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'illegal_autosave_with_non_current_user', $r->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'illegal_autosave_with_non_current_user', $r->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Try autosave.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wp_get_post_autosave( $changeset_post_id, get_current_user_id() ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1960,7 +1960,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize = new WP_Customize_Manager( array( 'changeset_uuid' => $wp_customize->changeset_uuid() ) );
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'customize_register', $wp_customize );
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize->save_changeset_post( array( 'status' => 'publish' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Unfiltered<script>evil</script>', get_option( 'scratchpad' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Unfiltered<script>evil</script>', get_option( 'scratchpad' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Attempt scratchpad with user who doesn't have unfiltered_html.
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'scratchpad', '' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1976,7 +1976,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize = new WP_Customize_Manager( array( 'changeset_uuid' => $wp_customize->changeset_uuid() ) );
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'customize_register', $wp_customize );
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize->save_changeset_post( array( 'status' => 'publish' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Unfilteredevil', get_option( 'scratchpad' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Unfilteredevil', get_option( 'scratchpad' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Attempt publishing scratchpad as anonymous user when changeset was set by privileged user.
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'scratchpad', '' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1993,9 +1993,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize = null;
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $GLOBALS['wp_actions']['customize_register'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Unfilteredevil', apply_filters( 'content_save_pre', 'Unfiltered<script>evil</script>' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Unfilteredevil', apply_filters( 'content_save_pre', 'Unfiltered<script>evil</script>' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_publish_post( $changeset_post_id ); // @todo If wp_update_post() is used here, then kses will corrupt the post_content.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Unfiltered<script>evil</script>', get_option( 'scratchpad' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Unfiltered<script>evil</script>', get_option( 'scratchpad' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2047,7 +2047,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure that the value has actually been written to the DB.
</span><span class="cx" style="display: block; padding: 0 10px"> $updated_sidebars_widgets = get_option( 'sidebars_widgets' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_sidebar_1, $updated_sidebars_widgets['sidebar-1'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_sidebar_1, $updated_sidebars_widgets['sidebar-1'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2099,7 +2099,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $r = $manager->save_changeset_post( $args );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $r );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'json_parse_error', $r->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'json_parse_error', $r->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_post(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2109,7 +2109,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $r = $manager->save_changeset_post( $args );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $r );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'expected_array', $r->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'expected_array', $r->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2217,7 +2217,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( is_ssl() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $wp_customize->is_cross_domain() );
</span><span class="cx" style="display: block; padding: 0 10px"> $allowed = $wp_customize->get_allowed_urls();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $allowed, array( home_url( '/', 'http' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $allowed, array( home_url( '/', 'http' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'customize_allowed_urls', array( $this, 'filter_customize_allowed_urls' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $allowed = $wp_customize->get_allowed_urls();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2276,12 +2276,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['customized'] = wp_slash( wp_json_encode( $customized ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $post_values = $manager->unsanitized_post_values();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $customized, $post_values );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $customized, $post_values );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $manager->unsanitized_post_values( array( 'exclude_post_data' => true ) ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $manager->set_post_value( 'foo', 'BAR' );
</span><span class="cx" style="display: block; padding: 0 10px"> $post_values = $manager->unsanitized_post_values();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'BAR', $post_values['foo'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'BAR', $post_values['foo'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $manager->unsanitized_post_values( array( 'exclude_post_data' => true ) ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If user is unprivileged, the post data is ignored.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2345,7 +2345,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'background_color', $manager->unsanitized_post_values() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'blogname' => 'Changeset Title',
</span><span class="cx" style="display: block; padding: 0 10px"> 'blogdescription' => 'Post Input Tagline',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2352,7 +2352,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $manager->unsanitized_post_values()
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'blogdescription' => 'Post Input Tagline',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2360,7 +2360,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $manager->set_post_value( 'blogdescription', 'Post Override Tagline' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'blogname' => 'Changeset Title',
</span><span class="cx" style="display: block; padding: 0 10px"> 'blogdescription' => 'Post Override Tagline',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2368,7 +2368,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $manager->unsanitized_post_values()
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'blogname' => 'Changeset Title',
</span><span class="cx" style="display: block; padding: 0 10px"> 'blogdescription' => 'Changeset Tagline',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2401,7 +2401,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $values );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'background_color', $values );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '#000000', $values['background_color'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '#000000', $values['background_color'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $values = $manager->unsanitized_post_values(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2430,12 +2430,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $manager->add_setting( 'foo', array( 'default' => 'foo_default' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $foo_setting = $manager->get_setting( 'foo' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo_default', $manager->get_setting( 'foo' )->value(), 'Expected non-previewed setting to return default when value() method called.' );
- $this->assertEquals( $posted_settings['foo'], $manager->post_value( $foo_setting, 'post_value_foo_default' ), 'Expected post_value($foo_setting) to return value supplied in $_POST[customized][foo]' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo_default', $manager->get_setting( 'foo' )->value(), 'Expected non-previewed setting to return default when value() method called.' );
+ $this->assertSame( $posted_settings['foo'], $manager->post_value( $foo_setting, 'post_value_foo_default' ), 'Expected post_value($foo_setting) to return value supplied in $_POST[customized][foo]' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $manager->add_setting( 'bar', array( 'default' => 'bar_default' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $bar_setting = $manager->get_setting( 'bar' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'post_value_bar_default', $manager->post_value( $bar_setting, 'post_value_bar_default' ), 'Expected post_value($bar_setting, $default) to return $default since no value supplied in $_POST[customized][bar]' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'post_value_bar_default', $manager->post_value( $bar_setting, 'post_value_bar_default' ), 'Expected post_value($bar_setting, $default) to return $default since no value supplied in $_POST[customized][bar]' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2453,26 +2453,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'sanitize_callback' => array( $this, 'filter_customize_sanitize_foo' ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $default_value, $this->manager->post_value( $setting, $default_value ) );
- $this->assertEquals( $default_value, $setting->post_value( $default_value ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $default_value, $this->manager->post_value( $setting, $default_value ) );
+ $this->assertSame( $default_value, $setting->post_value( $default_value ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_value = 'bar';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_post_value( 'foo', $post_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( strtoupper( $post_value ), $this->manager->post_value( $setting, $default_value ) );
- $this->assertEquals( strtoupper( $post_value ), $setting->post_value( $default_value ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( strtoupper( $post_value ), $this->manager->post_value( $setting, $default_value ) );
+ $this->assertSame( strtoupper( $post_value ), $setting->post_value( $default_value ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_post_value( 'foo', 'return_wp_error_in_sanitize' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $default_value, $this->manager->post_value( $setting, $default_value ) );
- $this->assertEquals( $default_value, $setting->post_value( $default_value ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $default_value, $this->manager->post_value( $setting, $default_value ) );
+ $this->assertSame( $default_value, $setting->post_value( $default_value ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_post_value( 'foo', 'return_null_in_sanitize' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $default_value, $this->manager->post_value( $setting, $default_value ) );
- $this->assertEquals( $default_value, $setting->post_value( $default_value ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $default_value, $this->manager->post_value( $setting, $default_value ) );
+ $this->assertSame( $default_value, $setting->post_value( $default_value ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_value = '<script>evil</script>';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_post_value( 'foo', $post_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $default_value, $this->manager->post_value( $setting, $default_value ) );
- $this->assertEquals( $default_value, $setting->post_value( $default_value ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $default_value, $this->manager->post_value( $setting, $default_value ) );
+ $this->assertSame( $default_value, $setting->post_value( $default_value ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2522,8 +2522,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'sanitize_callback' => array( $this, 'filter_customize_sanitize_numeric' ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $default_value, $this->manager->post_value( $setting, $default_value ) );
- $this->assertEquals( $default_value, $setting->post_value( $default_value ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $default_value, $this->manager->post_value( $setting, $default_value ) );
+ $this->assertSame( $default_value, $setting->post_value( $default_value ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_value = '42';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_post_value( 'numeric', $post_value );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2574,7 +2574,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_post_value( 'foo', $post_value );
</span><span class="cx" style="display: block; padding: 0 10px"> $validities = $this->manager->validate_setting_values( $this->manager->unsanitized_post_values() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $validities );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'foo' => true ), $validities );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'foo' => true ), $validities );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_post_value( 'foo', 'return_wp_error_in_sanitize' );
</span><span class="cx" style="display: block; padding: 0 10px"> $invalid_settings = $this->manager->validate_setting_values( $this->manager->unsanitized_post_values() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2582,8 +2582,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $setting->id, $invalid_settings );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $invalid_settings[ $setting->id ] );
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $invalid_settings[ $setting->id ];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_value_in_sanitize', $error->get_error_code() );
- $this->assertEquals( array( 'source' => 'filter_customize_sanitize_foo' ), $error->get_error_data() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_value_in_sanitize', $error->get_error_code() );
+ $this->assertSame( array( 'source' => 'filter_customize_sanitize_foo' ), $error->get_error_data() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_post_value( 'foo', 'return_null_in_sanitize' );
</span><span class="cx" style="display: block; padding: 0 10px"> $invalid_settings = $this->manager->validate_setting_values( $this->manager->unsanitized_post_values() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2599,8 +2599,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $setting->id, $invalid_settings );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $invalid_settings[ $setting->id ] );
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $invalid_settings[ $setting->id ];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_value_in_validate', $error->get_error_code() );
- $this->assertEquals( array( 'source' => 'filter_customize_validate_foo' ), $error->get_error_data() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_value_in_validate', $error->get_error_code() );
+ $this->assertSame( array( 'source' => 'filter_customize_validate_foo' ), $error->get_error_data() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2626,7 +2626,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $setting_validities = $this->manager->validate_setting_values( array( $setting->id => 'bad' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $validity = $setting_validities[ $setting->id ];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $validity );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'minlength', $validity->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'minlength', $validity->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2650,7 +2650,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'unknown', $validities );
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $validities['unknown'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'unrecognized', $error->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'unrecognized', $error->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->get_setting( 'blogname' )->capability = 'do_not_allow';
</span><span class="cx" style="display: block; padding: 0 10px"> $validities = $this->manager->validate_setting_values( array( 'blogname' => 'X' ), array( 'validate_capability' => false ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2660,7 +2660,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'blogname', $validities );
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $validities['blogname'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'unauthorized', $error->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'unauthorized', $error->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2699,7 +2699,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_post_value( 'numeric', $post_value );
</span><span class="cx" style="display: block; padding: 0 10px"> $validities = $this->manager->validate_setting_values( $this->manager->unsanitized_post_values() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $validities );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'numeric' => true ), $validities );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'numeric' => true ), $validities );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2718,12 +2718,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $error->errors as $code => $messages ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $code, $validity );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $validity[ $code ] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( join( ' ', $messages ), $validity[ $code ]['message'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( join( ' ', $messages ), $validity[ $code ]['message'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'data', $validity[ $code ] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $validity[ $code ]['data'], $error->get_error_data( $code ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $validity[ $code ]['data'], $error->get_error_data( $code ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'number', $validity['bad_number']['data'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 123, $validity['bad_number']['data']['number'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 123, $validity['bad_number']['data']['number'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2746,16 +2746,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'customize_post_value_set_foo', array( $this, 'capture_customize_post_value_set_actions' ), 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_post_value( $setting->id, '123abc' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $this->captured_customize_post_value_set_actions );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'customize_post_value_set_foo', $this->captured_customize_post_value_set_actions[0]['action'] );
- $this->assertEquals( 'customize_post_value_set', $this->captured_customize_post_value_set_actions[1]['action'] );
- $this->assertEquals( array( '123abc', $this->manager ), $this->captured_customize_post_value_set_actions[0]['args'] );
- $this->assertEquals( array( $setting->id, '123abc', $this->manager ), $this->captured_customize_post_value_set_actions[1]['args'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'customize_post_value_set_foo', $this->captured_customize_post_value_set_actions[0]['action'] );
+ $this->assertSame( 'customize_post_value_set', $this->captured_customize_post_value_set_actions[1]['action'] );
+ $this->assertSame( array( '123abc', $this->manager ), $this->captured_customize_post_value_set_actions[0]['args'] );
+ $this->assertSame( array( $setting->id, '123abc', $this->manager ), $this->captured_customize_post_value_set_actions[1]['args'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $unsanitized = $this->manager->unsanitized_post_values();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $setting->id, $unsanitized );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '123abc', $unsanitized[ $setting->id ] );
- $this->assertEquals( 123, $setting->post_value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '123abc', $unsanitized[ $setting->id ] );
+ $this->assertSame( 123, $setting->post_value() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2806,8 +2806,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->action_customize_register_for_dynamic_settings();
</span><span class="cx" style="display: block; padding: 0 10px"> $manager->add_dynamic_settings( $setting_ids );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $manager->get_setting( 'bar' ), 'Expected bar setting to be created since filters were added.' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo_default', $manager->get_setting( 'foo' )->default, 'Expected static foo setting to not get overridden by dynamic setting.' );
- $this->assertEquals( 'dynamic_bar_default', $manager->get_setting( 'bar' )->default, 'Expected dynamic setting bar to have default providd by filter.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo_default', $manager->get_setting( 'foo' )->default, 'Expected static foo setting to not get overridden by dynamic setting.' );
+ $this->assertSame( 'dynamic_bar_default', $manager->get_setting( 'bar' )->default, 'Expected dynamic setting bar to have default providd by filter.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2925,7 +2925,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function filter_customize_dynamic_setting_class_for_test_dynamic_settings( $setting_class, $setting_id, $setting_args ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'WP_Customize_Setting', $setting_class );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'WP_Customize_Setting', $setting_class );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $setting_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $setting_args );
</span><span class="cx" style="display: block; padding: 0 10px"> return $setting_class;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2948,12 +2948,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Manager::set_preview_url()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_preview_url() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( home_url( '/' ), $this->manager->get_preview_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( home_url( '/' ), $this->manager->get_preview_url() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $preview_url = home_url( '/foo/bar/baz/' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_preview_url( $preview_url );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $preview_url, $this->manager->get_preview_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $preview_url, $this->manager->get_preview_url() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_preview_url( 'http://illegalsite.example.com/food/' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( home_url( '/' ), $this->manager->get_preview_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( home_url( '/' ), $this->manager->get_preview_url() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2964,34 +2964,34 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_return_url() {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::factory()->user->create( array( 'role' => 'author' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( home_url( '/' ), $this->manager->get_return_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( home_url( '/' ), $this->manager->get_return_url() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( current_user_can( 'edit_theme_options' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( home_url( '/' ), $this->manager->get_return_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( home_url( '/' ), $this->manager->get_return_url() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $preview_url = home_url( '/foo/' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_preview_url( $preview_url );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $preview_url, $this->manager->get_return_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $preview_url, $this->manager->get_return_url() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTP_REFERER'] = wp_slash( admin_url( 'customize.php' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $preview_url, $this->manager->get_return_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $preview_url, $this->manager->get_return_url() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // See #35355.
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTP_REFERER'] = wp_slash( admin_url( 'wp-login.php' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $preview_url, $this->manager->get_return_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $preview_url, $this->manager->get_return_url() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $url = home_url( '/referred/' );
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTP_REFERER'] = wp_slash( $url );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $url, $this->manager->get_return_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $url, $this->manager->get_return_url() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $url = 'http://badreferer.example.com/';
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTP_REFERER'] = wp_slash( $url );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $url, $this->manager->get_return_url() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $preview_url, $this->manager->get_return_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $preview_url, $this->manager->get_return_url() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_return_url( admin_url( 'edit.php?trashed=1' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( admin_url( 'edit.php' ), $this->manager->get_return_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( admin_url( 'edit.php' ), $this->manager->get_return_url() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2999,7 +2999,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_return_url_with_deactivated_theme() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_return_url( admin_url( 'themes.php?page=mytheme_documentation' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( admin_url( 'themes.php' ), $this->manager->get_return_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( admin_url( 'themes.php' ), $this->manager->get_return_url() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3016,15 +3016,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $autofocus = array( 'control' => 'blogname' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_autofocus( $autofocus );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $autofocus, $this->manager->get_autofocus() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $autofocus, $this->manager->get_autofocus() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $autofocus = array( 'section' => 'colors' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_autofocus( $autofocus );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $autofocus, $this->manager->get_autofocus() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $autofocus, $this->manager->get_autofocus() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $autofocus = array( 'panel' => 'widgets' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_autofocus( $autofocus );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $autofocus, $this->manager->get_autofocus() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $autofocus, $this->manager->get_autofocus() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $autofocus = array( 'control' => array( 'blogname', 'blogdescription' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_autofocus( $autofocus );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3045,7 +3045,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'customize_refresh_nonces', array( $this, 'filter_customize_refresh_nonces' ), 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $nonces = $this->manager->get_nonces();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'foo', $nonces );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_create_nonce( 'foo' ), $nonces['foo'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_create_nonce( 'foo' ), $nonces['foo'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3090,7 +3090,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'theme', 'url', 'browser', 'panels', 'sections', 'nonce', 'autofocus', 'documentTitleTmpl', 'previewableDevices', 'changeset', 'timeouts', 'dateFormat', 'timeFormat', 'initialClientTimestamp', 'initialServerDate', 'initialServerTimestamp', 'l10n' ), array_keys( $data ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $autofocus, $data['autofocus'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $autofocus, $data['autofocus'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'save', $data['nonce'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'preview', $data['nonce'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3148,7 +3148,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->customize_preview_settings();
</span><span class="cx" style="display: block; padding: 0 10px"> $content = ob_get_clean();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, preg_match( '/var _wpCustomizeSettings = ({.+});/', $content, $matches ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, preg_match( '/var _wpCustomizeSettings = ({.+});/', $content, $matches ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $settings = json_decode( $matches[1], true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'theme', $settings );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3265,7 +3265,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $manager->prepare_controls();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $sorted_control_ids = wp_list_pluck( $manager->get_section( $section_id )->controls, 'id' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $added_control_ids, $sorted_control_ids );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $added_control_ids, $sorted_control_ids );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3285,7 +3285,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Customize_Section', $result_section );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $section_id, $result_section->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $section_id, $result_section->id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $section = new WP_Customize_Section(
</span><span class="cx" style="display: block; padding: 0 10px"> $manager,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3298,8 +3298,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result_section = $manager->add_section( $section );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Customize_Section', $result_section );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $section_id, $result_section->id );
- $this->assertEquals( $section, $result_section );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $section_id, $result_section->id );
+ $this->assertSame( $section, $result_section );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3313,14 +3313,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result_setting = $manager->add_setting( $setting_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Customize_Setting', $result_setting );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $setting_id, $result_setting->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $setting_id, $result_setting->id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Setting( $manager, $setting_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result_setting = $manager->add_setting( $setting );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Customize_Setting', $result_setting );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $setting, $result_setting );
- $this->assertEquals( $setting_id, $result_setting->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $setting, $result_setting );
+ $this->assertSame( $setting_id, $result_setting->id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3331,7 +3331,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $setting_id = 'dynamic';
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = $manager->add_setting( $setting_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'WP_Customize_Setting', get_class( $setting ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'WP_Customize_Setting', get_class( $setting ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertObjectNotHasAttribute( 'custom', $setting );
</span><span class="cx" style="display: block; padding: 0 10px"> $manager->remove_setting( $setting_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3338,9 +3338,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'customize_dynamic_setting_class', array( $this, 'return_dynamic_customize_setting_class' ), 10, 3 );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'customize_dynamic_setting_args', array( $this, 'return_dynamic_customize_setting_args' ), 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = $manager->add_setting( $setting_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Test_Dynamic_Customize_Setting', get_class( $setting ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Test_Dynamic_Customize_Setting', get_class( $setting ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertObjectHasAttribute( 'custom', $setting );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo', $setting->custom );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo', $setting->custom );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3390,7 +3390,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Customize_Panel', $result_panel );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $panel_id, $result_panel->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $panel_id, $result_panel->id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $panel = new WP_Customize_Panel(
</span><span class="cx" style="display: block; padding: 0 10px"> $manager,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3402,8 +3402,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result_panel = $manager->add_panel( $panel );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Customize_Panel', $result_panel );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $panel, $result_panel );
- $this->assertEquals( $panel_id, $result_panel->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $panel, $result_panel );
+ $this->assertSame( $panel_id, $result_panel->id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3433,7 +3433,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Customize_Control', $result_control );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $control_id, $result_control->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $control_id, $result_control->id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $control = new WP_Customize_Control(
</span><span class="cx" style="display: block; padding: 0 10px"> $manager,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3447,8 +3447,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result_control = $manager->add_control( $control );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Customize_Control', $result_control );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $control, $result_control );
- $this->assertEquals( $control_id, $result_control->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $control, $result_control );
+ $this->assertSame( $control_id, $result_control->id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3544,7 +3544,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->prepare_controls();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->manager->controls();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $controls_sorted, array_keys( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $controls_sorted, array_keys( $result ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3573,7 +3573,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->prepare_controls();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->manager->sections();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $sections_sorted, array_keys( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $sections_sorted, array_keys( $result ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3602,7 +3602,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->prepare_controls();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->manager->panels();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $panels_sorted, array_keys( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $panels_sorted, array_keys( $result ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3626,7 +3626,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $whitespaces as $whitespace ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $sanitized = $setting->sanitize( $whitespace . $video_url . $whitespace );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $video_url, $sanitized );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $video_url, $sanitized );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestscustomizenavmenuitemsettingphp"></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/customize/nav-menu-item-setting.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/customize/nav-menu-item-setting.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/customize/nav-menu-item-setting.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,8 +68,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'customize_register', $this->wp_customize );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Nav_Menu_Item_Setting( $this->wp_customize, 'nav_menu_item[123]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'nav_menu_item', $setting->type );
- $this->assertEquals( 123, $setting->post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'nav_menu_item', $setting->type );
+ $this->assertSame( 123, $setting->post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $setting->previous_post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $setting->update_status );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $setting->update_error );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -93,7 +93,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'nav_menu_term_id' => 0,
</span><span class="cx" style="display: block; padding: 0 10px"> '_invalid' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $default, $setting->default );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $default, $setting->default );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $exception = null;
</span><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -136,9 +136,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'menu_item_parent' => 123,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Nav_Menu_Item_Setting( $this->wp_customize, 'nav_menu_item[-5]', compact( 'default' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( -5, $setting->post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( -5, $setting->post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $setting->previous_post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $default, $setting->default );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $default, $setting->default );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -167,17 +167,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $item_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $menu_item = wp_setup_nav_menu_item( $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $item_title, $menu_item->title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $item_title, $menu_item->title );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $setting_id = "nav_menu_item[$item_id]";
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Nav_Menu_Item_Setting( $this->wp_customize, $setting_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $value = $setting->value();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $menu_item->title, $value['title'] );
- $this->assertEquals( $menu_item->type, $value['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $menu_item->title, $value['title'] );
+ $this->assertSame( $menu_item->type, $value['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $menu_item->object_id, $value['object_id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $menu_id, $value['nav_menu_term_id'] );
- $this->assertEquals( 'Hello World', $value['original_title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $menu_id, $value['nav_menu_term_id'] );
+ $this->assertSame( 'Hello World', $value['original_title'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $other_menu_id = wp_create_nav_menu( 'Menu2' );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_nav_menu_item(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -188,8 +188,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $value = $setting->value();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Hola', $value['title'] );
- $this->assertEquals( $other_menu_id, $value['nav_menu_term_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Hola', $value['title'] );
+ $this->assertSame( $other_menu_id, $value['nav_menu_term_id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -220,8 +220,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Nav_Menu_Item_Setting( $this->wp_customize, $setting_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $value = $setting->value();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $value['title'] );
- $this->assertEquals( $original_title, $value['original_title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $value['title'] );
+ $this->assertSame( $original_title, $value['original_title'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -250,17 +250,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $item_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $menu_item = wp_setup_nav_menu_item( $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $item_title, $menu_item->title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $item_title, $menu_item->title );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $setting_id = "nav_menu_item[$item_id]";
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Nav_Menu_Item_Setting( $this->wp_customize, $setting_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $value = $setting->value();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $menu_item->title, $value['title'] );
- $this->assertEquals( $menu_item->type, $value['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $menu_item->title, $value['title'] );
+ $this->assertSame( $menu_item->type, $value['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $menu_item->object_id, $value['object_id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $menu_id, $value['nav_menu_term_id'] );
- $this->assertEquals( 'Salutations', $value['original_title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $menu_id, $value['nav_menu_term_id'] );
+ $this->assertSame( 'Salutations', $value['original_title'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -291,8 +291,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Nav_Menu_Item_Setting( $this->wp_customize, $setting_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $value = $setting->value();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $menu_item->type_label, 'Custom Label' );
- $this->assertEquals( $menu_item->type_label, $value['type_label'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $menu_item->type_label, 'Custom Label' );
+ $this->assertSame( $menu_item->type_label, $value['type_label'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -316,7 +316,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->wp_customize->set_post_value( $menu->id, $post_value );
</span><span class="cx" style="display: block; padding: 0 10px"> $menu->preview();
</span><span class="cx" style="display: block; padding: 0 10px"> $value = $menu->value();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_value, $value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_value, $value );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_title' => 'Hello World' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $item_id = wp_update_nav_menu_item(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -337,7 +337,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $setting_id = "nav_menu_item[$item_id]";
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Nav_Menu_Item_Setting( $this->wp_customize, $setting_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $value = $setting->value();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $value['nav_menu_term_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $value['nav_menu_term_id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -391,7 +391,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_value['post_status'] = $post_value['status'];
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $post_value['status'] );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $post_value as $key => $value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, $updated_item->$key, "Key $key mismatch" );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, $updated_item->$key, "Key $key mismatch" );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -444,13 +444,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( count( $current_items ), count( $preview_items ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $last_item = array_pop( $preview_items );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_item_id, $last_item->db_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_item_id, $last_item->db_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_value['post_status'] = $post_value['status'];
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $post_value['status'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $post_value['menu_order'] = $post_value['position'];
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $post_value['position'] );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $post_value as $key => $value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, $last_item->$key, "Mismatch for $key property." );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, $last_item->$key, "Mismatch for $key property." );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -532,7 +532,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $valid_urls as $valid_url ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $url_setting = $setting->sanitize( array( 'url' => $valid_url ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $url_setting );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $valid_url, $url_setting['url'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $valid_url, $url_setting['url'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $invalid_urls = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -543,7 +543,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $invalid_urls as $invalid_url ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $url_setting = $setting->sanitize( array( 'url' => $invalid_url ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $url_setting );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_url', $url_setting->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_url', $url_setting->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $unsanitized = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -587,7 +587,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array_keys( $unsanitized ), array_keys( $sanitized ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $expected_sanitized as $key => $value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, $sanitized[ $key ], "Expected $key to be sanitized." );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, $sanitized[ $key ], "Expected $key to be sanitized." );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_item_id = wp_update_nav_menu_item(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -616,18 +616,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_item = wp_setup_nav_menu_item( clone $post );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $expected_sanitized['object_id'], $nav_menu_item->object_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_sanitized['object'], $nav_menu_item->object );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_sanitized['object'], $nav_menu_item->object );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $expected_sanitized['menu_item_parent'], $nav_menu_item->menu_item_parent );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_sanitized['position'], $post->menu_order );
- $this->assertEquals( $expected_sanitized['type'], $nav_menu_item->type );
- $this->assertEquals( $expected_sanitized['title'], $post->post_title );
- $this->assertEquals( $expected_sanitized['url'], $nav_menu_item->url );
- $this->assertEquals( $expected_sanitized['description'], $post->post_content );
- $this->assertEquals( $expected_sanitized['attr_title'], $post->post_excerpt );
- $this->assertEquals( $expected_sanitized['target'], $nav_menu_item->target );
- $this->assertEquals( $expected_sanitized['classes'], implode( ' ', $nav_menu_item->classes ) );
- $this->assertEquals( $expected_sanitized['xfn'], $nav_menu_item->xfn );
- $this->assertEquals( $expected_sanitized['status'], $post->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_sanitized['position'], $post->menu_order );
+ $this->assertSame( $expected_sanitized['type'], $nav_menu_item->type );
+ $this->assertSame( $expected_sanitized['title'], $post->post_title );
+ $this->assertSame( $expected_sanitized['url'], $nav_menu_item->url );
+ $this->assertSame( $expected_sanitized['description'], $post->post_content );
+ $this->assertSame( $expected_sanitized['attr_title'], $post->post_excerpt );
+ $this->assertSame( $expected_sanitized['target'], $nav_menu_item->target );
+ $this->assertSame( $expected_sanitized['classes'], implode( ' ', $nav_menu_item->classes ) );
+ $this->assertSame( $expected_sanitized['xfn'], $nav_menu_item->xfn );
+ $this->assertSame( $expected_sanitized['status'], $post->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -693,10 +693,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'error', $update_result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'status', $update_result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $item_id, $update_result['post_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $item_id, $update_result['post_id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $update_result['previous_post_id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $update_result['error'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'updated', $update_result['status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'updated', $update_result['status'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -748,7 +748,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( count( $current_items ), count( $preview_items ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $last_item = array_pop( $preview_items );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $setting->post_id, $last_item->db_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $setting->post_id, $last_item->db_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_value['post_status'] = $post_value['status'];
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $post_value['status'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $post_value['menu_order'] = $post_value['position'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -766,10 +766,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'error', $update_result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'status', $update_result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $setting->post_id, $update_result['post_id'] );
- $this->assertEquals( $new_item_id, $update_result['previous_post_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $setting->post_id, $update_result['post_id'] );
+ $this->assertSame( $new_item_id, $update_result['previous_post_id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $update_result['error'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'inserted', $update_result['status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'inserted', $update_result['status'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -820,10 +820,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'error', $update_result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'status', $update_result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $delete_item_id, $update_result['post_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $delete_item_id, $update_result['post_id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $update_result['previous_post_id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $update_result['error'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'deleted', $update_result['status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'deleted', $update_result['status'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -918,26 +918,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $item_value = $setting->value();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'type_label', $item_value );
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_item = $setting->value_as_wp_post_nav_menu_item();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Custom Link', $nav_menu_item->type_label );
- $this->assertEquals( $item_value['type_label'], $nav_menu_item->type_label );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Custom Link', $nav_menu_item->type_label );
+ $this->assertSame( $item_value['type_label'], $nav_menu_item->type_label );
</ins><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'wp_setup_nav_menu_item', array( $this, 'filter_type_label' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_item = $setting->value_as_wp_post_nav_menu_item();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Custom Label', $nav_menu_item->type_label );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Custom Label', $nav_menu_item->type_label );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertObjectNotHasAttribute( 'nav_menu_term_id', $nav_menu_item );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertObjectNotHasAttribute( 'status', $nav_menu_item );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'publish', $nav_menu_item->post_status );
- $this->assertEquals( 'nav_menu_item', $nav_menu_item->post_type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'publish', $nav_menu_item->post_status );
+ $this->assertSame( 'nav_menu_item', $nav_menu_item->post_type );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertObjectNotHasAttribute( 'position', $nav_menu_item );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_value['position'], $nav_menu_item->menu_order );
- $this->assertEquals( $post_value['title'], $nav_menu_item->post_title );
- $this->assertEquals( 123, $nav_menu_item->ID );
- $this->assertEquals( 123, $nav_menu_item->db_id );
- $this->assertEquals( wp_get_current_user()->ID, $nav_menu_item->post_author );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_value['position'], $nav_menu_item->menu_order );
+ $this->assertSame( $post_value['title'], $nav_menu_item->post_title );
+ $this->assertSame( 123, $nav_menu_item->ID );
+ $this->assertSame( 123, $nav_menu_item->db_id );
+ $this->assertSame( wp_get_current_user()->ID, $nav_menu_item->post_author );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertObjectHasAttribute( 'type_label', $nav_menu_item );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = apply_filters( 'nav_menu_attr_title', wp_unslash( apply_filters( 'excerpt_save_pre', wp_slash( $post_value['attr_title'] ) ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $nav_menu_item->attr_title );
- $this->assertEquals( 'Attempted \o/ o’o markup', $nav_menu_item->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $nav_menu_item->attr_title );
+ $this->assertSame( 'Attempted \o/ o’o markup', $nav_menu_item->description );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -973,7 +973,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting->preview();
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_item = $setting->value_as_wp_post_nav_menu_item();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_term_link( $term_id ), $nav_menu_item->url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_term_link( $term_id ), $nav_menu_item->url );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Post.
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Nav_Menu_Item_Setting(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -992,7 +992,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting->preview();
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_item = $setting->value_as_wp_post_nav_menu_item();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_permalink( $post_id ), $nav_menu_item->url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_permalink( $post_id ), $nav_menu_item->url );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Post type archive.
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Nav_Menu_Item_Setting(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1010,7 +1010,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting->preview();
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_item = $setting->value_as_wp_post_nav_menu_item();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_post_type_archive_link( 'press_release' ), $nav_menu_item->url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_post_type_archive_link( 'press_release' ), $nav_menu_item->url );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1064,15 +1064,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'nav_menu_item[' . $nav_menu_item_id . ']'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $item_value = $setting->value();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $original_post_title, $item_value['original_title'] );
- $this->assertEquals( '', $item_value['title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $original_post_title, $item_value['original_title'] );
+ $this->assertSame( '', $item_value['title'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $item = $setting->value_as_wp_post_nav_menu_item();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertObjectHasAttribute( 'type_label', $item );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $original_post_title, $item->original_title );
- $this->assertEquals( $original_post_title, $item->title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $original_post_title, $item->original_title );
+ $this->assertSame( $original_post_title, $item->title );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'type_label', $item_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_post_type_object( 'press_release' )->labels->singular_name, $item_value['type_label'] );
- $this->assertEquals( $item->type_label, $item_value['type_label'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_post_type_object( 'press_release' )->labels->singular_name, $item_value['type_label'] );
+ $this->assertSame( $item->type_label, $item_value['type_label'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Post: staged nav menu item.
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Nav_Menu_Item_Setting(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1091,15 +1091,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting->preview();
</span><span class="cx" style="display: block; padding: 0 10px"> $item_value = $setting->value();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $original_post_title, $item_value['original_title'] );
- $this->assertEquals( '', $item_value['title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $original_post_title, $item_value['original_title'] );
+ $this->assertSame( '', $item_value['title'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $item = $setting->value_as_wp_post_nav_menu_item();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertObjectHasAttribute( 'type_label', $item );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $original_post_title, $item->original_title );
- $this->assertEquals( $original_post_title, $item->title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $original_post_title, $item->original_title );
+ $this->assertSame( $original_post_title, $item->title );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'type_label', $item_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_post_type_object( 'press_release' )->labels->singular_name, $item_value['type_label'] );
- $this->assertEquals( $item->type_label, $item_value['type_label'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_post_type_object( 'press_release' )->labels->singular_name, $item_value['type_label'] );
+ $this->assertSame( $item->type_label, $item_value['type_label'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Term: existing nav menu item.
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_item_id = wp_update_nav_menu_item(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1118,15 +1118,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'nav_menu_item[' . $nav_menu_item_id . ']'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $item_value = $setting->value();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $original_term_title, $item_value['original_title'] );
- $this->assertEquals( '', $item_value['title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $original_term_title, $item_value['original_title'] );
+ $this->assertSame( '', $item_value['title'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $item = $setting->value_as_wp_post_nav_menu_item();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertObjectHasAttribute( 'type_label', $item );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $original_term_title, $item->original_title );
- $this->assertEquals( $original_term_title, $item->title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $original_term_title, $item->original_title );
+ $this->assertSame( $original_term_title, $item->title );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'type_label', $item_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_taxonomy( 'category' )->labels->singular_name, $item_value['type_label'] );
- $this->assertEquals( $item->type_label, $item_value['type_label'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_taxonomy( 'category' )->labels->singular_name, $item_value['type_label'] );
+ $this->assertSame( $item->type_label, $item_value['type_label'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Term: staged nav menu item.
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Nav_Menu_Item_Setting(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1145,15 +1145,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting->preview();
</span><span class="cx" style="display: block; padding: 0 10px"> $item_value = $setting->value();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $original_term_title, $item_value['original_title'] );
- $this->assertEquals( '', $item_value['title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $original_term_title, $item_value['original_title'] );
+ $this->assertSame( '', $item_value['title'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $item = $setting->value_as_wp_post_nav_menu_item();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertObjectHasAttribute( 'type_label', $item );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $original_term_title, $item->original_title );
- $this->assertEquals( $original_term_title, $item->title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $original_term_title, $item->original_title );
+ $this->assertSame( $original_term_title, $item->title );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'type_label', $item_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_taxonomy( 'category' )->labels->singular_name, $item_value['type_label'] );
- $this->assertEquals( $item->type_label, $item_value['type_label'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_taxonomy( 'category' )->labels->singular_name, $item_value['type_label'] );
+ $this->assertSame( $item->type_label, $item_value['type_label'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Post Type Archive: existing nav menu item.
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_item_id = wp_update_nav_menu_item(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1171,15 +1171,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'nav_menu_item[' . $nav_menu_item_id . ']'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $item_value = $setting->value();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_post_type_object( 'press_release' )->labels->archives, $item_value['original_title'] );
- $this->assertEquals( '', $item_value['title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_post_type_object( 'press_release' )->labels->archives, $item_value['original_title'] );
+ $this->assertSame( '', $item_value['title'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $item = $setting->value_as_wp_post_nav_menu_item();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertObjectHasAttribute( 'type_label', $item );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_post_type_object( 'press_release' )->labels->archives, $item->original_title );
- $this->assertEquals( get_post_type_object( 'press_release' )->labels->archives, $item->title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_post_type_object( 'press_release' )->labels->archives, $item->original_title );
+ $this->assertSame( get_post_type_object( 'press_release' )->labels->archives, $item->title );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'type_label', $item_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( __( 'Post Type Archive' ), $item_value['type_label'] );
- $this->assertEquals( $item->type_label, $item_value['type_label'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( __( 'Post Type Archive' ), $item_value['type_label'] );
+ $this->assertSame( $item->type_label, $item_value['type_label'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Post Type Archive: staged nav menu item.
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Nav_Menu_Item_Setting(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1197,15 +1197,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting->preview();
</span><span class="cx" style="display: block; padding: 0 10px"> $item_value = $setting->value();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_post_type_object( 'press_release' )->labels->archives, $item_value['original_title'] );
- $this->assertEquals( '', $item_value['title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_post_type_object( 'press_release' )->labels->archives, $item_value['original_title'] );
+ $this->assertSame( '', $item_value['title'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $item = $setting->value_as_wp_post_nav_menu_item();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertObjectHasAttribute( 'type_label', $item );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_post_type_object( 'press_release' )->labels->archives, $item->original_title );
- $this->assertEquals( get_post_type_object( 'press_release' )->labels->archives, $item->title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_post_type_object( 'press_release' )->labels->archives, $item->original_title );
+ $this->assertSame( get_post_type_object( 'press_release' )->labels->archives, $item->title );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'type_label', $item_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( __( 'Post Type Archive' ), $item_value['type_label'] );
- $this->assertEquals( $item->type_label, $item_value['type_label'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( __( 'Post Type Archive' ), $item_value['type_label'] );
+ $this->assertSame( $item->type_label, $item_value['type_label'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1238,6 +1238,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $setting->preview();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_item = $setting->value_as_wp_post_nav_menu_item();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $original_title, $nav_menu_item->title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $original_title, $nav_menu_item->title );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestscustomizenavmenusettingphp"></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/customize/nav-menu-setting.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/customize/nav-menu-setting.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/customize/nav-menu-setting.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,9 +64,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'customize_register', $this->wp_customize );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Nav_Menu_Setting( $this->wp_customize, 'nav_menu[123]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'nav_menu', $setting->type );
- $this->assertEquals( 'postMessage', $setting->transport );
- $this->assertEquals( 123, $setting->term_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'nav_menu', $setting->type );
+ $this->assertSame( 'postMessage', $setting->transport );
+ $this->assertSame( 123, $setting->term_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $setting->previous_term_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $setting->update_status );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $setting->update_error );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,9 +74,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( array( 'name', 'description', 'parent' ) as $key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $key, $setting->default );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $setting->default['name'] );
- $this->assertEquals( '', $setting->default['description'] );
- $this->assertEquals( 0, $setting->default['parent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $setting->default['name'] );
+ $this->assertSame( '', $setting->default['description'] );
+ $this->assertSame( 0, $setting->default['parent'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $exception = null;
</span><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -119,8 +119,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'parent' => 123,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Nav_Menu_Setting( $this->wp_customize, 'nav_menu[-5]', compact( 'default' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( -5, $setting->term_id );
- $this->assertEquals( $default, $setting->default );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( -5, $setting->term_id );
+ $this->assertSame( $default, $setting->default );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -153,14 +153,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( array( 'name', 'description', 'parent' ) as $key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $key, $value );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $menu_name, $value['name'] );
- $this->assertEquals( $description, $value['description'] );
- $this->assertEquals( $parent_menu_id, $value['parent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $menu_name, $value['name'] );
+ $this->assertSame( $description, $value['description'] );
+ $this->assertSame( $parent_menu_id, $value['parent'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_menu_name = 'Foo';
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_nav_menu_object( $menu_id, wp_slash( array( 'menu-name' => $new_menu_name ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $updated_value = $setting->value();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_menu_name, $updated_value['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_menu_name, $updated_value['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -196,9 +196,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->wp_customize->set_post_value( $setting_id, $post_value );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $value = $setting->value();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Name 1 \\o/', $value['name'] );
- $this->assertEquals( 'Description 1 \\o/', $value['description'] );
- $this->assertEquals( 0, $value['parent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Name 1 \\o/', $value['name'] );
+ $this->assertSame( 'Description 1 \\o/', $value['description'] );
+ $this->assertSame( 0, $value['parent'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $term = (array) wp_get_nav_menu_object( $menu_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -209,15 +209,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $setting->preview();
</span><span class="cx" style="display: block; padding: 0 10px"> $value = $setting->value();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Name 2 \\o/', $value['name'] );
- $this->assertEquals( 'Description 2 \\o/', $value['description'] );
- $this->assertEquals( 1, $value['parent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Name 2 \\o/', $value['name'] );
+ $this->assertSame( 'Description 2 \\o/', $value['description'] );
+ $this->assertSame( 1, $value['parent'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $term = (array) wp_get_nav_menu_object( $menu_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( $value, wp_array_slice_assoc( $term, array_keys( $value ) ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $menu_object = wp_get_nav_menu_object( $menu_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( (object) $term, $menu_object );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_value['name'], $menu_object->name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_value['name'], $menu_object->name );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_options = get_option( 'nav_menu_options', array( 'auto_add' => array() ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $menu_id, $nav_menu_options['auto_add'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -227,7 +227,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $i = array_search( $menu_id, $menus_ids, true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'int', $i, 'Update-previewed menu does not appear in wp_get_nav_menus()' );
</span><span class="cx" style="display: block; padding: 0 10px"> $filtered_menu = $menus[ $i ];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Name 2 \\o/', $filtered_menu->name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Name 2 \\o/', $filtered_menu->name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -251,18 +251,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->wp_customize->set_post_value( $setting->id, $post_value );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting->preview();
</span><span class="cx" style="display: block; padding: 0 10px"> $value = $setting->value();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_value, $value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_value, $value );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $term = (array) wp_get_nav_menu_object( $menu_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $term );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $term );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( $post_value, wp_array_slice_assoc( $term, array_keys( $value ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $menu_id, $term['term_id'] );
- $this->assertEquals( $menu_id, $term['term_taxonomy_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $menu_id, $term['term_id'] );
+ $this->assertSame( $menu_id, $term['term_taxonomy_id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $menu_object = wp_get_nav_menu_object( $menu_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( (object) $term, $menu_object );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_value['name'], $menu_object->name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_value['name'], $menu_object->name );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_options = $this->get_nav_menu_items_option();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( $menu_id, $nav_menu_options['auto_add'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -272,7 +272,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $i = array_search( $menu_id, $menus_ids, true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'int', $i, 'Insert-previewed menu was not injected into wp_get_nav_menus()' );
</span><span class="cx" style="display: block; padding: 0 10px"> $filtered_menu = $menus[ $i ];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'New Menu Name 1 \\o/', $filtered_menu->name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'New Menu Name 1 \\o/', $filtered_menu->name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -334,15 +334,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'extra' => 'ignored',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $sanitized = $setting->sanitize( $value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Hello \\o/ <b>world</b>', $sanitized['name'] );
- $this->assertEquals( 'New line \\o/', $sanitized['description'] );
- $this->assertEquals( 0, $sanitized['parent'] );
- $this->assertEquals( true, $sanitized['auto_add'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Hello \\o/ <b>world</b>', $sanitized['name'] );
+ $this->assertSame( 'New line \\o/', $sanitized['description'] );
+ $this->assertSame( 0, $sanitized['parent'] );
+ $this->assertTrue( $sanitized['auto_add'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'name', 'description', 'parent', 'auto_add' ), array_keys( $sanitized ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $value['name'] = ' '; // Blank spaces.
</span><span class="cx" style="display: block; padding: 0 10px"> $sanitized = $setting->sanitize( $value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '(unnamed)', $sanitized['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '(unnamed)', $sanitized['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -383,13 +383,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $menu_object = wp_get_nav_menu_object( $menu_id );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( array( 'name', 'description', 'parent' ) as $key ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_value[ $key ], $menu_object->$key );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_value[ $key ], $menu_object->$key );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets(
</span><span class="cx" style="display: block; padding: 0 10px"> wp_array_slice_assoc( $new_value, array( 'name', 'description', 'parent' ) ),
</span><span class="cx" style="display: block; padding: 0 10px"> wp_array_slice_assoc( (array) $menu_object, array( 'name', 'description', 'parent' ) )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_value, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_value, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $save_response = apply_filters( 'customize_save_response', array() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'nav_menu_updates', $save_response );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -399,12 +399,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'error', $update_result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'status', $update_result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'saved_value', $update_result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_value, $update_result['saved_value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_value, $update_result['saved_value'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $menu_id, $update_result['term_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $menu_id, $update_result['term_id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $update_result['previous_term_id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $update_result['error'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'updated', $update_result['status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'updated', $update_result['status'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_options = $this->get_nav_menu_items_option();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( $menu_id, $nav_menu_options['auto_add'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -433,7 +433,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $setting->previous_term_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertLessThan( 0, $setting->term_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting->save();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $menu_id, $setting->previous_term_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $menu_id, $setting->previous_term_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertGreaterThan( 0, $setting->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_options = $this->get_nav_menu_items_option();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -451,12 +451,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'error', $update_result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'status', $update_result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'saved_value', $update_result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $setting->value(), $update_result['saved_value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $setting->value(), $update_result['saved_value'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $menu->term_id, $update_result['term_id'] );
- $this->assertEquals( $menu_id, $update_result['previous_term_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $menu->term_id, $update_result['term_id'] );
+ $this->assertSame( $menu_id, $update_result['previous_term_id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $update_result['error'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'inserted', $update_result['status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'inserted', $update_result['status'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -478,10 +478,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_resolved_menu_name = "$menu_name (2)";
</span><span class="cx" style="display: block; padding: 0 10px"> $new_menu = wp_get_nav_menu_object( $setting->term_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_resolved_menu_name, $new_menu->name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_resolved_menu_name, $new_menu->name );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $save_response = apply_filters( 'customize_save_response', array() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_resolved_menu_name, $save_response['nav_menu_updates'][0]['saved_value']['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_resolved_menu_name, $save_response['nav_menu_updates'][0]['saved_value']['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -501,7 +501,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'nav_menu_options', $nav_menu_options );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $menu = wp_get_nav_menu_object( $menu_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $menu_name, $menu->name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $menu_name, $menu->name );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->wp_customize->set_post_value( $setting_id, false );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting->save();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -518,10 +518,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'saved_value', $update_result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $update_result['saved_value'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $menu_id, $update_result['term_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $menu_id, $update_result['term_id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $update_result['previous_term_id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $update_result['error'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'deleted', $update_result['status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'deleted', $update_result['status'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_options = $this->get_nav_menu_items_option();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( $menu_id, $nav_menu_options['auto_add'] );
</span></span></pre></div>
<a id="trunktestsphpunittestscustomizenavmenusphp"></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/customize/nav-menus.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/customize/nav-menus.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/customize/nav-menus.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,9 +46,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function filter_item_types( $items ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $items[] = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'title' => 'Custom',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'type_label' => 'Custom Type',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'custom_type',
</span><span class="cx" style="display: block; padding: 0 10px"> 'object' => 'custom_object',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'type_label' => 'Custom Type',
</del><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $items;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -86,20 +86,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $menus = new WP_Customize_Nav_Menus( $this->wp_customize );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Customize_Manager', $menus->manager );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, add_filter( 'customize_refresh_nonces', array( $menus, 'filter_nonces' ) ) );
- $this->assertEquals( 10, add_action( 'wp_ajax_load-available-menu-items-customizer', array( $menus, 'ajax_load_available_items' ) ) );
- $this->assertEquals( 10, add_action( 'wp_ajax_search-available-menu-items-customizer', array( $menus, 'ajax_search_available_items' ) ) );
- $this->assertEquals( 10, add_action( 'wp_ajax_customize-nav-menus-insert-auto-draft', array( $menus, 'ajax_insert_auto_draft_post' ) ) );
- $this->assertEquals( 10, add_action( 'customize_controls_enqueue_scripts', array( $menus, 'enqueue_scripts' ) ) );
- $this->assertEquals( 11, add_action( 'customize_register', array( $menus, 'customize_register' ) ) );
- $this->assertEquals( 10, add_filter( 'customize_dynamic_setting_args', array( $menus, 'filter_dynamic_setting_args' ) ) );
- $this->assertEquals( 10, add_filter( 'customize_dynamic_setting_class', array( $menus, 'filter_dynamic_setting_class' ) ) );
- $this->assertEquals( 10, add_action( 'customize_controls_print_footer_scripts', array( $menus, 'print_templates' ) ) );
- $this->assertEquals( 10, add_action( 'customize_controls_print_footer_scripts', array( $menus, 'available_items_template' ) ) );
- $this->assertEquals( 10, add_action( 'customize_preview_init', array( $menus, 'customize_preview_init' ) ) );
- $this->assertEquals( 10, add_action( 'customize_preview_init', array( $menus, 'make_auto_draft_status_previewable' ) ) );
- $this->assertEquals( 10, add_action( 'customize_save_nav_menus_created_posts', array( $menus, 'save_nav_menus_created_posts' ) ) );
- $this->assertEquals( 10, add_filter( 'customize_dynamic_partial_args', array( $menus, 'customize_dynamic_partial_args' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertTrue( add_filter( 'customize_refresh_nonces', array( $menus, 'filter_nonces' ) ) );
+ $this->assertTrue( add_action( 'wp_ajax_load-available-menu-items-customizer', array( $menus, 'ajax_load_available_items' ) ) );
+ $this->assertTrue( add_action( 'wp_ajax_search-available-menu-items-customizer', array( $menus, 'ajax_search_available_items' ) ) );
+ $this->assertTrue( add_action( 'wp_ajax_customize-nav-menus-insert-auto-draft', array( $menus, 'ajax_insert_auto_draft_post' ) ) );
+ $this->assertTrue( add_action( 'customize_controls_enqueue_scripts', array( $menus, 'enqueue_scripts' ) ) );
+ $this->assertTrue( add_action( 'customize_register', array( $menus, 'customize_register' ) ) );
+ $this->assertTrue( add_filter( 'customize_dynamic_setting_args', array( $menus, 'filter_dynamic_setting_args' ) ) );
+ $this->assertTrue( add_filter( 'customize_dynamic_setting_class', array( $menus, 'filter_dynamic_setting_class' ) ) );
+ $this->assertTrue( add_action( 'customize_controls_print_footer_scripts', array( $menus, 'print_templates' ) ) );
+ $this->assertTrue( add_action( 'customize_controls_print_footer_scripts', array( $menus, 'available_items_template' ) ) );
+ $this->assertTrue( add_action( 'customize_preview_init', array( $menus, 'customize_preview_init' ) ) );
+ $this->assertTrue( add_action( 'customize_preview_init', array( $menus, 'make_auto_draft_status_previewable' ) ) );
+ $this->assertTrue( add_action( 'customize_save_nav_menus_created_posts', array( $menus, 'save_nav_menus_created_posts' ) ) );
+ $this->assertTrue( add_filter( 'customize_dynamic_partial_args', array( $menus, 'customize_dynamic_partial_args' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,12 +113,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Invalid post type $obj_name.
</span><span class="cx" style="display: block; padding: 0 10px"> $items = $menus->load_available_items_query( 'post_type', 'invalid' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $items );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'nav_menus_invalid_post_type', $items->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'nav_menus_invalid_post_type', $items->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Invalid taxonomy $obj_name.
</span><span class="cx" style="display: block; padding: 0 10px"> $items = $menus->load_available_items_query( 'taxonomy', 'invalid' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $items );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_taxonomy', $items->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_taxonomy', $items->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -317,7 +317,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 's' => 'This Does NOT Exist',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $results );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test posts.
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $post_ids as $post_id ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -339,7 +339,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 's' => $s,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $results[0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $results[0] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test terms.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -361,7 +361,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 's' => $s,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $results[0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $results[0] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test filtered results.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -380,7 +380,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 's' => 'cat',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $count + 1, $this->filter_count_customize_nav_menu_searched_items );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $count + 1, $this->filter_count_customize_nav_menu_searched_items );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $results );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 3, $results );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'customize_nav_menu_searched_items', array( $this, 'filter_search' ), 10 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -394,8 +394,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $results );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'home', $results[0]['id'] );
- $this->assertEquals( 'custom', $results[0]['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'home', $results[0]['id'] );
+ $this->assertSame( 'custom', $results[0]['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -512,11 +512,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array( 'type' => 'nav_menu_item' );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $menus->filter_dynamic_setting_args( $this->wp_customize, 'nav_menu_item[123]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected['type'], $results['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected['type'], $results['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array( 'type' => 'nav_menu' );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $menus->filter_dynamic_setting_args( $this->wp_customize, 'nav_menu[123]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected['type'], $results['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected['type'], $results['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -530,11 +530,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = 'WP_Customize_Nav_Menu_Item_Setting';
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $menus->filter_dynamic_setting_class( 'WP_Customize_Setting', 'nav_menu_item[123]', array( 'type' => 'nav_menu_item' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $results );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = 'WP_Customize_Nav_Menu_Setting';
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $menus->filter_dynamic_setting_class( 'WP_Customize_Setting', 'nav_menu[123]', array( 'type' => 'nav_menu' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $results );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $results );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -559,14 +559,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'customize_register', $this->wp_customize );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Customize_Nav_Menu_Item_Setting', $this->wp_customize->get_setting( "nav_menu_item[$item_id]" ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Primary', $this->wp_customize->get_section( "nav_menu[$menu_id]" )->title );
- $this->assertEquals( 'Hello World', $this->wp_customize->get_control( "nav_menu_item[$item_id]" )->label );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Primary', $this->wp_customize->get_section( "nav_menu[$menu_id]" )->title );
+ $this->assertSame( 'Hello World', $this->wp_customize->get_control( "nav_menu_item[$item_id]" )->label );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menus_created_posts_setting = $this->wp_customize->get_setting( 'nav_menus_created_posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Customize_Filter_Setting', $nav_menus_created_posts_setting );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'postMessage', $nav_menus_created_posts_setting->transport );
- $this->assertEquals( array(), $nav_menus_created_posts_setting->default );
- $this->assertEquals( array( $this->wp_customize->nav_menus, 'sanitize_nav_menus_created_posts' ), $nav_menus_created_posts_setting->sanitize_callback );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'postMessage', $nav_menus_created_posts_setting->transport );
+ $this->assertSame( array(), $nav_menus_created_posts_setting->default );
+ $this->assertSame( array( $this->wp_customize->nav_menus, 'sanitize_nav_menus_created_posts' ), $nav_menus_created_posts_setting->sanitize_callback );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -578,14 +578,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $menus = new WP_Customize_Nav_Menus( $this->wp_customize );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $menus->intval_base10( 2 ) );
- $this->assertEquals( 4, $menus->intval_base10( 4.1 ) );
- $this->assertEquals( 4, $menus->intval_base10( '4' ) );
- $this->assertEquals( 4, $menus->intval_base10( '04' ) );
- $this->assertEquals( 42, $menus->intval_base10( +42 ) );
- $this->assertEquals( -42, $menus->intval_base10( -42 ) );
- $this->assertEquals( 26, $menus->intval_base10( 0x1A ) );
- $this->assertEquals( 0, $menus->intval_base10( array() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $menus->intval_base10( 2 ) );
+ $this->assertSame( 4, $menus->intval_base10( 4.1 ) );
+ $this->assertSame( 4, $menus->intval_base10( '4' ) );
+ $this->assertSame( 4, $menus->intval_base10( '04' ) );
+ $this->assertSame( 42, $menus->intval_base10( +42 ) );
+ $this->assertSame( -42, $menus->intval_base10( -42 ) );
+ $this->assertSame( 26, $menus->intval_base10( 0x1A ) );
+ $this->assertSame( 0, $menus->intval_base10( array() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -600,27 +600,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'title' => 'Posts',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'type_label' => __( 'Post' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'post_type',
</span><span class="cx" style="display: block; padding: 0 10px"> 'object' => 'post',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'type_label' => __( 'Post' ),
</del><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'title' => 'Pages',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'type_label' => __( 'Page' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'post_type',
</span><span class="cx" style="display: block; padding: 0 10px"> 'object' => 'page',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'type_label' => __( 'Page' ),
</del><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'title' => 'Categories',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'type_label' => __( 'Category' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'taxonomy',
</span><span class="cx" style="display: block; padding: 0 10px"> 'object' => 'category',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'type_label' => __( 'Category' ),
</del><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'title' => 'Tags',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'type_label' => __( 'Tag' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'taxonomy',
</span><span class="cx" style="display: block; padding: 0 10px"> 'object' => 'post_tag',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'type_label' => __( 'Tag' ),
</del><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -627,33 +627,33 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( current_theme_supports( 'post-formats' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected[] = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'title' => 'Format',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'type_label' => __( 'Format' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'taxonomy',
</span><span class="cx" style="display: block; padding: 0 10px"> 'object' => 'post_format',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'type_label' => __( 'Format' ),
</del><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $menus->available_item_types() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $menus->available_item_types() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> register_taxonomy( 'wptests_tax', array( 'post' ), array( 'labels' => array( 'name' => 'Foo' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected[] = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'title' => 'Foo',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'type_label' => 'Foo',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'taxonomy',
</span><span class="cx" style="display: block; padding: 0 10px"> 'object' => 'wptests_tax',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'type_label' => 'Foo',
</del><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $menus->available_item_types() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $menus->available_item_types() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected[] = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'title' => 'Custom',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'type_label' => 'Custom Type',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'custom_type',
</span><span class="cx" style="display: block; padding: 0 10px"> 'object' => 'custom_object',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'type_label' => 'Custom Type',
</del><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'customize_nav_menu_available_item_types', array( $this, 'filter_item_types' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $menus->available_item_types() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $menus->available_item_types() );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'customize_nav_menu_available_item_types', array( $this, 'filter_item_types' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -668,7 +668,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $r = $menus->insert_auto_draft_post( array() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $r );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'unknown_post_type', $r->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'unknown_post_type', $r->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Non-existent post types allowed as of #39610.
</span><span class="cx" style="display: block; padding: 0 10px"> $r = $menus->insert_auto_draft_post(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -678,11 +678,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $r );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->wp_customize->changeset_uuid(), get_post_meta( $r->ID, '_customize_changeset_uuid', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->wp_customize->changeset_uuid(), get_post_meta( $r->ID, '_customize_changeset_uuid', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $r = $menus->insert_auto_draft_post( array( 'post_type' => 'post' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $r );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'empty_title', $r->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'empty_title', $r->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $r = $menus->insert_auto_draft_post(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -692,7 +692,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $r );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'status_forbidden', $r->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'status_forbidden', $r->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $r = $menus->insert_auto_draft_post(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -701,11 +701,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $r );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Hello World', $r->post_title );
- $this->assertEquals( '', $r->post_name );
- $this->assertEquals( 'hello-world', get_post_meta( $r->ID, '_customize_draft_post_name', true ) );
- $this->assertEquals( $this->wp_customize->changeset_uuid(), get_post_meta( $r->ID, '_customize_changeset_uuid', true ) );
- $this->assertEquals( 'post', $r->post_type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Hello World', $r->post_title );
+ $this->assertSame( '', $r->post_name );
+ $this->assertSame( 'hello-world', get_post_meta( $r->ID, '_customize_draft_post_name', true ) );
+ $this->assertSame( $this->wp_customize->changeset_uuid(), get_post_meta( $r->ID, '_customize_changeset_uuid', true ) );
+ $this->assertSame( 'post', $r->post_type );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $r = $menus->insert_auto_draft_post(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -716,12 +716,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $r );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Hello World', $r->post_title );
- $this->assertEquals( 'post', $r->post_type );
- $this->assertEquals( '', $r->post_name );
- $this->assertEquals( 'greetings-world', get_post_meta( $r->ID, '_customize_draft_post_name', true ) );
- $this->assertEquals( $this->wp_customize->changeset_uuid(), get_post_meta( $r->ID, '_customize_changeset_uuid', true ) );
- $this->assertEquals( 'Hi World', $r->post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Hello World', $r->post_title );
+ $this->assertSame( 'post', $r->post_type );
+ $this->assertSame( '', $r->post_name );
+ $this->assertSame( 'greetings-world', get_post_meta( $r->ID, '_customize_draft_post_name', true ) );
+ $this->assertSame( $this->wp_customize->changeset_uuid(), get_post_meta( $r->ID, '_customize_changeset_uuid', true ) );
+ $this->assertSame( 'Hi World', $r->post_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -805,14 +805,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args = apply_filters( 'customize_dynamic_partial_args', false, 'nav_menu_instance[68b329da9893e34099c7d8ad5cb9c940]' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'nav_menu_instance', $args['type'] );
- $this->assertEquals( array( $this->wp_customize->nav_menus, 'render_nav_menu_partial' ), $args['render_callback'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'nav_menu_instance', $args['type'] );
+ $this->assertSame( array( $this->wp_customize->nav_menus, 'render_nav_menu_partial' ), $args['render_callback'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $args['container_inclusive'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args = apply_filters( 'customize_dynamic_partial_args', array( 'fallback_refresh' => false ), 'nav_menu_instance[4099c7d8ad5cb9c94068b329da9893e3]' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'nav_menu_instance', $args['type'] );
- $this->assertEquals( array( $this->wp_customize->nav_menus, 'render_nav_menu_partial' ), $args['render_callback'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'nav_menu_instance', $args['type'] );
+ $this->assertSame( array( $this->wp_customize->nav_menus, 'render_nav_menu_partial' ), $args['render_callback'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $args['container_inclusive'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $args['fallback_refresh'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -827,9 +827,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $menus = new WP_Customize_Nav_Menus( $this->wp_customize );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $menus->customize_preview_init();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_action( 'wp_enqueue_scripts', array( $menus, 'customize_preview_enqueue_deps' ) ) );
- $this->assertEquals( 1000, has_filter( 'wp_nav_menu_args', array( $menus, 'filter_wp_nav_menu_args' ) ) );
- $this->assertEquals( 10, has_filter( 'wp_nav_menu', array( $menus, 'filter_wp_nav_menu' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_action( 'wp_enqueue_scripts', array( $menus, 'customize_preview_enqueue_deps' ) ) );
+ $this->assertSame( 1000, has_filter( 'wp_nav_menu_args', array( $menus, 'filter_wp_nav_menu_args' ) ) );
+ $this->assertSame( 10, has_filter( 'wp_nav_menu', array( $menus, 'filter_wp_nav_menu' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -907,15 +907,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $contributor_user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $sanitized = $menus->sanitize_nav_menus_created_posts( $value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $sanitized );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $sanitized );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $author_user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $sanitized = $menus->sanitize_nav_menus_created_posts( $value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $author_post_id ), $sanitized );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $author_post_id ), $sanitized );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $administrator_user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $sanitized = $menus->sanitize_nav_menus_created_posts( $value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $contributor_post_id, $author_post_id, $administrator_post_id, $draft_post_id ), $sanitized );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $contributor_post_id, $author_post_id, $administrator_post_id, $draft_post_id ), $sanitized );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -996,13 +996,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->wp_customize->set_post_value( $setting_id, array_merge( $post_ids, array( $pre_published_post_id ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = $this->wp_customize->get_setting( $setting_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Customize_Filter_Setting', $setting );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $menus, 'sanitize_nav_menus_created_posts' ), $setting->sanitize_callback );
- $this->assertEquals( $drafted_post_ids, $setting->post_value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $menus, 'sanitize_nav_menus_created_posts' ), $setting->sanitize_callback );
+ $this->assertSame( $drafted_post_ids, $setting->post_value() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( $private_post_id, $post_ids );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( $trashed_post_id, $post_ids );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'auto-draft', get_post_status( $drafted_post_ids[0] ) );
- $this->assertEquals( 'draft', get_post_status( $drafted_post_ids[1] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'auto-draft', get_post_status( $drafted_post_ids[0] ) );
+ $this->assertSame( 'draft', get_post_status( $drafted_post_ids[1] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $drafted_post_ids as $post_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( get_post( $post_id )->post_name );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( get_post_meta( $post_id, '_customize_draft_post_name', true ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1010,15 +1010,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $save_action_count = did_action( 'customize_save_nav_menus_created_posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting->save();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $save_action_count + 1, did_action( 'customize_save_nav_menus_created_posts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $save_action_count + 1, did_action( 'customize_save_nav_menus_created_posts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $drafted_post_ids as $post_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'publish', get_post_status( $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'publish', get_post_status( $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertRegExp( '/^auto-draft-\d+$/', get_post( $post_id )->post_name );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( get_post_meta( $post_id, '_customize_draft_post_name', true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'private', get_post_status( $private_post_id ) );
- $this->assertEquals( 'trash', get_post_status( $trashed_post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'private', get_post_status( $private_post_id ) );
+ $this->assertSame( 'trash', get_post_status( $trashed_post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure that unique slugs were assigned.
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = array_map( 'get_post', $drafted_post_ids );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1058,7 +1058,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $results['can_partial_refresh'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'customize_preview_nav_menus_args', $results );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'wp_page_menu', $results['fallback_cb'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'wp_page_menu', $results['fallback_cb'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_term = get_term( wp_create_nav_menu( 'Bar' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $menus->filter_wp_nav_menu_args(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1072,7 +1072,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $results['can_partial_refresh'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'customize_preview_nav_menus_args', $results );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $nav_menu_term->term_id, $results['customize_preview_nav_menus_args']['menu'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $nav_menu_term->term_id, $results['customize_preview_nav_menus_args']['menu'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $menus->filter_wp_nav_menu_args(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1144,7 +1144,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( ' data-customize-partial-type="nav_menu_instance"', $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( (bool) preg_match( '/data-customize-partial-placement-context="(.+?)"/', $result, $matches ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $context = json_decode( html_entity_decode( $matches[1] ), true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $original_args, wp_array_slice_assoc( $context, array_keys( $original_args ) ) ); // Because assertArraySubset is not available in PHP 5.2.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $original_args, wp_array_slice_assoc( $context, array_keys( $original_args ) ) ); // Because assertArraySubset is not available in PHP 5.2.
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $context['can_partial_refresh'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1210,7 +1210,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $partials = $this->wp_customize->selective_refresh->add_dynamic_partials( array( $partial_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $partials );
</span><span class="cx" style="display: block; padding: 0 10px"> $partial = array_shift( $partials );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $partial_id, $partial->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $partial_id, $partial->id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $missing_args_hmac_args = array_merge(
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu_args['customize_preview_nav_menus_args'],
</span></span></pre></div>
<a id="trunktestsphpunittestscustomizepanelphp"></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/customize/panel.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/customize/panel.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/customize/panel.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,16 +32,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_construct_default_args() {
</span><span class="cx" style="display: block; padding: 0 10px"> $panel = new WP_Customize_Panel( $this->manager, 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'int', $panel->instance_number );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->manager, $panel->manager );
- $this->assertEquals( 'foo', $panel->id );
- $this->assertEquals( 160, $panel->priority );
- $this->assertEquals( 'edit_theme_options', $panel->capability );
- $this->assertEquals( '', $panel->theme_supports );
- $this->assertEquals( '', $panel->title );
- $this->assertEquals( '', $panel->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->manager, $panel->manager );
+ $this->assertSame( 'foo', $panel->id );
+ $this->assertSame( 160, $panel->priority );
+ $this->assertSame( 'edit_theme_options', $panel->capability );
+ $this->assertSame( '', $panel->theme_supports );
+ $this->assertSame( '', $panel->title );
+ $this->assertSame( '', $panel->description );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $panel->sections );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'default', $panel->type );
- $this->assertEquals( array( $panel, 'active_callback' ), $panel->active_callback );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'default', $panel->type );
+ $this->assertSame( array( $panel, 'active_callback' ), $panel->active_callback );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,7 +60,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $panel = new WP_Customize_Panel( $this->manager, 'foo', $args );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $args as $key => $value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, $panel->$key );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, $panel->$key );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -69,7 +69,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_construct_custom_type() {
</span><span class="cx" style="display: block; padding: 0 10px"> $panel = new Custom_Panel_Test( $this->manager, 'foo' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'titleless', $panel->type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'titleless', $panel->type );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -119,9 +119,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $panel = new WP_Customize_Panel( $this->manager, 'foo', $args );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $panel->json();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo', $data['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo', $data['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( array( 'title', 'description', 'priority', 'type' ) as $key ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $args[ $key ], $data[ $key ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $args[ $key ], $data[ $key ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $data['content'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['active'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -167,8 +167,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $content = ob_get_clean();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $panel->check_capabilities() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $content );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $customize_render_panel_count + 1, did_action( 'customize_render_panel' ), 'Unexpected did_action count for customize_render_panel' );
- $this->assertEquals( 1, did_action( "customize_render_panel_{$panel->id}" ), "Unexpected did_action count for customize_render_panel_{$panel->id}" );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $customize_render_panel_count + 1, did_action( 'customize_render_panel' ), 'Unexpected did_action count for customize_render_panel' );
+ $this->assertSame( 1, did_action( "customize_render_panel_{$panel->id}" ), "Unexpected did_action count for customize_render_panel_{$panel->id}" );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestscustomizepartialphp"></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/customize/partial.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/customize/partial.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/customize/partial.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,15 +47,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_construct_default_args() {
</span><span class="cx" style="display: block; padding: 0 10px"> $partial_id = 'blogname';
</span><span class="cx" style="display: block; padding: 0 10px"> $partial = new WP_Customize_Partial( $this->selective_refresh, $partial_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $partial_id, $partial->id );
- $this->assertEquals( $this->selective_refresh, $partial->component );
- $this->assertEquals( 'default', $partial->type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $partial_id, $partial->id );
+ $this->assertSame( $this->selective_refresh, $partial->component );
+ $this->assertSame( 'default', $partial->type );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $partial->selector );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $partial_id ), $partial->settings );
- $this->assertEquals( $partial_id, $partial->primary_setting );
- $this->assertEquals( array( $partial, 'render_callback' ), $partial->render_callback );
- $this->assertEquals( false, $partial->container_inclusive );
- $this->assertEquals( true, $partial->fallback_refresh );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $partial_id ), $partial->settings );
+ $this->assertSame( $partial_id, $partial->primary_setting );
+ $this->assertSame( array( $partial, 'render_callback' ), $partial->render_callback );
+ $this->assertFalse( $partial->container_inclusive );
+ $this->assertTrue( $partial->fallback_refresh );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -102,15 +102,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'fallback_refresh' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $partial = new WP_Customize_Partial( $this->selective_refresh, $partial_id, $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $partial_id, $partial->id );
- $this->assertEquals( $this->selective_refresh, $partial->component );
- $this->assertEquals( $args['type'], $partial->type );
- $this->assertEquals( $args['selector'], $partial->selector );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $partial_id, $partial->id );
+ $this->assertSame( $this->selective_refresh, $partial->component );
+ $this->assertSame( $args['type'], $partial->type );
+ $this->assertSame( $args['selector'], $partial->selector );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( $args['settings'], $partial->settings );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $args['primary_setting'], $partial->primary_setting );
- $this->assertEquals( $args['render_callback'], $partial->render_callback );
- $this->assertEquals( false, $partial->container_inclusive );
- $this->assertEquals( false, $partial->fallback_refresh );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $args['primary_setting'], $partial->primary_setting );
+ $this->assertSame( $args['render_callback'], $partial->render_callback );
+ $this->assertFalse( $partial->container_inclusive );
+ $this->assertFalse( $partial->fallback_refresh );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'Lorem Ipsum', $partial->render() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $partial = new WP_Customize_Partial(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -120,8 +120,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'settings' => 'blogdescription',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'blogdescription' ), $partial->settings );
- $this->assertEquals( 'blogdescription', $partial->primary_setting );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'blogdescription' ), $partial->settings );
+ $this->assertSame( 'blogdescription', $partial->primary_setting );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -132,13 +132,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_id_data() {
</span><span class="cx" style="display: block; padding: 0 10px"> $partial = new WP_Customize_Partial( $this->selective_refresh, 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px"> $id_data = $partial->id_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo', $id_data['base'] );
- $this->assertEquals( array(), $id_data['keys'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo', $id_data['base'] );
+ $this->assertSame( array(), $id_data['keys'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $partial = new WP_Customize_Partial( $this->selective_refresh, 'bar[baz][quux]' );
</span><span class="cx" style="display: block; padding: 0 10px"> $id_data = $partial->id_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bar', $id_data['base'] );
- $this->assertEquals( array( 'baz', 'quux' ), $id_data['keys'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bar', $id_data['base'] );
+ $this->assertSame( array( 'baz', 'quux' ), $id_data['keys'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -180,7 +180,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|false Content.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function filter_customize_partial_render_with_id( $rendered, $partial, $container_context ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( 'customize_partial_render_%s', $partial->id ), current_filter() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( 'customize_partial_render_%s', $partial->id ), current_filter() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( false === $rendered || is_string( $rendered ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Customize_Partial', $partial );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $container_context );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -249,9 +249,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'customize_partial_render', array( $this, 'filter_customize_partial_render' ), 10, 3 );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( "customize_partial_render_{$partial->id}", array( $this, 'filter_customize_partial_render_with_id' ), 10, 3 );
</span><span class="cx" style="display: block; padding: 0 10px"> $rendered = $partial->render();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo', $rendered );
- $this->assertEquals( $count_filter_customize_partial_render + 1, $this->count_filter_customize_partial_render );
- $this->assertEquals( $count_filter_customize_partial_render_with_id + 1, $this->count_filter_customize_partial_render_with_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo', $rendered );
+ $this->assertSame( $count_filter_customize_partial_render + 1, $this->count_filter_customize_partial_render );
+ $this->assertSame( $count_filter_customize_partial_render_with_id + 1, $this->count_filter_customize_partial_render_with_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -272,9 +272,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'customize_partial_render', array( $this, 'filter_customize_partial_render' ), 10, 3 );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( "customize_partial_render_{$partial->id}", array( $this, 'filter_customize_partial_render_with_id' ), 10, 3 );
</span><span class="cx" style="display: block; padding: 0 10px"> $rendered = $partial->render();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bar', $rendered );
- $this->assertEquals( $count_filter_customize_partial_render + 1, $this->count_filter_customize_partial_render );
- $this->assertEquals( $count_filter_customize_partial_render_with_id + 1, $this->count_filter_customize_partial_render_with_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bar', $rendered );
+ $this->assertSame( $count_filter_customize_partial_render + 1, $this->count_filter_customize_partial_render );
+ $this->assertSame( $count_filter_customize_partial_render_with_id + 1, $this->count_filter_customize_partial_render_with_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestscustomizesectionphp"></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/customize/section.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/customize/section.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/customize/section.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,16 +39,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_construct_default_args() {
</span><span class="cx" style="display: block; padding: 0 10px"> $section = new WP_Customize_Section( $this->manager, 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'int', $section->instance_number );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->manager, $section->manager );
- $this->assertEquals( 'foo', $section->id );
- $this->assertEquals( 160, $section->priority );
- $this->assertEquals( 'edit_theme_options', $section->capability );
- $this->assertEquals( '', $section->theme_supports );
- $this->assertEquals( '', $section->title );
- $this->assertEquals( '', $section->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->manager, $section->manager );
+ $this->assertSame( 'foo', $section->id );
+ $this->assertSame( 160, $section->priority );
+ $this->assertSame( 'edit_theme_options', $section->capability );
+ $this->assertSame( '', $section->theme_supports );
+ $this->assertSame( '', $section->title );
+ $this->assertSame( '', $section->description );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $section->panel );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'default', $section->type );
- $this->assertEquals( array( $section, 'active_callback' ), $section->active_callback );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'default', $section->type );
+ $this->assertSame( array( $section, 'active_callback' ), $section->active_callback );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,7 +70,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $section = new WP_Customize_Section( $this->manager, 'foo', $args );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $args as $key => $value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, $section->$key );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, $section->$key );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -79,7 +79,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_construct_custom_type() {
</span><span class="cx" style="display: block; padding: 0 10px"> $section = new Custom_Section_Test( $this->manager, 'foo' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'titleless', $section->type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'titleless', $section->type );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -133,9 +133,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $section = new WP_Customize_Section( $this->manager, 'foo', $args );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $section->json();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo', $data['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo', $data['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( array( 'title', 'description', 'priority', 'panel', 'type' ) as $key ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $args[ $key ], $data[ $key ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $args[ $key ], $data[ $key ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $data['content'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['active'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -180,8 +180,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $content = ob_get_clean();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $section->check_capabilities() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $content );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $customize_render_section_count + 1, did_action( 'customize_render_section' ), 'Unexpected did_action count for customize_render_section' );
- $this->assertEquals( 1, did_action( "customize_render_section_{$section->id}" ), "Unexpected did_action count for customize_render_section_{$section->id}" );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $customize_render_section_count + 1, did_action( 'customize_render_section' ), 'Unexpected did_action count for customize_render_section' );
+ $this->assertSame( 1, did_action( "customize_render_section_{$section->id}" ), "Unexpected did_action count for customize_render_section_{$section->id}" );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestscustomizeselectiverefreshajaxphp"></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/customize/selective-refresh-ajax.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/customize/selective-refresh-ajax.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/customize/selective-refresh-ajax.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -79,7 +79,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $output = json_decode( ob_get_clean(), true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $output['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'expected_customize_preview', $output['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'expected_customize_preview', $output['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check expected_customize_preview.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,7 +92,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $output = json_decode( ob_get_clean(), true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $output['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'expected_customize_preview', $output['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'expected_customize_preview', $output['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check missing_partials.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->do_customize_boot_actions();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,7 +104,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $output = json_decode( ob_get_clean(), true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $output['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'missing_partials', $output['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'missing_partials', $output['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check missing_partials.
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['partials'] = 'bad';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,11 +113,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->selective_refresh->handle_render_partials_request();
</span><span class="cx" style="display: block; padding: 0 10px"> } catch ( WPDieException $e ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $e->getMessage() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $e->getMessage() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $output = json_decode( ob_get_clean(), true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $output['success'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'malformed_partials', $output['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'malformed_partials', $output['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -156,7 +156,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'customize_render_partials_after', array( $this, 'handle_action_customize_render_partials_after' ), 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->selective_refresh->handle_render_partials_request();
</span><span class="cx" style="display: block; padding: 0 10px"> } catch ( WPDieException $e ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $e->getMessage() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $e->getMessage() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $output = json_decode( ob_get_clean(), true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $output['success'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -164,7 +164,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'contents', $output['data'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'errors', $output['data'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'foo', $output['data']['contents'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( null, $output['data']['contents']['foo'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $output['data']['contents']['foo'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -198,12 +198,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'customize_render_partials_after', array( $this, 'handle_action_customize_render_partials_after' ), 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->selective_refresh->handle_render_partials_request();
</span><span class="cx" style="display: block; padding: 0 10px"> } catch ( WPDieException $e ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $e->getMessage() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $e->getMessage() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $count_customize_render_partials_before + 1, has_action( 'customize_render_partials_before' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $count_customize_render_partials_after + 1, has_action( 'customize_render_partials_after' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = json_decode( ob_get_clean(), true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( false ), $output['data']['contents']['foo'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( false ), $output['data']['contents']['foo'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -236,7 +236,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->selective_refresh->handle_render_partials_request();
</span><span class="cx" style="display: block; padding: 0 10px"> } catch ( WPDieException $e ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $e->getMessage() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $e->getMessage() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $output = json_decode( ob_get_clean(), true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $output['data']['contents']['secret_message'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -266,7 +266,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> try {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->selective_refresh->handle_render_partials_request();
</span><span class="cx" style="display: block; padding: 0 10px"> } catch ( WPDieException $e ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $e->getMessage() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $e->getMessage() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $output = json_decode( ob_get_clean(), true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $output['data']['contents']['bar'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -336,12 +336,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'customize_render_partials_after', array( $this, 'handle_action_customize_render_partials_after' ), 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->selective_refresh->handle_render_partials_request();
</span><span class="cx" style="display: block; padding: 0 10px"> } catch ( WPDieException $e ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $e->getMessage() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $e->getMessage() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $count_customize_render_partials_before + 1, has_action( 'customize_render_partials_before' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $count_customize_render_partials_after + 1, has_action( 'customize_render_partials_after' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = json_decode( ob_get_clean(), true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( get_bloginfo( 'name', 'display' ) ), $output['data']['contents']['test_blogname'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( get_bloginfo( 'name', 'display' ) ), $output['data']['contents']['test_blogname'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'setting_validities', $output['data'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -445,12 +445,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'customize_render_partials_after', array( $this, 'handle_action_customize_render_partials_after' ), 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->selective_refresh->handle_render_partials_request();
</span><span class="cx" style="display: block; padding: 0 10px"> } catch ( WPDieException $e ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $e->getMessage() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $e->getMessage() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $count_customize_render_partials_before + 1, has_action( 'customize_render_partials_before' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $count_customize_render_partials_after + 1, has_action( 'customize_render_partials_after' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = json_decode( ob_get_clean(), true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( get_bloginfo( 'name', 'display' ) ), $output['data']['contents']['test_dynamic_blogname'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( get_bloginfo( 'name', 'display' ) ), $output['data']['contents']['test_dynamic_blogname'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -497,13 +497,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'customize_render_partials_after', array( $this, 'handle_action_customize_render_partials_after' ), 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->selective_refresh->handle_render_partials_request();
</span><span class="cx" style="display: block; padding: 0 10px"> } catch ( WPDieException $e ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $e->getMessage() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $e->getMessage() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $count_customize_render_partials_before + 1, has_action( 'customize_render_partials_before' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $count_customize_render_partials_after + 1, has_action( 'customize_render_partials_after' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = json_decode( ob_get_clean(), true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( get_bloginfo( 'name', 'display' ) ), $output['data']['contents']['test_blogname'] );
- $this->assertEquals( array_fill( 0, 2, get_bloginfo( 'description', 'display' ) ), $output['data']['contents']['test_blogdescription'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( get_bloginfo( 'name', 'display' ) ), $output['data']['contents']['test_blogname'] );
+ $this->assertSame( array_fill( 0, 2, get_bloginfo( 'description', 'display' ) ), $output['data']['contents']['test_blogdescription'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestscustomizeselectiverefreshphp"></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/customize/selective-refresh.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/customize/selective-refresh.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/customize/selective-refresh.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,7 +45,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see WP_Customize_Selective_Refresh::__construct()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_construct() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->selective_refresh, $this->wp_customize->selective_refresh );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->selective_refresh, $this->wp_customize->selective_refresh );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,9 +83,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_crud_partial() {
</span><span class="cx" style="display: block; padding: 0 10px"> $partial = $this->selective_refresh->add_partial( 'foo' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->selective_refresh, $partial->component );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->selective_refresh, $partial->component );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Customize_Partial', $partial );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $partial, $this->selective_refresh->get_partial( $partial->id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $partial, $this->selective_refresh->get_partial( $partial->id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $partial->id, $this->selective_refresh->partials() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->selective_refresh->remove_partial( $partial->id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -93,8 +93,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( $partial->id, $this->selective_refresh->partials() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $partial = new WP_Customize_Partial( $this->selective_refresh, 'bar' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $partial, $this->selective_refresh->add_partial( $partial ) );
- $this->assertEquals( $partial, $this->selective_refresh->get_partial( 'bar' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $partial, $this->selective_refresh->add_partial( $partial ) );
+ $this->assertSame( $partial, $this->selective_refresh->get_partial( 'bar' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'bar' ), array_keys( $this->selective_refresh->partials() ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'customize_dynamic_partial_args', array( $this, 'filter_customize_dynamic_partial_args' ), 10, 2 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -102,7 +102,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $partial = $this->selective_refresh->add_partial( 'recognized-class' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'Tested_Custom_Partial', $partial );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '.recognized', $partial->selector );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '.recognized', $partial->selector );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -112,8 +112,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_init_preview() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->selective_refresh->init_preview();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_action( 'template_redirect', array( $this->selective_refresh, 'handle_render_partials_request' ) ) );
- $this->assertEquals( 10, has_action( 'wp_enqueue_scripts', array( $this->selective_refresh, 'enqueue_preview_scripts' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_action( 'template_redirect', array( $this->selective_refresh, 'handle_render_partials_request' ) ) );
+ $this->assertSame( 10, has_action( 'wp_enqueue_scripts', array( $this->selective_refresh, 'enqueue_preview_scripts' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -126,7 +126,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( 'customize-selective-refresh', $scripts->queue );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->selective_refresh->enqueue_preview_scripts();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'customize-selective-refresh', $scripts->queue );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1000, has_action( 'wp_footer', array( $this->selective_refresh, 'export_preview_data' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1000, has_action( 'wp_footer', array( $this->selective_refresh, 'export_preview_data' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -168,7 +168,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $exported_data['partials'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'blogname', $exported_data['partials'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'top_secret_message', $exported_data['partials'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '#site-title', $exported_data['partials']['blogname']['selector'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '#site-title', $exported_data['partials']['blogname']['selector'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'renderQueryVar', $exported_data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'l10n', $exported_data );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -194,7 +194,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'Tested_Custom_Partial', $this->selective_refresh->get_partial( 'recognized-class' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotInstanceOf( 'Tested_Custom_Partial', $this->selective_refresh->get_partial( 'recognized' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '.recognized', $this->selective_refresh->get_partial( 'recognized' )->selector );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '.recognized', $this->selective_refresh->get_partial( 'recognized' )->selector );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestscustomizesettingphp"></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/customize/setting.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/customize/setting.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/customize/setting.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,19 +33,19 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_constructor_without_args() {
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Setting( $this->manager, 'foo' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->manager, $setting->manager );
- $this->assertEquals( 'foo', $setting->id );
- $this->assertEquals( 'theme_mod', $setting->type );
- $this->assertEquals( 'edit_theme_options', $setting->capability );
- $this->assertEquals( '', $setting->theme_supports );
- $this->assertEquals( '', $setting->default );
- $this->assertEquals( 'refresh', $setting->transport );
- $this->assertEquals( '', $setting->sanitize_callback );
- $this->assertEquals( '', $setting->sanitize_js_callback );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->manager, $setting->manager );
+ $this->assertSame( 'foo', $setting->id );
+ $this->assertSame( 'theme_mod', $setting->type );
+ $this->assertSame( 'edit_theme_options', $setting->capability );
+ $this->assertSame( '', $setting->theme_supports );
+ $this->assertSame( '', $setting->default );
+ $this->assertSame( 'refresh', $setting->transport );
+ $this->assertSame( '', $setting->sanitize_callback );
+ $this->assertSame( '', $setting->sanitize_js_callback );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_filter( "customize_validate_{$setting->id}" ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_filter( "customize_sanitize_{$setting->id}" ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_filter( "customize_sanitize_js_{$setting->id}" ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $setting->dirty );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $setting->dirty );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -100,13 +100,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'sanitize_js_callback' => array( $this, 'sanitize_js_callback_for_tests' ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Setting( $this->manager, 'bar', $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bar', $setting->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bar', $setting->id );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $args as $key => $value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, $setting->$key );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, $setting->$key );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_filter( "customize_validate_{$setting->id}", $args['validate_callback'] ) );
- $this->assertEquals( 10, has_filter( "customize_sanitize_{$setting->id}", $args['sanitize_callback'] ) );
- $this->assertEquals( 10, has_filter( "customize_sanitize_js_{$setting->id}", $args['sanitize_js_callback'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_filter( "customize_validate_{$setting->id}", $args['validate_callback'] ) );
+ $this->assertSame( 10, has_filter( "customize_sanitize_{$setting->id}", $args['sanitize_callback'] ) );
+ $this->assertSame( 10, has_filter( "customize_sanitize_js_{$setting->id}", $args['sanitize_js_callback'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public $post_data_overrides = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -146,11 +146,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = "unset_{$type}_without_post_value";
</span><span class="cx" style="display: block; padding: 0 10px"> $default = "default_value_{$name}";
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Setting( $this->manager, $name, compact( 'type', 'default' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->undefined, call_user_func( $type_options['getter'], $name, $this->undefined ) );
- $this->assertEquals( $default, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->undefined, call_user_func( $type_options['getter'], $name, $this->undefined ) );
+ $this->assertSame( $default, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $setting->preview(), 'Preview should not no-op since setting has no existing value.' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $default, call_user_func( $type_options['getter'], $name, $this->undefined ), sprintf( 'Expected %s(%s) to return setting default: %s.', $type_options['getter'], $name, $default ) );
- $this->assertEquals( $default, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $default, call_user_func( $type_options['getter'], $name, $this->undefined ), sprintf( 'Expected %s(%s) to return setting default: %s.', $type_options['getter'], $name, $default ) );
+ $this->assertSame( $default, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Non-multidimensional: See what effect the preview has on an extant setting (default value should not be seen).
</span><span class="cx" style="display: block; padding: 0 10px"> $name = "set_{$type}_without_post_value";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -158,40 +158,40 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $initial_value = "initial_value_{$name}";
</span><span class="cx" style="display: block; padding: 0 10px"> call_user_func( $type_options['setter'], $name, $initial_value );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Setting( $this->manager, $name, compact( 'type', 'default' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $initial_value, call_user_func( $type_options['getter'], $name ) );
- $this->assertEquals( $initial_value, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $initial_value, call_user_func( $type_options['getter'], $name ) );
+ $this->assertSame( $initial_value, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $setting->preview(), 'Preview should no-op since setting value was extant and no post value was present.' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, did_action( "customize_preview_{$setting->id}" ) ); // Only applicable for custom types (not options or theme_mods).
- $this->assertEquals( 0, did_action( "customize_preview_{$setting->type}" ) ); // Only applicable for custom types (not options or theme_mods).
- $this->assertEquals( $initial_value, call_user_func( $type_options['getter'], $name ) );
- $this->assertEquals( $initial_value, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, did_action( "customize_preview_{$setting->id}" ) ); // Only applicable for custom types (not options or theme_mods).
+ $this->assertSame( 0, did_action( "customize_preview_{$setting->type}" ) ); // Only applicable for custom types (not options or theme_mods).
+ $this->assertSame( $initial_value, call_user_func( $type_options['getter'], $name ) );
+ $this->assertSame( $initial_value, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Non-multidimensional: Try updating a value that had a no-op preview.
</span><span class="cx" style="display: block; padding: 0 10px"> $overridden_value = "overridden_value_$name";
</span><span class="cx" style="display: block; padding: 0 10px"> call_user_func( $type_options['setter'], $name, $overridden_value );
</span><span class="cx" style="display: block; padding: 0 10px"> $message = 'Initial value should be overridden because initial preview() was no-op due to setting having existing value and/or post value was absent.';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $overridden_value, call_user_func( $type_options['getter'], $name ), $message );
- $this->assertEquals( $overridden_value, $setting->value(), $message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $overridden_value, call_user_func( $type_options['getter'], $name ), $message );
+ $this->assertSame( $overridden_value, $setting->value(), $message );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $initial_value, $setting->value(), $message );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Non-multidimensional: Ensure that setting a post value *after* preview() is called results in the post value being seen (deferred preview).
</span><span class="cx" style="display: block; padding: 0 10px"> $post_value = "post_value_for_{$setting->id}_set_after_preview_called";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, did_action( "customize_post_value_set_{$setting->id}" ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, did_action( "customize_post_value_set_{$setting->id}" ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_post_value( $setting->id, $post_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, did_action( "customize_post_value_set_{$setting->id}" ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, did_action( "customize_post_value_set_{$setting->id}" ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $overridden_value, $setting->value() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_value, call_user_func( $type_options['getter'], $name ) );
- $this->assertEquals( $post_value, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_value, call_user_func( $type_options['getter'], $name ) );
+ $this->assertSame( $post_value, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Non-multidimensional: Test unset setting being overridden by a post value.
</span><span class="cx" style="display: block; padding: 0 10px"> $name = "unset_{$type}_overridden";
</span><span class="cx" style="display: block; padding: 0 10px"> $default = "default_value_{$name}";
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Setting( $this->manager, $name, compact( 'type', 'default' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->undefined, call_user_func( $type_options['getter'], $name, $this->undefined ) );
- $this->assertEquals( $default, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->undefined, call_user_func( $type_options['getter'], $name, $this->undefined ) );
+ $this->assertSame( $default, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $setting->preview(), 'Preview applies because setting has post_data_overrides.' ); // Activate post_data.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->post_data_overrides[ $name ], call_user_func( $type_options['getter'], $name, $this->undefined ) );
- $this->assertEquals( $this->post_data_overrides[ $name ], $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->post_data_overrides[ $name ], call_user_func( $type_options['getter'], $name, $this->undefined ) );
+ $this->assertSame( $this->post_data_overrides[ $name ], $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Non-multidimensional: Test set setting being overridden by a post value.
</span><span class="cx" style="display: block; padding: 0 10px"> $name = "set_{$type}_overridden";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -199,13 +199,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $initial_value = "initial_value_{$name}";
</span><span class="cx" style="display: block; padding: 0 10px"> call_user_func( $type_options['setter'], $name, $initial_value );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Setting( $this->manager, $name, compact( 'type', 'default' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $initial_value, call_user_func( $type_options['getter'], $name, $this->undefined ) );
- $this->assertEquals( $initial_value, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $initial_value, call_user_func( $type_options['getter'], $name, $this->undefined ) );
+ $this->assertSame( $initial_value, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $setting->preview(), 'Preview applies because setting has post_data_overrides.' ); // Activate post_data.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, did_action( "customize_preview_{$setting->id}" ) ); // Only applicable for custom types (not options or theme_mods).
- $this->assertEquals( 0, did_action( "customize_preview_{$setting->type}" ) ); // Only applicable for custom types (not options or theme_mods).
- $this->assertEquals( $this->post_data_overrides[ $name ], call_user_func( $type_options['getter'], $name, $this->undefined ) );
- $this->assertEquals( $this->post_data_overrides[ $name ], $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, did_action( "customize_preview_{$setting->id}" ) ); // Only applicable for custom types (not options or theme_mods).
+ $this->assertSame( 0, did_action( "customize_preview_{$setting->type}" ) ); // Only applicable for custom types (not options or theme_mods).
+ $this->assertSame( $this->post_data_overrides[ $name ], call_user_func( $type_options['getter'], $name, $this->undefined ) );
+ $this->assertSame( $this->post_data_overrides[ $name ], $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -225,12 +225,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = $base_name . '[foo]';
</span><span class="cx" style="display: block; padding: 0 10px"> $default = "default_value_{$name}";
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Setting( $this->manager, $name, compact( 'type', 'default' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->undefined, call_user_func( $type_options['getter'], $base_name, $this->undefined ) );
- $this->assertEquals( $default, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->undefined, call_user_func( $type_options['getter'], $base_name, $this->undefined ) );
+ $this->assertSame( $default, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $setting->preview(), "Preview for $setting->id should apply because setting is not in DB." );
</span><span class="cx" style="display: block; padding: 0 10px"> $base_value = call_user_func( $type_options['getter'], $base_name, $this->undefined );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'foo', $base_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $default, $base_value['foo'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $default, $base_value['foo'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Multidimensional: See what effect the preview has on an extant setting (default value should not be seen) without post value.
</span><span class="cx" style="display: block; padding: 0 10px"> $base_name = "set_{$type}_multi";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -244,21 +244,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> call_user_func( $type_options['setter'], $base_name, $base_initial_value );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Setting( $this->manager, $name, compact( 'type', 'default' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $base_value = call_user_func( $type_options['getter'], $base_name, array() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $initial_value, $base_value['foo'] );
- $this->assertEquals( $initial_value, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $initial_value, $base_value['foo'] );
+ $this->assertSame( $initial_value, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $setting->preview(), "Preview for $setting->id should no-op because setting is in DB and post value is absent." );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, did_action( "customize_preview_{$setting->id}" ) ); // Only applicable for custom types (not options or theme_mods).
- $this->assertEquals( 0, did_action( "customize_preview_{$setting->type}" ) ); // Only applicable for custom types (not options or theme_mods).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, did_action( "customize_preview_{$setting->id}" ) ); // Only applicable for custom types (not options or theme_mods).
+ $this->assertSame( 0, did_action( "customize_preview_{$setting->type}" ) ); // Only applicable for custom types (not options or theme_mods).
</ins><span class="cx" style="display: block; padding: 0 10px"> $base_value = call_user_func( $type_options['getter'], $base_name, array() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $initial_value, $base_value['foo'] );
- $this->assertEquals( $initial_value, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $initial_value, $base_value['foo'] );
+ $this->assertSame( $initial_value, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Multidimensional: Ensure that setting a post value *after* preview() is called results in the post value being seen (deferred preview).
</span><span class="cx" style="display: block; padding: 0 10px"> $override_value = "post_value_for_{$setting->id}_set_after_preview_called";
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_post_value( $setting->id, $override_value );
</span><span class="cx" style="display: block; padding: 0 10px"> $base_value = call_user_func( $type_options['getter'], $base_name, array() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $override_value, $base_value['foo'] );
- $this->assertEquals( $override_value, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $override_value, $base_value['foo'] );
+ $this->assertSame( $override_value, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Multidimensional: Test unset setting being overridden by a post value.
</span><span class="cx" style="display: block; padding: 0 10px"> $base_name = "unset_{$type}_multi_overridden";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -265,14 +265,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = $base_name . '[foo]';
</span><span class="cx" style="display: block; padding: 0 10px"> $default = "default_value_{$name}";
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Setting( $this->manager, $name, compact( 'type', 'default' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->undefined, call_user_func( $type_options['getter'], $base_name, $this->undefined ) );
- $this->assertEquals( $default, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->undefined, call_user_func( $type_options['getter'], $base_name, $this->undefined ) );
+ $this->assertSame( $default, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $setting->preview(), "Preview for $setting->id should apply because a post value is present." );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, did_action( "customize_preview_{$setting->id}" ) ); // Only applicable for custom types (not options or theme_mods).
- $this->assertEquals( 0, did_action( "customize_preview_{$setting->type}" ) ); // Only applicable for custom types (not options or theme_mods).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, did_action( "customize_preview_{$setting->id}" ) ); // Only applicable for custom types (not options or theme_mods).
+ $this->assertSame( 0, did_action( "customize_preview_{$setting->type}" ) ); // Only applicable for custom types (not options or theme_mods).
</ins><span class="cx" style="display: block; padding: 0 10px"> $base_value = call_user_func( $type_options['getter'], $base_name, $this->undefined );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'foo', $base_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->post_data_overrides[ $name ], $base_value['foo'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->post_data_overrides[ $name ], $base_value['foo'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Multidimensional: Test set setting being overridden by a post value.
</span><span class="cx" style="display: block; padding: 0 10px"> $base_name = "set_{$type}_multi_overridden";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -288,21 +288,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $base_value = call_user_func( $type_options['getter'], $base_name, $this->undefined );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'foo', $base_value );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'bar', $base_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $base_initial_value['foo'], $base_value['foo'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $base_initial_value['foo'], $base_value['foo'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $getter = call_user_func( $type_options['getter'], $base_name, $this->undefined );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $base_initial_value['bar'], $getter['bar'] );
- $this->assertEquals( $initial_value, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $base_initial_value['bar'], $getter['bar'] );
+ $this->assertSame( $initial_value, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $setting->preview(), "Preview for $setting->id should apply because post value is present." );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, did_action( "customize_preview_{$setting->id}" ) ); // Only applicable for custom types (not options or theme_mods).
- $this->assertEquals( 0, did_action( "customize_preview_{$setting->type}" ) ); // Only applicable for custom types (not options or theme_mods).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, did_action( "customize_preview_{$setting->id}" ) ); // Only applicable for custom types (not options or theme_mods).
+ $this->assertSame( 0, did_action( "customize_preview_{$setting->type}" ) ); // Only applicable for custom types (not options or theme_mods).
</ins><span class="cx" style="display: block; padding: 0 10px"> $base_value = call_user_func( $type_options['getter'], $base_name, $this->undefined );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'foo', $base_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->post_data_overrides[ $name ], $base_value['foo'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->post_data_overrides[ $name ], $base_value['foo'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'bar', call_user_func( $type_options['getter'], $base_name, $this->undefined ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $getter = call_user_func( $type_options['getter'], $base_name, $this->undefined );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $base_initial_value['bar'], $getter['bar'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $base_initial_value['bar'], $getter['bar'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -343,7 +343,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = preg_replace( '/^customize_value_/', '', current_filter() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Customize_Setting', $setting );
</span><span class="cx" style="display: block; padding: 0 10px"> $id_data = $setting->id_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $name, $id_data['base'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $name, $id_data['base'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> return $this->custom_type_getter( $name, $default );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -381,13 +381,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Setting( $this->manager, $name, compact( 'type', 'default' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> // Note: #29316 will allow us to have one filter for all settings of a given type, which is what we need.
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( "customize_value_{$name}", array( $this, 'custom_type_value_filter' ), 10, 2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->undefined, $this->custom_type_getter( $name, $this->undefined ) );
- $this->assertEquals( $default, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->undefined, $this->custom_type_getter( $name, $this->undefined ) );
+ $this->assertSame( $default, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $setting->preview() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, did_action( "customize_preview_{$setting->id}" ) );
- $this->assertEquals( 1, did_action( "customize_preview_{$setting->type}" ) );
- $this->assertEquals( $this->undefined, $this->custom_type_getter( $name, $this->undefined ) ); // Note: for a non-custom type this is $default.
- $this->assertEquals( $default, $setting->value() ); // Should be same as above.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, did_action( "customize_preview_{$setting->id}" ) );
+ $this->assertSame( 1, did_action( "customize_preview_{$setting->type}" ) );
+ $this->assertSame( $this->undefined, $this->custom_type_getter( $name, $this->undefined ) ); // Note: for a non-custom type this is $default.
+ $this->assertSame( $default, $setting->value() ); // Should be same as above.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Custom type existing and no post value override.
</span><span class="cx" style="display: block; padding: 0 10px"> $name = "set_{$type}_without_post_value";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -397,19 +397,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Setting( $this->manager, $name, compact( 'type', 'default' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> // Note: #29316 will allow us to have one filter for all settings of a given type, which is what we need.
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( "customize_value_{$name}", array( $this, 'custom_type_value_filter' ), 10, 2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $initial_value, $this->custom_type_getter( $name, $this->undefined ) );
- $this->assertEquals( $initial_value, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $initial_value, $this->custom_type_getter( $name, $this->undefined ) );
+ $this->assertSame( $initial_value, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $setting->preview(), "Preview for $setting->id should not apply because existing type without an override." );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, did_action( "customize_preview_{$setting->id}" ), 'Zero preview actions because initial value is set with no incoming post value, so there is no preview to apply.' );
- $this->assertEquals( 1, did_action( "customize_preview_{$setting->type}" ) );
- $this->assertEquals( $initial_value, $this->custom_type_getter( $name, $this->undefined ) ); // Should be same as above.
- $this->assertEquals( $initial_value, $setting->value() ); // Should be same as above.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, did_action( "customize_preview_{$setting->id}" ), 'Zero preview actions because initial value is set with no incoming post value, so there is no preview to apply.' );
+ $this->assertSame( 1, did_action( "customize_preview_{$setting->type}" ) );
+ $this->assertSame( $initial_value, $this->custom_type_getter( $name, $this->undefined ) ); // Should be same as above.
+ $this->assertSame( $initial_value, $setting->value() ); // Should be same as above.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Custom type deferred preview (setting post value after preview ran).
</span><span class="cx" style="display: block; padding: 0 10px"> $override_value = "custom_type_value_{$name}_override_deferred_preview";
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_post_value( $setting->id, $override_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $override_value, $this->custom_type_getter( $name, $this->undefined ) ); // Should be same as above.
- $this->assertEquals( $override_value, $setting->value() ); // Should be same as above.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $override_value, $this->custom_type_getter( $name, $this->undefined ) ); // Should be same as above.
+ $this->assertSame( $override_value, $setting->value() ); // Should be same as above.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Custom type not existing and with a post value override.
</span><span class="cx" style="display: block; padding: 0 10px"> $name = "unset_{$type}_with_post_value";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -417,13 +417,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Setting( $this->manager, $name, compact( 'type', 'default' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> // Note: #29316 will allow us to have one filter for all settings of a given type, which is what we need.
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( "customize_value_{$name}", array( $this, 'custom_type_value_filter' ), 10, 2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->undefined, $this->custom_type_getter( $name, $this->undefined ) );
- $this->assertEquals( $default, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->undefined, $this->custom_type_getter( $name, $this->undefined ) );
+ $this->assertSame( $default, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $setting->preview() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, did_action( "customize_preview_{$setting->id}" ), 'One preview action now because initial value was not set and/or there is no incoming post value, so there is is a preview to apply.' );
- $this->assertEquals( 3, did_action( "customize_preview_{$setting->type}" ) );
- $this->assertEquals( $post_data_overrides[ $name ], $this->custom_type_getter( $name, $this->undefined ) );
- $this->assertEquals( $post_data_overrides[ $name ], $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, did_action( "customize_preview_{$setting->id}" ), 'One preview action now because initial value was not set and/or there is no incoming post value, so there is is a preview to apply.' );
+ $this->assertSame( 3, did_action( "customize_preview_{$setting->type}" ) );
+ $this->assertSame( $post_data_overrides[ $name ], $this->custom_type_getter( $name, $this->undefined ) );
+ $this->assertSame( $post_data_overrides[ $name ], $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Custom type not existing and with a post value override.
</span><span class="cx" style="display: block; padding: 0 10px"> $name = "set_{$type}_with_post_value";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -433,13 +433,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Setting( $this->manager, $name, compact( 'type', 'default' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> // Note: #29316 will allow us to have one filter for all settings of a given type, which is what we need.
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( "customize_value_{$name}", array( $this, 'custom_type_value_filter' ), 10, 2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $initial_value, $this->custom_type_getter( $name, $this->undefined ) );
- $this->assertEquals( $initial_value, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $initial_value, $this->custom_type_getter( $name, $this->undefined ) );
+ $this->assertSame( $initial_value, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $setting->preview() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, did_action( "customize_preview_{$setting->id}" ) );
- $this->assertEquals( 4, did_action( "customize_preview_{$setting->type}" ) );
- $this->assertEquals( $post_data_overrides[ $name ], $this->custom_type_getter( $name, $this->undefined ) );
- $this->assertEquals( $post_data_overrides[ $name ], $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, did_action( "customize_preview_{$setting->id}" ) );
+ $this->assertSame( 4, did_action( "customize_preview_{$setting->type}" ) );
+ $this->assertSame( $post_data_overrides[ $name ], $this->custom_type_getter( $name, $this->undefined ) );
+ $this->assertSame( $post_data_overrides[ $name ], $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Custom type that does not handle supplying the post value from the customize_value_{$id_base} filter.
</span><span class="cx" style="display: block; padding: 0 10px"> $setting_id = 'custom_without_previewing_value_filter';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -478,11 +478,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = 'unset_option_without_post_value';
</span><span class="cx" style="display: block; padding: 0 10px"> $default = "default_value_{$name}";
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Setting( $this->manager, $name, compact( 'type', 'default' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->undefined, get_option( $name, $this->undefined ) );
- $this->assertEquals( $default, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->undefined, get_option( $name, $this->undefined ) );
+ $this->assertSame( $default, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $setting->preview() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $default, get_option( $name, $this->undefined ), sprintf( 'Expected get_option(%s) to return setting default: %s.', $name, $default ) );
- $this->assertEquals( $default, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $default, get_option( $name, $this->undefined ), sprintf( 'Expected get_option(%s) to return setting default: %s.', $name, $default ) );
+ $this->assertSame( $default, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -527,7 +527,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_Customize_Setting $setting
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function handle_customize_update_custom_foo_action( $value, $setting = null ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'hello world \\o/', $value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'hello world \\o/', $value );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Customize_Setting', $setting );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -539,8 +539,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function handle_customize_save_custom_foo_action( $setting ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Customize_Setting', $setting );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'custom', $setting->type );
- $this->assertEquals( 'foo', $setting->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'custom', $setting->type );
+ $this->assertSame( 'foo', $setting->id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -561,8 +561,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $setting->preview() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $setting->is_current_blog_previewed() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_value, $setting->value() );
- $this->assertEquals( $post_value, get_option( $name ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_value, $setting->value() );
+ $this->assertSame( $post_value, get_option( $name ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -610,8 +610,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_post_value( $setting->id, $value );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting->save();
</span><span class="cx" style="display: block; padding: 0 10px"> $autoload = $wpdb->get_var( $wpdb->prepare( "SELECT autoload FROM $wpdb->options WHERE option_name = %s", $setting->id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'yes', $autoload );
- $this->assertEquals( $value, get_option( $name ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'yes', $autoload );
+ $this->assertSame( $value, get_option( $name ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $name = 'autoloaded2';
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Setting(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -626,8 +626,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_post_value( $setting->id, $value );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting->save();
</span><span class="cx" style="display: block; padding: 0 10px"> $autoload = $wpdb->get_var( $wpdb->prepare( "SELECT autoload FROM $wpdb->options WHERE option_name = %s", $setting->id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'yes', $autoload );
- $this->assertEquals( $value, get_option( $name ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'yes', $autoload );
+ $this->assertSame( $value, get_option( $name ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $name = 'not-autoloaded1';
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Setting(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -642,8 +642,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_post_value( $setting->id, $value );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting->save();
</span><span class="cx" style="display: block; padding: 0 10px"> $autoload = $wpdb->get_var( $wpdb->prepare( "SELECT autoload FROM $wpdb->options WHERE option_name = %s", $setting->id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'no', $autoload );
- $this->assertEquals( $value, get_option( $name ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'no', $autoload );
+ $this->assertSame( $value, get_option( $name ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $id_base = 'multi-not-autoloaded';
</span><span class="cx" style="display: block; padding: 0 10px"> $setting1 = new WP_Customize_Setting(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -665,7 +665,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_post_value( $setting2->id, 'value2' );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting1->save();
</span><span class="cx" style="display: block; padding: 0 10px"> $autoload = $wpdb->get_var( $wpdb->prepare( "SELECT autoload FROM $wpdb->options WHERE option_name = %s", $id_base ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'no', $autoload, 'Even though setting1 did not indicate autoload (thus normally true), since another multidimensional option setting of the base did say autoload=false, it should be autoload=no' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'no', $autoload, 'Even though setting1 did not indicate autoload (thus normally true), since another multidimensional option setting of the base did say autoload=false, it should be autoload=no' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -685,8 +685,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Setting( $this->manager, 'name', $args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $default, $setting->value() );
- $this->assertEquals( base64_encode( $default ), $setting->js_value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $default, $setting->value() );
+ $this->assertSame( base64_encode( $default ), $setting->js_value() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $exported = $setting->json();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'type', $exported );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -693,10 +693,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'value', $exported );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'transport', $exported );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'dirty', $exported );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $setting->js_value(), $exported['value'] );
- $this->assertEquals( $args['type'], $setting->type );
- $this->assertEquals( $args['transport'], $setting->transport );
- $this->assertEquals( $args['dirty'], $setting->dirty );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $setting->js_value(), $exported['value'] );
+ $this->assertSame( $args['type'], $setting->type );
+ $this->assertSame( $args['transport'], $setting->transport );
+ $this->assertSame( $args['dirty'], $setting->dirty );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -715,7 +715,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $validity = $setting->validate( 'BAD!' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $validity );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_key', $validity->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_key', $validity->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -756,13 +756,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $setting_id = 'nav_menu_locations[primary]';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = new WP_Customize_Setting( $this->manager, $setting_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $initial_value, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $initial_value, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $override_value = -123456;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->set_post_value( $setting_id, $override_value );
</span><span class="cx" style="display: block; padding: 0 10px"> $setting->preview();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $override_value, $setting->value() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $override_value, $setting->value() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestscustomizewidgetsphp"></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/customize/widgets.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/customize/widgets.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/customize/widgets.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,7 +38,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 2, get_option( 'widget_search' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $widget_categories = get_option( 'widget_categories' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 2, $widget_categories );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $widget_categories[2]['title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $widget_categories[2]['title'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->backup_registered_sidebars = $GLOBALS['wp_registered_sidebars'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,7 +90,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_construct() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Customize_Widgets', $this->manager->widgets );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->manager, $this->manager->widgets->manager );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->manager, $this->manager->widgets->manager );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -105,7 +105,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> delete_option( 'sidebars_widgets' );
</span><span class="cx" style="display: block; padding: 0 10px"> register_sidebar( array( 'id' => $sidebar_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->widgets->customize_register();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array_fill_keys( array( 'wp_inactive_widgets', $sidebar_id ), array() ), wp_get_sidebars_widgets() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array_fill_keys( array( 'wp_inactive_widgets', $sidebar_id ), array() ), wp_get_sidebars_widgets() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -121,7 +121,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $selective_refreshable_widgets = $this->manager->widgets->get_selective_refreshable_widgets();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $selective_refreshable_widgets );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( count( $wp_widget_factory->widgets ), count( $selective_refreshable_widgets ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( count( $wp_widget_factory->widgets ), count( $selective_refreshable_widgets ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'text', $selective_refreshable_widgets );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $selective_refreshable_widgets['text'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'search', $selective_refreshable_widgets );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -206,18 +206,18 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = $this->manager->get_setting( 'widget_categories[2]' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $setting, 'Expected setting for pre-existing widget category-2, being customized.' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_transport, $setting->transport );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_transport, $setting->transport );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = $this->manager->get_setting( 'widget_search[2]' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $setting, 'Expected setting for pre-existing widget search-2, not being customized.' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_transport, $setting->transport );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_transport, $setting->transport );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $setting = $this->manager->get_setting( 'widget_search[3]' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $setting, 'Expected dynamic setting for non-existing widget search-3, being customized.' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_transport, $setting->transport );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_transport, $setting->transport );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $widget_categories = get_option( 'widget_categories' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $raw_widget_customized['widget_categories[2]'], $widget_categories[2], 'Expected $wp_customize->get_setting(widget_categories[2])->preview() to have been called.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $raw_widget_customized['widget_categories[2]'], $widget_categories[2], 'Expected $wp_customize->get_setting(widget_categories[2])->preview() to have been called.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -267,9 +267,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $args = $this->manager->widgets->get_setting_args( 'widget_foo[2]' );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $default_args as $key => $default_value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $default_value, $args[ $key ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $default_value, $args[ $key ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'WIDGET_FOO[2]', $args['uppercase_id_set_by_filter'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'WIDGET_FOO[2]', $args['uppercase_id_set_by_filter'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $default_args = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'option',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -281,12 +281,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $args = $this->manager->widgets->get_setting_args( 'widget_search[2]' );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $default_args as $key => $default_value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $default_value, $args[ $key ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $default_value, $args[ $key ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_theme_support( 'customize-selective-refresh-widgets' );
</span><span class="cx" style="display: block; padding: 0 10px"> $args = $this->manager->widgets->get_setting_args( 'widget_search[2]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'refresh', $args['transport'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'refresh', $args['transport'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> add_theme_support( 'customize-selective-refresh-widgets' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $override_args = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -299,9 +299,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $args = $this->manager->widgets->get_setting_args( 'widget_bar[3]', $override_args );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $override_args as $key => $override_value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $override_value, $args[ $key ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $override_value, $args[ $key ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'WIDGET_BAR[3]', $args['uppercase_id_set_by_filter'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'WIDGET_BAR[3]', $args['uppercase_id_set_by_filter'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $default_args = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'option',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -313,9 +313,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $args = $this->manager->widgets->get_setting_args( 'sidebars_widgets[sidebar-1]' );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $default_args as $key => $default_value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $default_value, $args[ $key ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $default_value, $args[ $key ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'SIDEBARS_WIDGETS[SIDEBAR-1]', $args['uppercase_id_set_by_filter'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'SIDEBARS_WIDGETS[SIDEBAR-1]', $args['uppercase_id_set_by_filter'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $override_args = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'theme_mod',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -327,9 +327,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $args = $this->manager->widgets->get_setting_args( 'sidebars_widgets[sidebar-2]', $override_args );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $override_args as $key => $override_value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $override_value, $args[ $key ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $override_value, $args[ $key ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'SIDEBARS_WIDGETS[SIDEBAR-2]', $args['uppercase_id_set_by_filter'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'SIDEBARS_WIDGETS[SIDEBAR-2]', $args['uppercase_id_set_by_filter'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function filter_widget_customizer_setting_args( $args, $id ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -353,7 +353,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $sanitized_for_js = $this->manager->widgets->sanitize_widget_js_instance( $new_categories_instance );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'encoded_serialized_instance', $sanitized_for_js );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_serialized( base64_decode( $sanitized_for_js['encoded_serialized_instance'] ), true ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_categories_instance['title'], $sanitized_for_js['title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_categories_instance['title'], $sanitized_for_js['title'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $sanitized_for_js['is_widget_customizer_js_value'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'instance_hash_key', $sanitized_for_js );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -362,7 +362,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $this->manager->widgets->sanitize_widget_instance( $corrupted_sanitized_for_js ), 'Expected sanitize_widget_instance to reject corrupted data.' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $unsanitized_from_js = $this->manager->widgets->sanitize_widget_instance( $sanitized_for_js );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $unsanitized_from_js, $new_categories_instance );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $unsanitized_from_js, $new_categories_instance );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -425,14 +425,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $control = $this->manager->get_control( 'widget_search[2]' );
</span><span class="cx" style="display: block; padding: 0 10px"> $params = $control->json();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'widget_form', $params['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'widget_form', $params['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertRegExp( '#^<li[^>]+>\s*</li>$#', $params['content'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertRegExp( '#^<div[^>]*class=\'widget\'[^>]*#s', $params['widget_control'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '<div class="widget-content"></div>', $params['widget_control'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( '<input class="widefat"', $params['widget_control'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '<input class="widefat"', $params['widget_content'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'search-2', $params['widget_id'] );
- $this->assertEquals( 'search', $params['widget_id_base'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'search-2', $params['widget_id'] );
+ $this->assertSame( 'search', $params['widget_id_base'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'sidebar_id', $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'width', $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'height', $params );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -496,7 +496,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'instance', $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'form', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $instance, $result['instance'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $instance, $result['instance'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( sprintf( 'value="%s"', esc_attr( $instance['title'] ) ), $result['form'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_values = $this->manager->unsanitized_post_values();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -507,7 +507,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'encoded_serialized_instance', $post_value );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'instance_hash_key', $post_value );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'is_widget_customizer_js_value', $post_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_value, $this->manager->widgets->sanitize_widget_js_instance( $instance ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_value, $this->manager->widgets->sanitize_widget_js_instance( $instance ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -520,14 +520,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args = apply_filters( 'customize_dynamic_partial_args', false, 'widget[search-2]' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'widget', $args['type'] );
- $this->assertEquals( array( $this->manager->widgets, 'render_widget_partial' ), $args['render_callback'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'widget', $args['type'] );
+ $this->assertSame( array( $this->manager->widgets, 'render_widget_partial' ), $args['render_callback'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $args['container_inclusive'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args = apply_filters( 'customize_dynamic_partial_args', array( 'fallback_refresh' => false ), 'widget[search-2]' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'widget', $args['type'] );
- $this->assertEquals( array( $this->manager->widgets, 'render_widget_partial' ), $args['render_callback'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'widget', $args['type'] );
+ $this->assertSame( array( $this->manager->widgets, 'render_widget_partial' ), $args['render_callback'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $args['container_inclusive'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $args['fallback_refresh'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -544,10 +544,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_selective_refresh_init_with_theme_support() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_theme_support( 'customize-selective-refresh-widgets' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->manager->widgets->selective_refresh_init();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_action( 'dynamic_sidebar_before', array( $this->manager->widgets, 'start_dynamic_sidebar' ) ) );
- $this->assertEquals( 10, has_action( 'dynamic_sidebar_after', array( $this->manager->widgets, 'end_dynamic_sidebar' ) ) );
- $this->assertEquals( 10, has_filter( 'dynamic_sidebar_params', array( $this->manager->widgets, 'filter_dynamic_sidebar_params' ) ) );
- $this->assertEquals( 10, has_filter( 'wp_kses_allowed_html', array( $this->manager->widgets, 'filter_wp_kses_allowed_data_attributes' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_action( 'dynamic_sidebar_before', array( $this->manager->widgets, 'start_dynamic_sidebar' ) ) );
+ $this->assertSame( 10, has_action( 'dynamic_sidebar_after', array( $this->manager->widgets, 'end_dynamic_sidebar' ) ) );
+ $this->assertSame( 10, has_filter( 'dynamic_sidebar_params', array( $this->manager->widgets, 'filter_dynamic_sidebar_params' ) ) );
+ $this->assertSame( 10, has_filter( 'wp_kses_allowed_html', array( $this->manager->widgets, 'filter_wp_kses_allowed_data_attributes' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -603,24 +603,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $params, $this->manager->widgets->filter_dynamic_sidebar_params( $params ), 'Expected short-circuit if not called after dynamic_sidebar_before.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $params, $this->manager->widgets->filter_dynamic_sidebar_params( $params ), 'Expected short-circuit if not called after dynamic_sidebar_before.' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'dynamic_sidebar_before', 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = ob_get_clean();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<!--dynamic_sidebar_before:foo:1-->', trim( $output ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<!--dynamic_sidebar_before:foo:1-->', trim( $output ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $bad_params = $params;
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $bad_params[0]['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $bad_params, $this->manager->widgets->filter_dynamic_sidebar_params( $bad_params ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $bad_params, $this->manager->widgets->filter_dynamic_sidebar_params( $bad_params ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $bad_params = $params;
</span><span class="cx" style="display: block; padding: 0 10px"> $bad_params[0]['id'] = 'non-existing';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $bad_params, $this->manager->widgets->filter_dynamic_sidebar_params( $bad_params ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $bad_params, $this->manager->widgets->filter_dynamic_sidebar_params( $bad_params ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $bad_params = $params;
</span><span class="cx" style="display: block; padding: 0 10px"> $bad_params[0]['before_widget'] = ' <oops>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $bad_params, $this->manager->widgets->filter_dynamic_sidebar_params( $bad_params ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $bad_params, $this->manager->widgets->filter_dynamic_sidebar_params( $bad_params ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $filtered_params = $this->manager->widgets->filter_dynamic_sidebar_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $params, $filtered_params );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -627,7 +627,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'dynamic_sidebar_after', 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = ob_get_clean();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<!--dynamic_sidebar_after:foo:1-->', trim( $output ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<!--dynamic_sidebar_after:foo:1-->', trim( $output ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = wp_kses_post( $filtered_params[0]['before_widget'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'data-customize-partial-id="widget[search-2]"', $output );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -648,7 +648,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $partials = $this->manager->selective_refresh->add_dynamic_partials( array( $partial_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $partials );
</span><span class="cx" style="display: block; padding: 0 10px"> $partial = array_shift( $partials );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $partial_id, $partial->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $partial_id, $partial->id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->manager->widgets->render_widget_partial( $partial, array() ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $this->manager->widgets->render_widget_partial( $partial, array( 'sidebar_id' => 'non-existing' ) ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -655,8 +655,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = $this->manager->widgets->render_widget_partial( $partial, array( 'sidebar_id' => 'sidebar-1' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, substr_count( $output, 'data-customize-partial-id' ) );
- $this->assertEquals( 1, substr_count( $output, 'data-customize-partial-type="widget"' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, substr_count( $output, 'data-customize-partial-id' ) );
+ $this->assertSame( 1, substr_count( $output, 'data-customize-partial-type="widget"' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( ' id="search-2"', $output );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsdatedateI18nphp"></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/date/dateI18n.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/date/dateI18n.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/date/dateI18n.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,8 +33,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $rfc3339 = $datetime->format( DATE_RFC3339 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, date_i18n( 'U', 0 ) );
- $this->assertEquals( $rfc3339, date_i18n( DATE_RFC3339, 0 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, date_i18n( 'U', 0 ) );
+ $this->assertSame( $rfc3339, date_i18n( DATE_RFC3339, 0 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_should_format_date() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -42,7 +42,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_should_use_custom_timestamp() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2012-12-01 00:00:00', date_i18n( 'Y-m-d H:i:s', strtotime( '2012-12-01 00:00:00' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2012-12-01 00:00:00', date_i18n( 'Y-m-d H:i:s', strtotime( '2012-12-01 00:00:00' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_date_should_be_in_gmt() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,7 +64,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_date_should_be_in_gmt_with_custom_timezone_setting_and_timestamp() {
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'timezone_string', 'America/Regina' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2012-12-01 00:00:00', date_i18n( 'Y-m-d H:i:s', strtotime( '2012-12-01 00:00:00' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2012-12-01 00:00:00', date_i18n( 'Y-m-d H:i:s', strtotime( '2012-12-01 00:00:00' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_adjusts_format_based_on_locale() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -87,13 +87,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Restore original locale.
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['wp_locale'] = $original_locale;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_adjusts_format_based_on_timezone_string() {
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'timezone_string', 'America/Regina' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2012-12-01 00:00:00 CST -06:00 America/Regina', date_i18n( 'Y-m-d H:i:s T P e', strtotime( '2012-12-01 00:00:00' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2012-12-01 00:00:00 CST -06:00 America/Regina', date_i18n( 'Y-m-d H:i:s T P e', strtotime( '2012-12-01 00:00:00' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,7 +110,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $datetime = new DateTime( 'now', $datetimezone );
</span><span class="cx" style="display: block; padding: 0 10px"> $datetime = new DateTime( $datetime->format( 'P' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $datetime->format( $timezone_formats ), date_i18n( $timezone_formats ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $datetime->format( $timezone_formats ), date_i18n( $timezone_formats ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -122,7 +122,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'timezone_string', 'America/Regina' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( strtotime( date_i18n( $full ) ), strtotime( date_i18n( $short ) ), 'The dates should be equal', 2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $short, date_i18n( '\\' . $short ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $short, date_i18n( '\\' . $short ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_formats() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,7 +150,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $wp_timestamp, date_i18n( 'U' ), 'The dates should be equal', 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $timestamp, date_i18n( 'U', false, true ), 'The dates should be equal', 2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $wp_timestamp, date_i18n( 'U', $wp_timestamp ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $wp_timestamp, date_i18n( 'U', $wp_timestamp ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -159,7 +159,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_swatch_internet_time_with_wp_timestamp() {
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'timezone_string', 'America/Regina' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( gmdate( 'B' ), date_i18n( 'B' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( gmdate( 'B' ), date_i18n( 'B' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -168,7 +168,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_should_handle_escaped_formats() {
</span><span class="cx" style="display: block; padding: 0 10px"> $format = 'D | \D | \\D | \\\D | \\\\D | \\\\\D | \\\\\\D';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( gmdate( $format ), date_i18n( $format ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( gmdate( $format ), date_i18n( $format ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -187,7 +187,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_timestamp = strtotime( $time );
</span><span class="cx" style="display: block; padding: 0 10px"> $format = 'I ' . DATE_RFC3339;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $datetime->format( $format ), date_i18n( $format, $wp_timestamp ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $datetime->format( $format ), date_i18n( $format, $wp_timestamp ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function dst_times() {
</span></span></pre></div>
<a id="trunktestsphpunittestsdategetCommentDatephp"></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/date/getCommentDate.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/date/getCommentDate.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/date/getCommentDate.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,7 +13,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_comment_date_returns_correct_time_with_comment_id() {
</span><span class="cx" style="display: block; padding: 0 10px"> $c = self::factory()->comment->create( array( 'comment_date' => '2020-08-29 01:51:00' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'August 29, 2020', get_comment_date( 'F j, Y', $c ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'August 29, 2020', get_comment_date( 'F j, Y', $c ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,8 +22,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_comment_date_returns_correct_time_with_empty_format() {
</span><span class="cx" style="display: block; padding: 0 10px"> $c = self::factory()->comment->create( array( 'comment_date' => '2020-08-29 01:51:00' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'August 29, 2020', get_comment_date( '', $c ) );
- $this->assertEquals( 'August 29, 2020', get_comment_date( false, $c ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'August 29, 2020', get_comment_date( '', $c ) );
+ $this->assertSame( 'August 29, 2020', get_comment_date( false, $c ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $c = self::factory()->comment->create( array( 'comment_date' => '2020-08-29 01:51:00' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['comment'] = get_comment( $c );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1:51 am', get_comment_time( 'g:i a' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1:51 am', get_comment_time( 'g:i a' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,7 +43,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $c = self::factory()->comment->create( array( 'comment_date' => '2020-08-29 01:51:00' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['comment'] = get_comment( $c );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1:51 am', get_comment_time( '' ) );
- $this->assertEquals( '1:51 am', get_comment_time( false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1:51 am', get_comment_time( '' ) );
+ $this->assertSame( '1:51 am', get_comment_time( false ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsdategetFeedBuildDatephp"></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/date/getFeedBuildDate.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/date/getFeedBuildDate.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/date/getFeedBuildDate.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -35,7 +35,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_query = new WP_Query( array( 'p' => $post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2018-07-23T03:13:23+00:00', get_feed_build_date( DATE_RFC3339 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2018-07-23T03:13:23+00:00', get_feed_build_date( DATE_RFC3339 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsdategetPermalinkphp"></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/date/getPermalink.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/date/getPermalink.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/date/getPermalink.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,10 +33,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://example.org/2018/07/22/21/13/23', get_permalink( $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://example.org/2018/07/22/21/13/23', get_permalink( $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set
</span><span class="cx" style="display: block; padding: 0 10px"> date_default_timezone_set( $timezone );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://example.org/2018/07/22/21/13/23', get_permalink( $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://example.org/2018/07/22/21/13/23', get_permalink( $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsdategetPostTimephp"></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/date/getPostTime.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/date/getPostTime.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/date/getPostTime.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,7 +13,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_post_time_returns_correct_time_with_post_id() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_date' => '2014-03-01 16:35:00' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '16:35:00', get_post_time( 'H:i:s', false, $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '16:35:00', get_post_time( 'H:i:s', false, $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,7 +32,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_post_modified_time_returns_correct_time_with_post_id() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_date' => '2014-03-01 16:35:00' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '16:35:00', get_post_modified_time( 'H:i:s', false, $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '16:35:00', get_post_modified_time( 'H:i:s', false, $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,14 +64,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $wp_timestamp, get_post_time( 'U', false, $post_id ) );
- $this->assertEquals( $wp_timestamp, get_post_time( 'G', false, $post_id ) );
- $this->assertEquals( $timestamp, get_post_time( 'U', true, $post_id ) );
- $this->assertEquals( $timestamp, get_post_time( 'G', true, $post_id ) );
- $this->assertEquals( $wp_timestamp, get_post_modified_time( 'U', false, $post_id ) );
- $this->assertEquals( $wp_timestamp, get_post_modified_time( 'G', false, $post_id ) );
- $this->assertEquals( $timestamp, get_post_modified_time( 'U', true, $post_id ) );
- $this->assertEquals( $timestamp, get_post_modified_time( 'G', true, $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $wp_timestamp, get_post_time( 'U', false, $post_id ) );
+ $this->assertSame( $wp_timestamp, get_post_time( 'G', false, $post_id ) );
+ $this->assertSame( $timestamp, get_post_time( 'U', true, $post_id ) );
+ $this->assertSame( $timestamp, get_post_time( 'G', true, $post_id ) );
+ $this->assertSame( $wp_timestamp, get_post_modified_time( 'U', false, $post_id ) );
+ $this->assertSame( $wp_timestamp, get_post_modified_time( 'G', false, $post_id ) );
+ $this->assertSame( $timestamp, get_post_modified_time( 'U', true, $post_id ) );
+ $this->assertSame( $timestamp, get_post_modified_time( 'G', true, $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,14 +92,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $rfc3339, get_post_time( DATE_RFC3339, false, $post_id ) );
- $this->assertEquals( $rfc3339_utc, get_post_time( DATE_RFC3339, true, $post_id ) );
- $this->assertEquals( $rfc3339, get_post_time( DATE_RFC3339, false, $post_id, true ) );
- $this->assertEquals( $rfc3339_utc, get_post_time( DATE_RFC3339, true, $post_id, true ) );
- $this->assertEquals( $rfc3339, get_post_modified_time( DATE_RFC3339, false, $post_id ) );
- $this->assertEquals( $rfc3339_utc, get_post_modified_time( DATE_RFC3339, true, $post_id ) );
- $this->assertEquals( $rfc3339, get_post_modified_time( DATE_RFC3339, false, $post_id, true ) );
- $this->assertEquals( $rfc3339_utc, get_post_modified_time( DATE_RFC3339, true, $post_id, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $rfc3339, get_post_time( DATE_RFC3339, false, $post_id ) );
+ $this->assertSame( $rfc3339_utc, get_post_time( DATE_RFC3339, true, $post_id ) );
+ $this->assertSame( $rfc3339, get_post_time( DATE_RFC3339, false, $post_id, true ) );
+ $this->assertSame( $rfc3339_utc, get_post_time( DATE_RFC3339, true, $post_id, true ) );
+ $this->assertSame( $rfc3339, get_post_modified_time( DATE_RFC3339, false, $post_id ) );
+ $this->assertSame( $rfc3339_utc, get_post_modified_time( DATE_RFC3339, true, $post_id ) );
+ $this->assertSame( $rfc3339, get_post_modified_time( DATE_RFC3339, false, $post_id, true ) );
+ $this->assertSame( $rfc3339_utc, get_post_modified_time( DATE_RFC3339, true, $post_id, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -121,7 +121,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'timezone_string', 'Europe/Kiev' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $rfc3339, get_post_time( DATE_RFC3339, true, $post_id ) );
- $this->assertEquals( $rfc3339, get_post_modified_time( DATE_RFC3339, true, $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $rfc3339, get_post_time( DATE_RFC3339, true, $post_id ) );
+ $this->assertSame( $rfc3339, get_post_modified_time( DATE_RFC3339, true, $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsdategetTheDatephp"></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/date/getTheDate.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/date/getTheDate.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/date/getTheDate.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,7 +13,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_the_date_returns_correct_time_with_post_id() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_date' => '2014-03-01 16:35:00' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'March 1, 2014', get_the_date( 'F j, Y', $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'March 1, 2014', get_the_date( 'F j, Y', $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,8 +32,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_the_date_returns_correct_time_with_empty_format() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_date' => '2020-08-29 01:51:00' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'August 29, 2020', get_the_date( '', $post_id ) );
- $this->assertEquals( 'August 29, 2020', get_the_date( false, $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'August 29, 2020', get_the_date( '', $post_id ) );
+ $this->assertSame( 'August 29, 2020', get_the_date( false, $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -42,7 +42,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_the_time_returns_correct_time_with_post_id() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_date' => '2014-03-01 16:35:00' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '16:35:00', get_the_time( 'H:i:s', $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '16:35:00', get_the_time( 'H:i:s', $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -61,7 +61,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_the_time_returns_correct_time_with_empty_format() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_date' => '2020-08-29 01:51:00' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1:51 am', get_the_time( '', $post_id ) );
- $this->assertEquals( '1:51 am', get_the_time( false, $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1:51 am', get_the_time( '', $post_id ) );
+ $this->assertSame( '1:51 am', get_the_time( false, $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsdategetTheModifiedDatephp"></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/date/getTheModifiedDate.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/date/getTheModifiedDate.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/date/getTheModifiedDate.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,7 +23,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $format = 'Y-m-d';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '2016-01-21';
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = get_the_modified_date( $format, $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,7 +46,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '2016-01-21';
</span><span class="cx" style="display: block; padding: 0 10px"> $format = 'Y-m-d';
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = get_the_modified_date( $format );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,7 +63,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = 'filtered modified date failure result';
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'get_the_modified_date', array( $this, '_filter_get_the_modified_date_failure' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = get_the_modified_date();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'get_the_modified_date', array( $this, '_filter_get_the_modified_date_failure' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,7 +70,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function _filter_get_the_modified_date_failure( $the_date ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = false;
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = $the_date;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false === $the_date ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return 'filtered modified date failure result';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -94,8 +94,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_the_modified_date_returns_correct_time_with_empty_format() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_date' => '2020-08-31 23:14:00' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'August 31, 2020', get_the_modified_date( '', $post_id ) );
- $this->assertEquals( 'August 31, 2020', get_the_modified_date( false, $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'August 31, 2020', get_the_modified_date( '', $post_id ) );
+ $this->assertSame( 'August 31, 2020', get_the_modified_date( false, $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -112,9 +112,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = $this->factory->post->create( $details );
</span><span class="cx" style="display: block; padding: 0 10px"> $format = 'G';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $expected = '1453390476';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $expected = 1453390476;
</ins><span class="cx" style="display: block; padding: 0 10px"> $actual = get_the_modified_time( $format, $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -134,10 +134,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['post'] = $post;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $expected = '1453390476';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $expected = 1453390476;
</ins><span class="cx" style="display: block; padding: 0 10px"> $format = 'G';
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = get_the_modified_time( $format );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -154,7 +154,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = 'filtered modified time failure result';
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'get_the_modified_time', array( $this, '_filter_get_the_modified_time_failure' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = get_the_modified_time();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'get_the_modified_time', array( $this, '_filter_get_the_modified_time_failure' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -161,7 +161,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function _filter_get_the_modified_time_failure( $the_time ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = false;
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = $the_time;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false === $the_time ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return 'filtered modified time failure result';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -185,7 +185,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_the_modified_time_returns_correct_time_with_empty_format() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_date' => '2020-08-31 23:14:00' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '11:14 pm', get_the_modified_time( '', $post_id ) );
- $this->assertEquals( '11:14 pm', get_the_modified_time( false, $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '11:14 pm', get_the_modified_time( '', $post_id ) );
+ $this->assertSame( '11:14 pm', get_the_modified_time( false, $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsdatemaybeDeclineDatephp"></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/date/maybeDeclineDate.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/date/maybeDeclineDate.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/date/maybeDeclineDate.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -57,7 +57,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'gettext_with_context', array( $this, 'filter__enable_months_names_declension' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $output, $declined_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $output, $declined_date );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function filter__enable_months_names_declension( $translation, $text, $context ) {
</span></span></pre></div>
<a id="trunktestsphpunittestsdatemysql2datephp"></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/date/mysql2date.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/date/mysql2date.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/date/mysql2date.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,8 +24,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 28310
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_mysql2date_returns_gmt_or_unix_timestamp() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '441013392', mysql2date( 'G', '1983-12-23 07:43:12' ) );
- $this->assertEquals( '441013392', mysql2date( 'U', '1983-12-23 07:43:12' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 441013392, mysql2date( 'G', '1983-12-23 07:43:12' ) );
+ $this->assertSame( 441013392, mysql2date( 'U', '1983-12-23 07:43:12' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,8 +38,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $rfc3339 = $datetime->format( DATE_RFC3339 );
</span><span class="cx" style="display: block; padding: 0 10px"> $mysql = $datetime->format( 'Y-m-d H:i:s' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $rfc3339, mysql2date( DATE_RFC3339, $mysql ) );
- $this->assertEquals( $rfc3339, mysql2date( DATE_RFC3339, $mysql, false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $rfc3339, mysql2date( DATE_RFC3339, $mysql ) );
+ $this->assertSame( $rfc3339, mysql2date( DATE_RFC3339, $mysql, false ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,8 +54,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $rfc3339 = $datetime->format( DATE_RFC3339 );
</span><span class="cx" style="display: block; padding: 0 10px"> $mysql = $datetime->format( 'Y-m-d H:i:s' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $rfc3339, mysql2date( DATE_RFC3339, $mysql ) );
- $this->assertEquals( $rfc3339, mysql2date( DATE_RFC3339, $mysql, false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $rfc3339, mysql2date( DATE_RFC3339, $mysql ) );
+ $this->assertSame( $rfc3339, mysql2date( DATE_RFC3339, $mysql, false ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,8 +68,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_timestamp = $datetime->getTimestamp() + $datetime->getOffset();
</span><span class="cx" style="display: block; padding: 0 10px"> $mysql = $datetime->format( 'Y-m-d H:i:s' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $wp_timestamp, mysql2date( 'U', $mysql, false ) );
- $this->assertEquals( $wp_timestamp, mysql2date( 'G', $mysql, false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $wp_timestamp, mysql2date( 'U', $mysql, false ) );
+ $this->assertSame( $wp_timestamp, mysql2date( 'G', $mysql, false ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -82,7 +82,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $timestamp = $datetime->getTimestamp();
</span><span class="cx" style="display: block; padding: 0 10px"> $mysql = $datetime->format( 'Y-m-d H:i:s' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $timestamp, mysql2date( 'U', $mysql, false ) );
- $this->assertEquals( $timestamp, mysql2date( 'G', $mysql, false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $timestamp, mysql2date( 'U', $mysql, false ) );
+ $this->assertSame( $timestamp, mysql2date( 'G', $mysql, false ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsdatequeryphp"></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/date/query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/date/query.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/date/query.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,7 +110,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'relation' => 'AND',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $q->queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $q->queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_compare_empty() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1078,7 +1078,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p2 ), $q->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p2 ), $q->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1100,7 +1100,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p2 ), $q->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p2 ), $q->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1124,7 +1124,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // MySQL ignores the invalid clause.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1, $p2 ), $q->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1, $p2 ), $q->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** Helpers */
</span></span></pre></div>
<a id="trunktestsphpunittestsdatetheDatephp"></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/date/theDate.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/date/theDate.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/date/theDate.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -61,20 +61,20 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> ob_end_clean();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->hooks_called['the_time'] );
- $this->assertEquals( 2, $this->hooks_called['get_the_time'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->hooks_called['the_time'] );
+ $this->assertSame( 2, $this->hooks_called['get_the_time'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->hooks_called['the_modified_time'] );
- $this->assertEquals( 2, $this->hooks_called['get_the_modified_time'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->hooks_called['the_modified_time'] );
+ $this->assertSame( 2, $this->hooks_called['get_the_modified_time'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->hooks_called['the_date'] );
- $this->assertEquals( 2, $this->hooks_called['get_the_date'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->hooks_called['the_date'] );
+ $this->assertSame( 2, $this->hooks_called['get_the_date'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->hooks_called['the_modified_date'] );
- $this->assertEquals( 2, $this->hooks_called['get_the_modified_date'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->hooks_called['the_modified_date'] );
+ $this->assertSame( 2, $this->hooks_called['get_the_modified_date'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 5, $this->hooks_called['get_post_time'] );
- $this->assertEquals( 5, $this->hooks_called['get_post_modified_time'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 5, $this->hooks_called['get_post_time'] );
+ $this->assertSame( 5, $this->hooks_called['get_post_modified_time'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function count_hook( $input ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,7 +90,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> the_date();
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = ob_get_clean();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $actual );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['post'] = self::factory()->post->create_and_get(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -102,25 +102,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['currentday'] = '18.09.15';
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['previousday'] = '17.09.15';
</span><span class="cx" style="display: block; padding: 0 10px"> the_date();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'September 16, 2015', ob_get_clean() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'September 16, 2015', ob_get_clean() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['currentday'] = '18.09.15';
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['previousday'] = '17.09.15';
</span><span class="cx" style="display: block; padding: 0 10px"> the_date( 'Y' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2015', ob_get_clean() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2015', ob_get_clean() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['currentday'] = '18.09.15';
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['previousday'] = '17.09.15';
</span><span class="cx" style="display: block; padding: 0 10px"> the_date( 'Y', 'before ', ' after' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'before 2015 after', ob_get_clean() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'before 2015 after', ob_get_clean() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['currentday'] = '18.09.15';
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['previousday'] = '17.09.15';
</span><span class="cx" style="display: block; padding: 0 10px"> the_date( 'Y', 'before ', ' after', false );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', ob_get_clean() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', ob_get_clean() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,7 +130,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> the_weekday_date();
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = ob_get_clean();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $actual );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['post'] = self::factory()->post->create_and_get(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -142,12 +142,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['currentday'] = '18.09.15';
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['previousweekday'] = '17.09.15';
</span><span class="cx" style="display: block; padding: 0 10px"> the_weekday_date();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Wednesday', ob_get_clean() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Wednesday', ob_get_clean() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['currentday'] = '18.09.15';
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['previousweekday'] = '17.09.15';
</span><span class="cx" style="display: block; padding: 0 10px"> the_weekday_date( 'before ', ' after' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'before Wednesday after', ob_get_clean() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'before Wednesday after', ob_get_clean() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsdatewpDatephp"></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/date/wpDate.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/date/wpDate.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/date/wpDate.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,7 +43,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $utc = new DateTimeZone( 'UTC' );
</span><span class="cx" style="display: block; padding: 0 10px"> $datetime = new DateTimeImmutable( '2019-10-17', $utc );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '10月', wp_date( 'F', $datetime->getTimestamp(), $utc ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '10月', wp_date( 'F', $datetime->getTimestamp(), $utc ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -58,6 +58,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $utc = new DateTimeZone( 'UTC' );
</span><span class="cx" style="display: block; padding: 0 10px"> $datetime = new DateTimeImmutable( '2019-10-17', $utc );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $string, wp_date( 'F', $datetime->getTimestamp(), $utc ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $string, wp_date( 'F', $datetime->getTimestamp(), $utc ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsdatewpTimezonephp"></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/date/wpTimezone.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/date/wpTimezone.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/date/wpTimezone.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -18,11 +18,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> delete_option( 'timezone_string' );
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'gmt_offset', $gmt_offset );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $tz_name, wp_timezone_string() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $tz_name, wp_timezone_string() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $timezone = wp_timezone();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $tz_name, $timezone->getName() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $tz_name, $timezone->getName() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,11 +31,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_should_return_timezone_string() {
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'timezone_string', 'Europe/Kiev' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Europe/Kiev', wp_timezone_string() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Europe/Kiev', wp_timezone_string() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $timezone = wp_timezone();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Europe/Kiev', $timezone->getName() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Europe/Kiev', $timezone->getName() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsdatexmlrpcphp"></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/date/xmlrpc.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/date/xmlrpc.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/date/xmlrpc.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,7 +34,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $datetime->format( 'Y-m-d H:i:s' ),
</span><span class="cx" style="display: block; padding: 0 10px"> $post->post_date,
</span><span class="cx" style="display: block; padding: 0 10px"> 'UTC time with explicit time zone into mw_newPost'
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,7 +55,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $datetime->format( 'Y-m-d H:i:s' ),
</span><span class="cx" style="display: block; padding: 0 10px"> $post->post_date,
</span><span class="cx" style="display: block; padding: 0 10px"> 'Local time w/o time zone into mw_newPost'
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,7 +76,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $datetime->format( 'Y-m-d H:i:s' ),
</span><span class="cx" style="display: block; padding: 0 10px"> $post->post_date,
</span><span class="cx" style="display: block; padding: 0 10px"> 'UTC time into mw_newPost'
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -97,7 +97,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $datetime->format( 'Y-m-d H:i:s' ),
</span><span class="cx" style="display: block; padding: 0 10px"> $post->post_date,
</span><span class="cx" style="display: block; padding: 0 10px"> 'Local time into wp_newPost'
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -118,7 +118,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $datetime->format( 'Y-m-d H:i:s' ),
</span><span class="cx" style="display: block; padding: 0 10px"> $post->post_date,
</span><span class="cx" style="display: block; padding: 0 10px"> 'UTC time into wp_newPost'
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -158,7 +158,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $fetched_post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $datetime->format( 'Y-m-d H:i:s' ),
</span><span class="cx" style="display: block; padding: 0 10px"> $fetched_post->post_date,
</span><span class="cx" style="display: block; padding: 0 10px"> 'Local time into mw_editPost'
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -185,7 +185,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $fetched_post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $datetime->format( 'Y-m-d H:i:s' ),
</span><span class="cx" style="display: block; padding: 0 10px"> $fetched_post->post_date,
</span><span class="cx" style="display: block; padding: 0 10px"> 'UTC time into mw_editPost'
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -231,7 +231,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $fetched_comment = get_comment( $comment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $datetime->format( 'Y-m-d H:i:s' ),
</span><span class="cx" style="display: block; padding: 0 10px"> $fetched_comment->comment_date,
</span><span class="cx" style="display: block; padding: 0 10px"> 'UTC time into wp_editComment'
</span></span></pre></div>
<a id="trunktestsphpunittestsdbcharsetphp"></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/db/charset.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/db/charset.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/db/charset.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -416,7 +416,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $conv_utf8 = mb_convert_encoding( $big5, 'UTF-8', 'BIG-5' );
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure PHP's multibyte conversions are working correctly.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $utf8, $big5 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $utf8, $conv_utf8 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $utf8, $conv_utf8 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $fields['big5'] = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'charset' => 'big5',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -647,7 +647,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $value = "H€llo\xe0\x80\x80World\xf0\xff\xff\xff¢";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = 'H€lloWorld¢';
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = $wpdb->strip_invalid_text_for_column( $wpdb->posts, 'post_content', $value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -754,10 +754,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> self::$_wpdb->query( $create );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $charset = self::$_wpdb->get_table_charset( $table );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $charset, $expected_charset );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $charset, $expected_charset );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $charset = self::$_wpdb->get_table_charset( strtoupper( $table ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $charset, $expected_charset );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $charset, $expected_charset );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> self::$_wpdb->query( $drop );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -794,8 +794,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> self::$_wpdb->query( $create );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $expected_charset as $column => $charset ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $charset, self::$_wpdb->get_col_charset( $table, $column ) );
- $this->assertEquals( $charset, self::$_wpdb->get_col_charset( strtoupper( $table ), strtoupper( $column ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $charset, self::$_wpdb->get_col_charset( $table, $column ) );
+ $this->assertSame( $charset, self::$_wpdb->get_col_charset( strtoupper( $table ), strtoupper( $column ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> self::$_wpdb->query( $drop );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -819,7 +819,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $columns = array_keys( $columns );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $columns as $column => $charset ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, self::$_wpdb->get_col_charset( $table, $column ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( self::$_wpdb->get_col_charset( $table, $column ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> self::$_wpdb->query( $drop );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -845,7 +845,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $columns = array_keys( $columns );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $columns as $column => $charset ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, self::$_wpdb->get_col_charset( $table, $column ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( self::$_wpdb->get_col_charset( $table, $column ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> self::$_wpdb->query( $drop );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -901,7 +901,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> self::$_wpdb->query( $create );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $return = self::$_wpdb->strip_invalid_text_from_query( $query );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $return );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $return );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> self::$_wpdb->query( $drop );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -935,7 +935,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_dont_strip_text_from_schema_queries( $query ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $return = self::$_wpdb->strip_invalid_text_from_query( $query );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $query, $return );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $query, $return );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1017,7 +1017,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> self::$_wpdb->query( $create );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $return = self::$_wpdb->check_safe_collation( $query );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $return );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $return );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $always_true as $true_query ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $return = self::$_wpdb->check_safe_collation( $true_query );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1032,11 +1032,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // TEXT column.
</span><span class="cx" style="display: block; padding: 0 10px"> $stripped = $wpdb->strip_invalid_text_for_column( $wpdb->comments, 'comment_content', str_repeat( 'A', 65536 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 65535, strlen( $stripped ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 65535, strlen( $stripped ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // VARCHAR column.
</span><span class="cx" style="display: block; padding: 0 10px"> $stripped = $wpdb->strip_invalid_text_for_column( $wpdb->comments, 'comment_agent', str_repeat( 'A', 256 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 255, strlen( $stripped ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 255, strlen( $stripped ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1053,7 +1053,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> self::$_wpdb->query( "DROP TABLE $tablename" );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $safe_query, $stripped_query );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $safe_query, $stripped_query );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1075,7 +1075,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> self::$_wpdb->charset = $charset;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $safe_query, $stripped_query );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $safe_query, $stripped_query );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1084,11 +1084,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_set_charset_changes_the_connection_collation() {
</span><span class="cx" style="display: block; padding: 0 10px"> self::$_wpdb->set_charset( self::$_wpdb->dbh, 'utf8', 'utf8_general_ci' );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = self::$_wpdb->get_results( "SHOW VARIABLES WHERE Variable_name='collation_connection'" );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'utf8_general_ci', $results[0]->Value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'utf8_general_ci', $results[0]->Value );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> self::$_wpdb->set_charset( self::$_wpdb->dbh, 'utf8mb4', 'utf8mb4_unicode_ci' );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = self::$_wpdb->get_results( "SHOW VARIABLES WHERE Variable_name='collation_connection'" );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'utf8mb4_unicode_ci', $results[0]->Value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'utf8mb4_unicode_ci', $results[0]->Value );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> self::$_wpdb->set_charset( self::$_wpdb->dbh );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsdbphp"></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/db.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/db.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/db.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -148,7 +148,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $inputs as $key => $input ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected[ $key ], $wpdb->esc_like( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected[ $key ], $wpdb->esc_like( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -167,7 +167,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_like_query( $data, $like, $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $result, $wpdb->get_var( $wpdb->prepare( 'SELECT %s LIKE %s', $data, $wpdb->esc_like( $like ) ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $result, $wpdb->get_var( $wpdb->prepare( 'SELECT %s LIKE %s', $data, $wpdb->esc_like( $like ) ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_like_query() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -253,7 +253,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $wpdb->col_meta = $new_meta;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $col_meta, $new_meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $col_meta, $wpdb->col_meta );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $col_meta, $wpdb->col_meta );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -281,7 +281,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $wpdb->placeholder_escape(), $sql );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $sql = $wpdb->remove_placeholder_escape( $sql );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "UPDATE test_table SET string_column = '%f is a float, %d is an int 3, %s is a string', field = '4'", $sql );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "UPDATE test_table SET string_column = '%f is a float, %d is an int 3, %s is a string', field = '4'", $sql );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -367,7 +367,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // This, obviously, is an incorrect prepare.
</span><span class="cx" style="display: block; padding: 0 10px"> // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
</span><span class="cx" style="display: block; padding: 0 10px"> $prepared = $wpdb->prepare( "SELECT * FROM $wpdb->users WHERE id = $id", $id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "SELECT * FROM $wpdb->users WHERE id = 0", $prepared );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "SELECT * FROM $wpdb->users WHERE id = 0", $prepared );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_prepare_sprintf() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -374,7 +374,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $prepared = $wpdb->prepare( "SELECT * FROM $wpdb->users WHERE id = %d AND user_login = %s", 1, 'admin' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "SELECT * FROM $wpdb->users WHERE id = 1 AND user_login = 'admin'", $prepared );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "SELECT * FROM $wpdb->users WHERE id = 1 AND user_login = 'admin'", $prepared );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -385,11 +385,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
</span><span class="cx" style="display: block; padding: 0 10px"> $prepared = @$wpdb->prepare( "SELECT * FROM $wpdb->users WHERE id = %d AND user_login = %s", 1, array( 'admin' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "SELECT * FROM $wpdb->users WHERE id = 1 AND user_login = ''", $prepared );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "SELECT * FROM $wpdb->users WHERE id = 1 AND user_login = ''", $prepared );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
</span><span class="cx" style="display: block; padding: 0 10px"> $prepared = @$wpdb->prepare( "SELECT * FROM $wpdb->users WHERE id = %d AND user_login = %s", array( 1 ), 'admin' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "SELECT * FROM $wpdb->users WHERE id = 0 AND user_login = 'admin'", $prepared );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "SELECT * FROM $wpdb->users WHERE id = 0 AND user_login = 'admin'", $prepared );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_prepare_vsprintf() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -396,7 +396,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $prepared = $wpdb->prepare( "SELECT * FROM $wpdb->users WHERE id = %d AND user_login = %s", array( 1, 'admin' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "SELECT * FROM $wpdb->users WHERE id = 1 AND user_login = 'admin'", $prepared );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "SELECT * FROM $wpdb->users WHERE id = 1 AND user_login = 'admin'", $prepared );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -407,11 +407,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
</span><span class="cx" style="display: block; padding: 0 10px"> $prepared = @$wpdb->prepare( "SELECT * FROM $wpdb->users WHERE id = %d AND user_login = %s", array( 1, array( 'admin' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "SELECT * FROM $wpdb->users WHERE id = 1 AND user_login = ''", $prepared );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "SELECT * FROM $wpdb->users WHERE id = 1 AND user_login = ''", $prepared );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
</span><span class="cx" style="display: block; padding: 0 10px"> $prepared = @$wpdb->prepare( "SELECT * FROM $wpdb->users WHERE id = %d AND user_login = %s", array( array( 1 ), 'admin' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "SELECT * FROM $wpdb->users WHERE id = 0 AND user_login = 'admin'", $prepared );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "SELECT * FROM $wpdb->users WHERE id = 0 AND user_login = 'admin'", $prepared );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -490,7 +490,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $str = $wpdb->get_caller();
</span><span class="cx" style="display: block; padding: 0 10px"> $calls = explode( ', ', $str );
</span><span class="cx" style="display: block; padding: 0 10px"> $called = join( '->', array( __CLASS__, __FUNCTION__ ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $called, end( $calls ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $called, end( $calls ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_has_cap() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -501,11 +501,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $wpdb->has_cap( 'COLLATION' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $wpdb->has_cap( 'GROUP_CONCAT' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $wpdb->has_cap( 'SUBQUERIES' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> version_compare( $wpdb->db_version(), '5.0.7', '>=' ),
</span><span class="cx" style="display: block; padding: 0 10px"> $wpdb->has_cap( 'set_charset' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> version_compare( $wpdb->db_version(), '5.0.7', '>=' ),
</span><span class="cx" style="display: block; padding: 0 10px"> $wpdb->has_cap( 'SET_CHARSET' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -548,29 +548,29 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wpdb->get_results( "SELECT ID FROM $wpdb->users" );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'ID' ), $wpdb->get_col_info() );
- $this->assertEquals( array( $wpdb->users ), $wpdb->get_col_info( 'table' ) );
- $this->assertEquals( $wpdb->users, $wpdb->get_col_info( 'table', 0 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'ID' ), $wpdb->get_col_info() );
+ $this->assertSame( array( $wpdb->users ), $wpdb->get_col_info( 'table' ) );
+ $this->assertSame( $wpdb->users, $wpdb->get_col_info( 'table', 0 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_query_and_delete() {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px"> $rows = $wpdb->query( "INSERT INTO $wpdb->users (display_name) VALUES ('Walter Sobchak')" );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $rows );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $rows );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $wpdb->insert_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $d_rows = $wpdb->delete( $wpdb->users, array( 'ID' => $wpdb->insert_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $d_rows );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $d_rows );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_row() {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px"> $rows = $wpdb->query( "INSERT INTO $wpdb->users (display_name) VALUES ('Walter Sobchak')" );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $rows );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $rows );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $wpdb->insert_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->users WHERE ID = %d", $wpdb->insert_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'object', $row );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Walter Sobchak', $row->display_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Walter Sobchak', $row->display_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -667,7 +667,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replace() {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px"> $rows1 = $wpdb->insert( $wpdb->users, array( 'display_name' => 'Walter Sobchak' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $rows1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $rows1 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $wpdb->insert_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $last = $wpdb->insert_id;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -678,13 +678,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'display_name' => 'Walter Replace Sobchak',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $rows2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $rows2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $wpdb->insert_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $last, $wpdb->insert_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $last, $wpdb->insert_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->users WHERE ID = %d", $last ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Walter Replace Sobchak', $row->display_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Walter Replace Sobchak', $row->display_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -699,13 +699,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected1 = "UPDATE `{$wpdb->posts}` SET `post_name` = 'burrito' WHERE ";
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $wpdb->last_error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected1, $wpdb->last_query );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected1, $wpdb->last_query );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wpdb->update( $wpdb->posts, array( 'post_name' => 'burrito' ), array( 'post_status' => 'taco' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected2 = "UPDATE `{$wpdb->posts}` SET `post_name` = 'burrito' WHERE `post_status` = 'taco'";
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $wpdb->last_error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected2, $wpdb->last_query );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected2, $wpdb->last_query );
</ins><span class="cx" style="display: block; padding: 0 10px"> $wpdb->suppress_errors( $suppress );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -875,7 +875,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 21212
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_table_from_query( $query, $table ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $table, self::$_wpdb->get_table_from_query( $query ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $table, self::$_wpdb->get_table_from_query( $query ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_get_table_from_query_false() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -917,7 +917,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 38751
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_escaped_table_from_show_query( $query, $table ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $table, self::$_wpdb->get_table_from_query( $query ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $table, self::$_wpdb->get_table_from_query( $query ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1084,7 +1084,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $charset = self::$_wpdb->get_table_charset( 'some_table' );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_get_table_charset', array( $this, 'filter_pre_get_table_charset' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $charset, 'fake_charset' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $charset, 'fake_charset' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> function filter_pre_get_table_charset( $charset, $table ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return 'fake_charset';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1098,7 +1098,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $charset = self::$_wpdb->get_col_charset( 'some_table', 'some_col' );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_get_col_charset', array( $this, 'filter_pre_get_col_charset' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $charset, 'fake_col_charset' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $charset, 'fake_col_charset' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> function filter_pre_get_col_charset( $charset, $table, $column ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return 'fake_col_charset';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1366,7 +1366,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // phpcs:ignore WordPress.DB.PreparedSQL
</span><span class="cx" style="display: block; padding: 0 10px"> $sql = $wpdb->prepare( $sql, ...$values );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $sql );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $sql );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1385,7 +1385,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // phpcs:ignore WordPress.DB.PreparedSQL
</span><span class="cx" style="display: block; padding: 0 10px"> $sql = $wpdb->prepare( $sql, $values );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $sql );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $sql );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_prepare_with_placeholders() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1580,7 +1580,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = $wpdb->prepare( $sql, $values );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_escape_and_prepare() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1668,7 +1668,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $wpdb->query( "DROP TABLE {$wpdb->prefix}test_placeholder" );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( '%s', $sql );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_esc_sql_with_unsupported_placeholder_type() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1678,7 +1678,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
</span><span class="cx" style="display: block; padding: 0 10px"> $sql = $wpdb->prepare( " $sql %s ", 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( " 'foo' {$wpdb->placeholder_escape()}1\$c 'foo' ", $sql );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( " 'foo' {$wpdb->placeholder_escape()}1\$c 'foo' ", $sql );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsdbdeltaphp"></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/dbdelta.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/dbdelta.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/dbdelta.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -116,9 +116,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "{$wpdb->prefix}dbdelta_create_test" => "Created table {$wpdb->prefix}dbdelta_create_test",
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $updates );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $updates );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> "{$wpdb->prefix}dbdelta_create_test",
</span><span class="cx" style="display: block; padding: 0 10px"> $wpdb->get_var(
</span><span class="cx" style="display: block; padding: 0 10px"> $wpdb->prepare(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,7 +150,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $updates );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $updates );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -173,7 +173,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> "{$wpdb->prefix}dbdelta_test.id"
</span><span class="cx" style="display: block; padding: 0 10px"> => "Changed type of {$wpdb->prefix}dbdelta_test.id from bigint{$this->bigint_display_width} to int(11)",
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -202,7 +202,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> "{$wpdb->prefix}dbdelta_test.extra_col"
</span><span class="cx" style="display: block; padding: 0 10px"> => "Added column {$wpdb->prefix}dbdelta_test.extra_col",
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -235,7 +235,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $updates );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $updates );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTableHasColumn( 'column_1', $wpdb->prefix . 'dbdelta_test' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -262,7 +262,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> false // Don't execute.
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> "{$wpdb->prefix}dbdelta_test.extra_col"
</span><span class="cx" style="display: block; padding: 0 10px"> => "Added column {$wpdb->prefix}dbdelta_test.extra_col",
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -283,7 +283,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "INSERT INTO {$wpdb->prefix}dbdelta_test (column_1) VALUES ('wcphilly2015')"
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(),
</span><span class="cx" style="display: block; padding: 0 10px"> $insert
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span></span></pre></div>
<a id="trunktestsphpunittestsdependenciesjqueryphp"></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/dependencies/jquery.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/dependencies/jquery.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/dependencies/jquery.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,7 +31,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $o = $scripts->query( $dep, 'registered' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( '_WP_Dependency', $object );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $jquery_scripts[ $dep ] ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $jquery_scripts[ $dep ], $o->src );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $jquery_scripts[ $dep ], $o->src );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,7 +40,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = trim( file_get_contents( ABSPATH . WPINC . '/js/jquery/jquery.js' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $noconflict = 'jQuery.noConflict();';
</span><span class="cx" style="display: block; padding: 0 10px"> $end = substr( $contents, - strlen( $noconflict ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $noconflict, $end );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $noconflict, $end );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsdependenciesscriptsphp"></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/dependencies/scripts.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/dependencies/scripts.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/dependencies/scripts.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,10 +51,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='http://example.com?ver=1.2' id='empty-deps-version-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='http://example.com' id='empty-deps-null-version-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // No scripts left to print.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,7 +71,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $ver = get_bloginfo( 'version' );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = "<script src='http://example.com?ver=$ver' id='empty-deps-no-version-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,10 +110,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='{$wp_scripts->base_url}ftp://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js?ver=$ver' id='jquery-ftp-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Go!
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // No scripts left to print.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Cleanup.
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_scripts->base_url = $base_url_backup;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -138,7 +138,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $ver = get_bloginfo( 'version' );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = "<script type='text/javascript' src='/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=one,two,three&ver={$ver}'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $print_scripts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $print_scripts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -154,10 +154,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='http://example.com' id='test-only-data-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Go!
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // No scripts left to print.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -172,10 +172,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = "<!--[if gt IE 7]>\n<script type='text/javascript' src='http://example.com' id='test-only-conditional-js'></script>\n<![endif]-->\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Go!
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // No scripts left to print.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -192,10 +192,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<!--[if lt IE 9]>\n<script type='text/javascript' src='http://example.com' id='test-conditional-with-data-js'></script>\n<![endif]-->\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Go!
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // No scripts left to print.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -210,10 +210,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = "<script type='text/javascript' src='http://example.com' id='test-invalid-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Go!
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // No scripts left to print.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -239,7 +239,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'handle-three' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -323,8 +323,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_header .= "<script type='text/javascript' src='/child-head.js' id='child-head-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_footer = "<script type='text/javascript' src='/parent.js' id='parent-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_header, $header );
- $this->assertEquals( $expected_footer, $footer );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_header, $header );
+ $this->assertSame( $expected_footer, $footer );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -344,8 +344,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_footer = "<script type='text/javascript' src='/child-footer.js' id='child-footer-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_footer .= "<script type='text/javascript' src='/parent.js' id='parent-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_header, $header );
- $this->assertEquals( $expected_footer, $footer );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_header, $header );
+ $this->assertSame( $expected_footer, $footer );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -375,8 +375,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_footer .= "<script type='text/javascript' src='/child2-footer.js' id='child2-footer-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_footer .= "<script type='text/javascript' src='/parent-footer.js' id='parent-footer-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_header, $header );
- $this->assertEquals( $expected_footer, $footer );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_header, $header );
+ $this->assertSame( $expected_footer, $footer );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -393,7 +393,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_add_inline_script_unknown_handle() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wp_add_inline_script( 'test-invalid', 'console.log("before");', 'before' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -406,7 +406,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = "<script type='text/javascript' id='test-example-js-before'>\nconsole.log(\"before\");\n</script>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='http://example.com' id='test-example-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -419,7 +419,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = "<script type='text/javascript' src='http://example.com' id='test-example-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' id='test-example-js-after'>\nconsole.log(\"after\");\n</script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -434,7 +434,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='http://example.com' id='test-example-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' id='test-example-js-after'>\nconsole.log(\"after\");\n</script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -447,7 +447,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = "<script type='text/javascript' id='test-example-js-before'>\nconsole.log(\"before\");\n</script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -460,7 +460,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = "<script type='text/javascript' id='test-example-js-after'>\nconsole.log(\"after\");\n</script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -475,7 +475,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = "<script type='text/javascript' id='test-example-js-before'>\nconsole.log(\"before\");\n</script>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' id='test-example-js-after'>\nconsole.log(\"after\");\n</script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -492,7 +492,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='http://example.com' id='test-example-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' id='test-example-js-after'>\nconsole.log(\"after\");\nconsole.log(\"after\");\n</script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -509,7 +509,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='http://example.com' id='test-example-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' id='test-example-js-after'>\nconsole.log(\"after\");\n</script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -535,7 +535,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='/directory/two.js?ver={$ver}' id='two-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='/directory/three.js?ver={$ver}' id='three-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -559,7 +559,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='/directory/two.js?ver={$ver}' id='two-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='/directory/three.js?ver={$ver}' id='three-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -587,7 +587,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' id='three-js-after'>\nconsole.log(\"after three\");\n</script>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='/directory/four.js?ver={$ver}' id='four-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -615,8 +615,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_add_inline_script( 'test-example', 'console.log("after");' );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_script_add_data( 'test-example', 'conditional', 'gte IE 9' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_localized, get_echo( 'wp_print_scripts' ) );
- $this->assertEquals( $expected, $wp_scripts->print_html );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_localized, get_echo( 'wp_print_scripts' ) );
+ $this->assertSame( $expected, $wp_scripts->print_html );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $wp_scripts->do_concat );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -642,7 +642,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_print_scripts();
</span><span class="cx" style="display: block; padding: 0 10px"> $print_scripts = get_echo( '_print_scripts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $print_scripts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $print_scripts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -670,7 +670,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_print_scripts();
</span><span class="cx" style="display: block; padding: 0 10px"> $print_scripts = get_echo( '_print_scripts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $print_scripts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $print_scripts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -696,7 +696,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_print_scripts();
</span><span class="cx" style="display: block; padding: 0 10px"> $print_scripts = get_echo( '_print_scripts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $print_scripts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $print_scripts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -752,7 +752,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $print_scripts // Printed scripts.
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, $print_scripts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, $print_scripts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -780,7 +780,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $print_scripts .= get_echo( '_print_scripts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $tail = substr( $print_scripts, strrpos( $print_scripts, "<script type='text/javascript' src='/customize-dependency.js' id='customize-dependency-js'>" ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_tail, $tail );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_tail, $tail );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -805,7 +805,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='/wp-includes/js/script3.js?ver={$ver}' id='three-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='/wp-includes/js/script4.js?ver={$ver}' id='four-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -829,7 +829,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='/wp-includes/js/script3.js?ver={$ver}' id='three-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='/wp-includes/js/script4.js?ver={$ver}' id='four-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -856,7 +856,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='/wp-includes/js/script.js' id='test-example-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -883,7 +883,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='/wp-content/plugins/my-plugin/js/script.js' id='plugin-example-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -910,7 +910,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='/wp-content/themes/my-theme/js/script.js' id='theme-example-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -937,7 +937,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='/wp-admin/js/script.js' id='script-handle-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -979,7 +979,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='/wp-admin/js/script.js' id='test-example-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1008,7 +1008,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='/wp-includes/js/script.js' id='test-example-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1038,7 +1038,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='/wp-includes/js/script.js' id='test-dependency-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='/wp-includes/js/script2.js' id='test-example-js'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, get_echo( 'wp_print_scripts' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, get_echo( 'wp_print_scripts' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsdependenciesstylesphp"></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/dependencies/styles.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/dependencies/styles.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/dependencies/styles.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,10 +63,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<link rel='stylesheet' id='no-deps-null-version-css' href='http://example.com' type='text/css' media='all' />\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<link rel='stylesheet' id='no-deps-null-version-print-media-css' href='http://example.com' type='text/css' media='print' />\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_styles' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_styles' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // No styles left to print.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_echo( 'wp_print_styles' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_echo( 'wp_print_styles' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,7 +83,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $ver = get_bloginfo( 'version' );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = "<link rel='stylesheet' id='no-deps-no-version-css' href='http://example.com?ver=$ver' media='all' />\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_styles' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_styles' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -122,10 +122,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<link rel='stylesheet' id='reset-css-ftp-css' href='{$wp_styles->base_url}ftp://yui.yahooapis.com/2.8.1/build/reset/reset-min.css?ver=$ver' type='text/css' media='all' />\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Go!
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_styles' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_styles' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // No styles left to print.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_echo( 'wp_print_styles' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_echo( 'wp_print_styles' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Cleanup.
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_styles->base_url = $base_url_backup;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -151,7 +151,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_add_inline_style( 'handle', $style );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // No styles left to print.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_styles' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_styles' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -180,7 +180,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_add_inline_style( 'handle', $style );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_print_styles();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $wp_styles->print_html );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $wp_styles->print_html );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -210,7 +210,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_add_inline_style( 'handle', $style2 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // No styles left to print.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_styles' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_styles' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -235,7 +235,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_add_inline_style( 'handle', $style );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_styles' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_styles' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -250,7 +250,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_style( 'handle', 'http://example.com', array(), 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_styles' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_styles' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -272,7 +272,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_style_add_data( 'handle', 'conditional', 'IE' );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_add_inline_style( 'handle', 'a { color: blue; }' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, get_echo( 'wp_print_styles' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, get_echo( 'wp_print_styles' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -304,7 +304,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_style( 'handle-three' );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_add_inline_style( 'handle-three', $style );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_print_styles' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_print_styles' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsdependenciesphp"></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/dependencies.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/dependencies.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/dependencies.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,12 +76,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $dep->enqueue( 'one?arg' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $dep->query( 'one', 'queue' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $dep->query( 'two', 'queue' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'arg', $dep->args['one'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'arg', $dep->args['one'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $dep->enqueue( 'two?arg' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $dep->query( 'one', 'queue' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $dep->query( 'two', 'queue' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'arg', $dep->args['two'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'arg', $dep->args['two'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_dequeue_args() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -94,8 +94,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $dep->enqueue( 'two?arg' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $dep->query( 'one', 'queue' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $dep->query( 'two', 'queue' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'arg', $dep->args['one'] );
- $this->assertEquals( 'arg', $dep->args['two'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'arg', $dep->args['one'] );
+ $this->assertSame( 'arg', $dep->args['two'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $dep->dequeue( 'one' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $dep->query( 'one', 'queue' ) );
</span></span></pre></div>
<a id="trunktestsphpunittestserrorprotectionrecoverymodecookieservicephp"></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/error-protection/recovery-mode-cookie-service.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/error-protection/recovery-mode-cookie-service.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/error-protection/recovery-mode-cookie-service.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,15 +14,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $service->validate_cookie( 'gibbersih' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_format', $error->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_format', $error->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $service->validate_cookie( base64_encode( 'test|data|format' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_format', $error->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_format', $error->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $service->validate_cookie( base64_encode( 'test|data|format|to|long' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_format', $error->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_format', $error->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,7 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $service->validate_cookie( $cookie );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'expired', $error->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'expired', $error->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,7 +55,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $service->validate_cookie( $cookie );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'signature_mismatch', $error->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'signature_mismatch', $error->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,7 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $service->validate_cookie( $cookie );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_created_at', $error->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_created_at', $error->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestserrorprotectionrecoverymodekeyservicephp"></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/error-protection/recovery-mode-key-service.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/error-protection/recovery-mode-key-service.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/error-protection/recovery-mode-key-service.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,7 +24,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $service->validate_recovery_mode_key( '', 'abcd', HOUR_IN_SECONDS );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'token_not_found', $error->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'token_not_found', $error->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,7 +37,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $service->validate_recovery_mode_key( '', 'abcd', HOUR_IN_SECONDS );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'token_not_found', $error->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'token_not_found', $error->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -50,7 +50,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $service->validate_recovery_mode_key( 'token', 'abcd', HOUR_IN_SECONDS );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_recovery_key_format', $error->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_recovery_key_format', $error->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -66,7 +66,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $service->validate_recovery_mode_key( $token, 'abcd', HOUR_IN_SECONDS );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_recovery_key_format', $error->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_recovery_key_format', $error->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -79,7 +79,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $service->validate_recovery_mode_key( $token, '', HOUR_IN_SECONDS );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'hash_mismatch', $error->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'hash_mismatch', $error->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,7 +92,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $service->validate_recovery_mode_key( $token, 'abcd', HOUR_IN_SECONDS );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'hash_mismatch', $error->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'hash_mismatch', $error->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,7 +110,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $service->validate_recovery_mode_key( $token, $key, HOUR_IN_SECONDS );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'key_expired', $error->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'key_expired', $error->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,7 +137,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $service->validate_recovery_mode_key( $token, $key, HOUR_IN_SECONDS );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'token_not_found', $error->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'token_not_found', $error->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -159,7 +159,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $service->validate_recovery_mode_key( $token, $key, HOUR_IN_SECONDS );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'token_not_found', $error->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'token_not_found', $error->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsfeedatomphp"></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/feed/atom.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/feed/atom.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/feed/atom.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -97,21 +97,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $atom );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify attributes.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://www.w3.org/2005/Atom', $atom[0]['attributes']['xmlns'] );
- $this->assertEquals( 'http://purl.org/syndication/thread/1.0', $atom[0]['attributes']['xmlns:thr'] );
- $this->assertEquals( site_url( '/wp-atom.php' ), $atom[0]['attributes']['xml:base'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://www.w3.org/2005/Atom', $atom[0]['attributes']['xmlns'] );
+ $this->assertSame( 'http://purl.org/syndication/thread/1.0', $atom[0]['attributes']['xmlns:thr'] );
+ $this->assertSame( site_url( '/wp-atom.php' ), $atom[0]['attributes']['xml:base'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify the <feed> element is present and contains a <title> child element.
</span><span class="cx" style="display: block; padding: 0 10px"> $title = xml_find( $xml, 'feed', 'title' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'blogname' ), $title[0]['content'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'blogname' ), $title[0]['content'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify the <feed> element is present and contains a <updated> child element.
</span><span class="cx" style="display: block; padding: 0 10px"> $updated = xml_find( $xml, 'feed', 'updated' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( strtotime( get_lastpostmodified() ), strtotime( $updated[0]['content'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( strtotime( get_lastpostmodified() ), strtotime( $updated[0]['content'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify the <feed> element is present and contains a <subtitle> child element.
</span><span class="cx" style="display: block; padding: 0 10px"> $subtitle = xml_find( $xml, 'feed', 'subtitle' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'blogdescription' ), $subtitle[0]['content'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'blogdescription' ), $subtitle[0]['content'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify the <feed> element is present and contains two <link> child elements.
</span><span class="cx" style="display: block; padding: 0 10px"> $link = xml_find( $xml, 'feed', 'link' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -118,12 +118,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $link );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify the <feed> element is present and contains a <link rel="alternate"> child element.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'alternate', $link[0]['attributes']['rel'] );
- $this->assertEquals( home_url(), $link[0]['attributes']['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'alternate', $link[0]['attributes']['rel'] );
+ $this->assertSame( home_url(), $link[0]['attributes']['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify the <feed> element is present and contains a <link rel="href"> child element.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'self', $link[1]['attributes']['rel'] );
- $this->assertEquals( home_url( '/?feed=atom' ), $link[1]['attributes']['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'self', $link[1]['attributes']['rel'] );
+ $this->assertSame( home_url( '/?feed=atom' ), $link[1]['attributes']['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -154,31 +154,31 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Author.
</span><span class="cx" style="display: block; padding: 0 10px"> $author = xml_find( $entries[ $key ]['child'], 'author', 'name' );
</span><span class="cx" style="display: block; padding: 0 10px"> $user = new WP_User( $post->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user->display_name, $author[0]['content'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user->display_name, $author[0]['content'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Title.
</span><span class="cx" style="display: block; padding: 0 10px"> $title = xml_find( $entries[ $key ]['child'], 'title' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post->post_title, $title[0]['content'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post->post_title, $title[0]['content'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Link rel="alternate".
</span><span class="cx" style="display: block; padding: 0 10px"> $link_alts = xml_find( $entries[ $key ]['child'], 'link' );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $link_alts as $link_alt ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'alternate' === $link_alt['attributes']['rel'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_permalink( $post ), $link_alt['attributes']['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_permalink( $post ), $link_alt['attributes']['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // ID.
</span><span class="cx" style="display: block; padding: 0 10px"> $guid = xml_find( $entries[ $key ]['child'], 'id' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post->guid, $id[0]['content'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post->guid, $id[0]['content'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Updated.
</span><span class="cx" style="display: block; padding: 0 10px"> $updated = xml_find( $entries[ $key ]['child'], 'updated' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( strtotime( $post->post_modified_gmt ), strtotime( $updated[0]['content'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( strtotime( $post->post_modified_gmt ), strtotime( $updated[0]['content'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Published.
</span><span class="cx" style="display: block; padding: 0 10px"> $published = xml_find( $entries[ $key ]['child'], 'published' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( strtotime( $post->post_date_gmt ), strtotime( $published[0]['content'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( strtotime( $post->post_date_gmt ), strtotime( $published[0]['content'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Category.
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( get_the_category( $post->ID ) as $term ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -193,7 +193,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Content.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->excerpt_only ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = xml_find( $entries[ $key ]['child'], 'content' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( trim( apply_filters( 'the_content', $post->post_content ) ), trim( $content[0]['content'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( trim( apply_filters( 'the_content', $post->post_content ) ), trim( $content[0]['content'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Link rel="replies".
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -200,7 +200,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $link_replies = xml_find( $entries[ $key ]['child'], 'link' );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $link_replies as $link_reply ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'replies' === $link_reply['attributes']['rel'] && 'application/atom+xml' === $link_reply['attributes']['type'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_post_comments_feed_link( $post->ID, 'atom' ), $link_reply['attributes']['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_post_comments_feed_link( $post->ID, 'atom' ), $link_reply['attributes']['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -273,9 +273,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $i = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $links as $link ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'enclosure' === $link['attributes']['rel'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $enclosures[ $i ]['expected']['href'], $link['attributes']['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $enclosures[ $i ]['expected']['href'], $link['attributes']['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $enclosures[ $i ]['expected']['length'], $link['attributes']['length'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $enclosures[ $i ]['expected']['type'], $link['attributes']['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $enclosures[ $i ]['expected']['type'], $link['attributes']['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $i++;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsfeedrss2php"></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/feed/rss2.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/feed/rss2.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/feed/rss2.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -106,15 +106,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $rss = xml_find( $xml, 'rss' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There should only be one <rss> child element.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $rss ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $rss ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2.0', $rss[0]['attributes']['version'] );
- $this->assertEquals( 'http://purl.org/rss/1.0/modules/content/', $rss[0]['attributes']['xmlns:content'] );
- $this->assertEquals( 'http://wellformedweb.org/CommentAPI/', $rss[0]['attributes']['xmlns:wfw'] );
- $this->assertEquals( 'http://purl.org/dc/elements/1.1/', $rss[0]['attributes']['xmlns:dc'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2.0', $rss[0]['attributes']['version'] );
+ $this->assertSame( 'http://purl.org/rss/1.0/modules/content/', $rss[0]['attributes']['xmlns:content'] );
+ $this->assertSame( 'http://wellformedweb.org/CommentAPI/', $rss[0]['attributes']['xmlns:wfw'] );
+ $this->assertSame( 'http://purl.org/dc/elements/1.1/', $rss[0]['attributes']['xmlns:dc'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // RSS should have exactly one child element (channel).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $rss[0]['child'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $rss[0]['child'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -135,16 +135,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify the channel is present and contains a title child element.
</span><span class="cx" style="display: block; padding: 0 10px"> $title = xml_find( $xml, 'rss', 'channel', 'title' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'blogname' ), $title[0]['content'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'blogname' ), $title[0]['content'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $desc = xml_find( $xml, 'rss', 'channel', 'description' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'blogdescription' ), $desc[0]['content'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'blogdescription' ), $desc[0]['content'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $link = xml_find( $xml, 'rss', 'channel', 'link' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'siteurl' ), $link[0]['content'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'siteurl' ), $link[0]['content'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $pubdate = xml_find( $xml, 'rss', 'channel', 'lastBuildDate' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( strtotime( get_lastpostmodified() ), strtotime( $pubdate[0]['content'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( strtotime( get_lastpostmodified() ), strtotime( $pubdate[0]['content'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -199,24 +199,24 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Title.
</span><span class="cx" style="display: block; padding: 0 10px"> $title = xml_find( $items[ $key ]['child'], 'title' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post->post_title, $title[0]['content'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post->post_title, $title[0]['content'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Link.
</span><span class="cx" style="display: block; padding: 0 10px"> $link = xml_find( $items[ $key ]['child'], 'link' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_permalink( $post ), $link[0]['content'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_permalink( $post ), $link[0]['content'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Comment link.
</span><span class="cx" style="display: block; padding: 0 10px"> $comments_link = xml_find( $items[ $key ]['child'], 'comments' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_permalink( $post ) . '#respond', $comments_link[0]['content'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_permalink( $post ) . '#respond', $comments_link[0]['content'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Pub date.
</span><span class="cx" style="display: block; padding: 0 10px"> $pubdate = xml_find( $items[ $key ]['child'], 'pubDate' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( strtotime( $post->post_date_gmt ), strtotime( $pubdate[0]['content'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( strtotime( $post->post_date_gmt ), strtotime( $pubdate[0]['content'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Author.
</span><span class="cx" style="display: block; padding: 0 10px"> $creator = xml_find( $items[ $key ]['child'], 'dc:creator' );
</span><span class="cx" style="display: block; padding: 0 10px"> $user = new WP_User( $post->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user->display_name, $creator[0]['content'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user->display_name, $creator[0]['content'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Categories (perhaps multiple).
</span><span class="cx" style="display: block; padding: 0 10px"> $categories = xml_find( $items[ $key ]['child'], 'category' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -233,33 +233,33 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $cats = array_filter( $cats );
</span><span class="cx" style="display: block; padding: 0 10px"> // Should be the same number of categories.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( count( $cats ), count( $categories ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( count( $cats ), count( $categories ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // ..with the same names.
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $cats as $id => $cat ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $cat, $categories[ $id ]['content'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $cat, $categories[ $id ]['content'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // GUID.
</span><span class="cx" style="display: block; padding: 0 10px"> $guid = xml_find( $items[ $key ]['child'], 'guid' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'false', $guid[0]['attributes']['isPermaLink'] );
- $this->assertEquals( $post->guid, $guid[0]['content'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'false', $guid[0]['attributes']['isPermaLink'] );
+ $this->assertSame( $post->guid, $guid[0]['content'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Description / Excerpt.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $post->post_excerpt ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $description = xml_find( $items[ $key ]['child'], 'description' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( trim( $post->post_excerpt ), trim( $description[0]['content'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( trim( $post->post_excerpt ), trim( $description[0]['content'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Post content.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->excerpt_only ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = xml_find( $items[ $key ]['child'], 'content:encoded' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( trim( apply_filters( 'the_content', $post->post_content ) ), trim( $content[0]['content'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( trim( apply_filters( 'the_content', $post->post_content ) ), trim( $content[0]['content'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Comment RSS.
</span><span class="cx" style="display: block; padding: 0 10px"> $comment_rss = xml_find( $items[ $key ]['child'], 'wfw:commentRss' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( html_entity_decode( get_post_comments_feed_link( $post->ID ) ), $comment_rss[0]['content'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( html_entity_decode( get_post_comments_feed_link( $post->ID ) ), $comment_rss[0]['content'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -320,7 +320,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $rss = xml_find( $xml, 'rss' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There should only be one <rss> child element.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $rss ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $rss ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -348,7 +348,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $rss = xml_find( $xml, 'rss' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There should only be one <rss> child element.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $rss ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $rss ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -381,7 +381,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $rss = xml_find( $xml, 'rss' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There should only be one <rss> child element.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $rss ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $rss ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -409,7 +409,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $rss = xml_find( $xml, 'rss' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There should only be one <rss> child element.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $rss ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $rss ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -437,7 +437,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $rss = xml_find( $xml, 'rss' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There should only be one <rss> child element.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $rss ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $rss ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -465,7 +465,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $rss = xml_find( $xml, 'rss' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There should only be one <rss> child element.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $rss ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $rss ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -483,7 +483,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Get the <rss> child element of <xml>.
</span><span class="cx" style="display: block; padding: 0 10px"> $rss = xml_find( $xml, $element );
</span><span class="cx" style="display: block; padding: 0 10px"> $last_build_date = $rss[0]['child'][0]['child'][4]['content'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( strtotime( get_feed_build_date( 'r' ) ), strtotime( $last_build_date ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( strtotime( get_feed_build_date( 'r' ) ), strtotime( $last_build_date ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsfilephp"></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/file.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/file.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/file.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,7 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $actual as $header => $value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected[ $header ], $value, $header );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected[ $header ], $value, $header );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -61,7 +61,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $actual as $header => $value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected[ $header ], $value, $header );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected[ $header ], $value, $header );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -118,7 +118,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = wp_unique_filename( $this->dir, $name . $this->badchars . '.txt' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the bad characters were all stripped out.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $name . '.txt', $filename );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $name . '.txt', $filename );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->is_unique_writable_file( $this->dir, $filename ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -131,7 +131,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = wp_unique_filename( $this->dir, $name . '/' . $name . '.txt' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The slash should be removed, i.e. "foofoo.txt".
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $name . $name . '.txt', $filename );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $name . $name . '.txt', $filename );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->is_unique_writable_file( $this->dir, $filename ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -143,7 +143,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = wp_unique_filename( $this->dir, $name . '.php.txt' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // "foo.php.txt" becomes "foo.php_.txt".
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $name . '.php_.txt', $filename );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $name . '.php_.txt', $filename );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->is_unique_writable_file( $this->dir, $filename ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -154,7 +154,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = __FUNCTION__;
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = wp_unique_filename( $this->dir, $name );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $name, $filename );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $name, $filename );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->is_unique_writable_file( $this->dir, $filename ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -231,7 +231,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $verify );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'signature_verification_failed', $verify->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'signature_verification_failed', $verify->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function filter_trust_plus85Tq_key( $keys ) {
</span></span></pre></div>
<a id="trunktestsphpunittestsfilesystemfindFolderphp"></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/filesystem/findFolder.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/filesystem/findFolder.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/filesystem/findFolder.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $path = $fs->find_folder( '/var/www/wordpress/' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/var/www/wordpress/', $path );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/var/www/wordpress/', $path );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $path = $fs->find_folder( '/this/directory/doesnt/exist/' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $path );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,10 +44,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $path = $fs->find_folder( '/var/www/example.com/wordpress/' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/www/example.com/wordpress/', $path );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/www/example.com/wordpress/', $path );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $path = $fs->find_folder( '/var/www/wp.example.com/wordpress/wp-content/' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/www/wp.example.com/wordpress/wp-content/', $path );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/www/wp.example.com/wordpress/wp-content/', $path );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,10 +72,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $path = $fs->abspath( '/var/www/example.com/wp.example.com/wordpress/' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/wp.example.com/wordpress/', $path );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/wp.example.com/wordpress/', $path );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $path = $fs->abspath( '/var/www/example.com/' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/', $path );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/', $path );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -103,15 +103,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // www.example.com
</span><span class="cx" style="display: block; padding: 0 10px"> $path = $fs->abspath( '/var/www/example.com/www/' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/example.com/www/', $path );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/example.com/www/', $path );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // sub.example.com
</span><span class="cx" style="display: block; padding: 0 10px"> $path = $fs->abspath( '/var/www/example.com/sub/' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/example.com/sub/', $path );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/example.com/sub/', $path );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // sub.example.com - Plugins.
</span><span class="cx" style="display: block; padding: 0 10px"> $path = $fs->find_folder( '/var/www/example.com/sub/wp-content/plugins/' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/example.com/sub/wp-content/plugins/', $path );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/example.com/sub/wp-content/plugins/', $path );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsfiltersphp"></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/filters.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/filters.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/filters.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,16 +13,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $val = __FUNCTION__ . '_val';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( $tag, array( $a, 'filter' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, apply_filters( $tag, $val ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, apply_filters( $tag, $val ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Only one event occurred for the hook, with empty args.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Only our hook was called.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $tag ), $a->get_tags() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $tag ), $a->get_tags() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $argsvar = $a->get_args();
</span><span class="cx" style="display: block; padding: 0 10px"> $args = array_pop( $argsvar );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $val ), $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $val ), $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_remove_filter() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,17 +31,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $val = __FUNCTION__ . '_val';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( $tag, array( $a, 'filter' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, apply_filters( $tag, $val ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, apply_filters( $tag, $val ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure our hook was called correctly.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a->get_call_count() );
- $this->assertEquals( array( $tag ), $a->get_tags() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a->get_call_count() );
+ $this->assertSame( array( $tag ), $a->get_tags() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Now remove the filter, do it again, and make sure it's not called this time.
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( $tag, array( $a, 'filter' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, apply_filters( $tag, $val ) );
- $this->assertEquals( 1, $a->get_call_count() );
- $this->assertEquals( array( $tag ), $a->get_tags() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, apply_filters( $tag, $val ) );
+ $this->assertSame( 1, $a->get_call_count() );
+ $this->assertSame( array( $tag ), $a->get_tags() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,7 +52,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_filter( $tag, $func ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_filter( $tag ) );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( $tag, $func );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_filter( $tag, $func ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_filter( $tag, $func ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( has_filter( $tag ) );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( $tag, $func );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_filter( $tag, $func ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,11 +70,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( $tag, array( $a1, 'filter' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( $tag, array( $a2, 'filter' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, apply_filters( $tag, $val ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, apply_filters( $tag, $val ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Both filters called once each.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a1->get_call_count() );
- $this->assertEquals( 1, $a2->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a1->get_call_count() );
+ $this->assertSame( 1, $a2->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_filter_args_1() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -85,11 +85,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( $tag, array( $a, 'filter' ), 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> // Call the filter with a single argument.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, apply_filters( $tag, $val, $arg1 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, apply_filters( $tag, $val, $arg1 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $argsvar = $a->get_args();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $val, $arg1 ), array_pop( $argsvar ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $val, $arg1 ), array_pop( $argsvar ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_filter_args_2() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,17 +104,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( $tag, array( $a1, 'filter' ), 10, 3 );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( $tag, array( $a2, 'filter' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> // Call the filter with two arguments.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, apply_filters( $tag, $val, $arg1, $arg2 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, apply_filters( $tag, $val, $arg1, $arg2 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // $a1 should be called with both args.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a1->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a1->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $argsvar1 = $a1->get_args();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $val, $arg1, $arg2 ), array_pop( $argsvar1 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $val, $arg1, $arg2 ), array_pop( $argsvar1 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // $a2 should be called with one only.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a2->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a2->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $argsvar2 = $a2->get_args();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $val ), array_pop( $argsvar2 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $val ), array_pop( $argsvar2 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_filter_priority() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,10 +125,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Make two filters with different priorities.
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( $tag, array( $a, 'filter' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( $tag, array( $a, 'filter2' ), 9 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, apply_filters( $tag, $val ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, apply_filters( $tag, $val ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There should be two events, one per filter.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $a->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $a->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><span class="cx" style="display: block; padding: 0 10px"> // 'filter2' is called first because it has priority 9.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -145,7 +145,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $a->get_events() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $a->get_events() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_all_filter() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -157,15 +157,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Add an 'all' filter.
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'all', array( $a, 'filterall' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> // Apply some filters.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, apply_filters( $tag1, $val ) );
- $this->assertEquals( $val, apply_filters( $tag2, $val ) );
- $this->assertEquals( $val, apply_filters( $tag1, $val ) );
- $this->assertEquals( $val, apply_filters( $tag1, $val ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, apply_filters( $tag1, $val ) );
+ $this->assertSame( $val, apply_filters( $tag2, $val ) );
+ $this->assertSame( $val, apply_filters( $tag1, $val ) );
+ $this->assertSame( $val, apply_filters( $tag1, $val ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Our filter should have been called once for each apply_filters call.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 4, $a->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 4, $a->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> // The right hooks should have been called in order.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $tag1, $tag2, $tag1, $tag1 ), $a->get_tags() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $tag1, $tag2, $tag1, $tag1 ), $a->get_tags() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'all', array( $a, 'filterall' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_filter( 'all', array( $a, 'filterall' ) ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -179,21 +179,21 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'all', array( $a, 'filterall' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( has_filter( 'all' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_filter( 'all', array( $a, 'filterall' ) ) );
- $this->assertEquals( $val, apply_filters( $tag, $val ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_filter( 'all', array( $a, 'filterall' ) ) );
+ $this->assertSame( $val, apply_filters( $tag, $val ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure our hook was called correctly.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a->get_call_count() );
- $this->assertEquals( array( $tag ), $a->get_tags() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a->get_call_count() );
+ $this->assertSame( array( $tag ), $a->get_tags() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Now remove the filter, do it again, and make sure it's not called this time.
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'all', array( $a, 'filterall' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_filter( 'all', array( $a, 'filterall' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_filter( 'all' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, apply_filters( $tag, $val ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, apply_filters( $tag, $val ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Call cound should remain at 1.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a->get_call_count() );
- $this->assertEquals( array( $tag ), $a->get_tags() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a->get_call_count() );
+ $this->assertSame( array( $tag ), $a->get_tags() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -248,7 +248,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = apply_filters_ref_array( $tag, array( 'string', &$obj ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $result, 'string_append_append' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $result, 'string_append_append' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args = $a->get_args();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $args[0][1], $obj );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -373,7 +373,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'test_current_priority' );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'test_current_priority', array( $this, '_other_priority_action' ), 99 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( false, $this->current_priority );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $this->current_priority );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function _other_priority_action() {
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingAutopphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/Autop.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,7 +62,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // On Windows environments, the EOL-style is \r\n.
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = str_replace( "\r\n", "\n", $expected );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wpautop( $test_data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wpautop( $test_data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,7 +77,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Not wrapped in <p> tags.
</span><span class="cx" style="display: block; padding: 0 10px"> $str = "<pre>$code</pre>";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $str, trim( wpautop( $str ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $str, trim( wpautop( $str ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Text before/after is wrapped in <p> tags.
</span><span class="cx" style="display: block; padding: 0 10px"> $str = "Look at this code\n\n<pre>$code</pre>\n\nIsn't that cool?";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -84,12 +84,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Expected text after wpautop().
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>Look at this code</p>' . "\n<pre>" . $code . "</pre>\n" . '<p>Isn\'t that cool?</p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, trim( wpautop( $str ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, trim( wpautop( $str ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure HTML breaks are maintained if manually inserted.
</span><span class="cx" style="display: block; padding: 0 10px"> $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?";
</span><span class="cx" style="display: block; padding: 0 10px"> $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>";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, trim( wpautop( $str ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, trim( wpautop( $str ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -99,7 +99,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_skip_input_elements() {
</span><span class="cx" style="display: block; padding: 0 10px"> $str = 'Username: <input type="text" id="username" name="username" /><br />Password: <input type="password" id="password1" name="password1" />';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "<p>$str</p>", trim( wpautop( $str ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "<p>$str</p>", trim( wpautop( $str ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -183,9 +183,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "[/video]</p>\n" .
</span><span class="cx" style="display: block; padding: 0 10px"> '<p>Paragraph two.</p>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, trim( wpautop( $content ) ) );
- $this->assertEquals( $expected, trim( wpautop( $content2 ) ) );
- $this->assertEquals( $shortcode_expected, trim( wpautop( $shortcode_content ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, trim( wpautop( $content ) ) );
+ $this->assertSame( $expected, trim( wpautop( $content2 ) ) );
+ $this->assertSame( $shortcode_expected, trim( wpautop( $shortcode_content ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -263,8 +263,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "</object></div>\n" .
</span><span class="cx" style="display: block; padding: 0 10px"> '<p>Paragraph two.</p>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected1, trim( wpautop( $content1 ) ) );
- $this->assertEquals( $expected2, trim( wpautop( $content2 ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected1, trim( wpautop( $content1 ) ) );
+ $this->assertSame( $expected2, trim( wpautop( $content2 ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -274,7 +274,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_skip_select_option_elements() {
</span><span class="cx" style="display: block; padding: 0 10px"> $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>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "<p>$str</p>", trim( wpautop( $str ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "<p>$str</p>", trim( wpautop( $str ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -340,11 +340,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = join( "\n", $content );
</span><span class="cx" style="display: block; padding: 0 10px"> $input = join( "\n\n", $content ); // Whitespace difference.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, trim( wpautop( $input ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, trim( wpautop( $input ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $input = join( '', $content ); // Whitespace difference.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, trim( wpautop( $input ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, trim( wpautop( $input ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check whitespace addition.
</span><span class="cx" style="display: block; padding: 0 10px"> $content = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -356,7 +356,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = join( "\n", $content );
</span><span class="cx" style="display: block; padding: 0 10px"> $input = join( '', $content );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, trim( wpautop( $input ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, trim( wpautop( $input ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check whitespace addition with attributes.
</span><span class="cx" style="display: block; padding: 0 10px"> $content = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -368,7 +368,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = join( "\n", $content );
</span><span class="cx" style="display: block; padding: 0 10px"> $input = join( '', $content );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, trim( wpautop( $input ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, trim( wpautop( $input ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -380,7 +380,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<blockquote>foo</blockquote>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<blockquote><p>foo</p></blockquote>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, trim( wpautop( $content ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, trim( wpautop( $content ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -429,7 +429,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $content = join( "\n\n", $content );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = join( "\n", $expected );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, trim( wpautop( $content ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, trim( wpautop( $content ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -439,7 +439,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_element_sanity
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_element_sanity( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wpautop( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wpautop( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_element_sanity() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -505,7 +505,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> line 4<br />
</span><span class="cx" style="display: block; padding: 0 10px"> line 5</p>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, trim( wpautop( $content ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, trim( wpautop( $content ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -524,7 +524,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>line 1</p>
</span><span class="cx" style="display: block; padding: 0 10px"> <p>line 2</p>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, trim( wpautop( $content ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, trim( wpautop( $content ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -535,7 +535,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $content = 'a<div>b</div>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = "<p>a</p>\n<div>b</div>";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, trim( wpautop( $content ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, trim( wpautop( $content ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -558,8 +558,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected2 = '<figure>
</span><span class="cx" style="display: block; padding: 0 10px"> <img src="example.jpg" /><figcaption>Caption</figcaption></figure>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected1, trim( wpautop( $content1 ) ) );
- $this->assertEqualsIgnoreEOL( $expected2, trim( wpautop( $content2 ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected1, trim( wpautop( $content1 ) ) );
+ $this->assertSameIgnoreEOL( $expected2, trim( wpautop( $content2 ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -569,7 +569,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $content = 'paragraph1<hr>paragraph2';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = "<p>paragraph1</p>\n<hr>\n<p>paragraph2</p>";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, trim( wpautop( $content ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, trim( wpautop( $content ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -587,7 +587,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>' . $content . '</p>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, trim( wpautop( $content ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, trim( wpautop( $content ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -603,6 +603,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>' . $content . '</p>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, trim( wpautop( $content ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, trim( wpautop( $content ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingBlogInfophp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/BlogInfo.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,7 +15,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $old_locale = $locale;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $locale = $test_locale;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_bloginfo( 'language' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_bloginfo( 'language' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $locale = $old_locale;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,16 +54,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $sanitized_value = sanitize_option( 'blogname', $value );
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blogname', $sanitized_value );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $sanitized_value );
- $this->assertEquals( $expected, get_bloginfo( 'name' ) );
- $this->assertEquals( $expected, get_bloginfo( 'name', 'display' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $sanitized_value );
+ $this->assertSame( $expected, get_bloginfo( 'name' ) );
+ $this->assertSame( $expected, get_bloginfo( 'name', 'display' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $sanitized_value = sanitize_option( 'blogdescription', $value );
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blogdescription', $sanitized_value );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $sanitized_value );
- $this->assertEquals( $expected, get_bloginfo( 'description' ) );
- $this->assertEquals( $expected, get_bloginfo( 'description', 'display' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $sanitized_value );
+ $this->assertSame( $expected, get_bloginfo( 'description' ) );
+ $this->assertSame( $expected, get_bloginfo( 'description', 'display' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Restore old values.
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingCapitalPDangitphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/CapitalPDangit.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,14 +7,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_CapitalPDangit extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px"> function test_esc_attr_quotes() {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_current_filter;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Something about WordPress', capital_P_dangit( 'Something about Wordpress' ) );
- $this->assertEquals( 'Something about (WordPress', capital_P_dangit( 'Something about (Wordpress' ) );
- $this->assertEquals( 'Something about ‘WordPress', capital_P_dangit( 'Something about ‘Wordpress' ) );
- $this->assertEquals( 'Something about “WordPress', capital_P_dangit( 'Something about “Wordpress' ) );
- $this->assertEquals( 'Something about >WordPress', capital_P_dangit( 'Something about >Wordpress' ) );
- $this->assertEquals( 'Wordpress', capital_P_dangit( 'Wordpress' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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 ‘WordPress', capital_P_dangit( 'Something about ‘Wordpress' ) );
+ $this->assertSame( 'Something about “WordPress', capital_P_dangit( 'Something about “Wordpress' ) );
+ $this->assertSame( 'Something about >WordPress', capital_P_dangit( 'Something about >Wordpress' ) );
+ $this->assertSame( 'Wordpress', capital_P_dangit( 'Wordpress' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_current_filter = array( 'the_title' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'WordPress', capital_P_dangit( 'Wordpress' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'WordPress', capital_P_dangit( 'Wordpress' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingCleanPrephp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/CleanPre.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,13 +13,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $source = 'a b c\n<br />sldfj<br />';
</span><span class="cx" style="display: block; padding: 0 10px"> $res = 'a b c\nsldfj';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $res, clean_pre( $source ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $res, clean_pre( $source ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_removes_self_closing_br_without_space() {
</span><span class="cx" style="display: block; padding: 0 10px"> $source = 'a b c\n<br/>sldfj<br/>';
</span><span class="cx" style="display: block; padding: 0 10px"> $res = 'a b c\nsldfj';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $res, clean_pre( $source ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $res, clean_pre( $source ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // I don't think this can ever happen in production;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,12 +29,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_removes_html_br() {
</span><span class="cx" style="display: block; padding: 0 10px"> $source = 'a b c\n<br>sldfj<br>';
</span><span class="cx" style="display: block; padding: 0 10px"> $res = 'a b c\nsldfj';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $res, clean_pre( $source ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $res, clean_pre( $source ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_removes_p() {
</span><span class="cx" style="display: block; padding: 0 10px"> $source = "<p>isn't this exciting!</p><p>oh indeed!</p>";
</span><span class="cx" style="display: block; padding: 0 10px"> $res = "\nisn't this exciting!\noh indeed!";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $res, clean_pre( $source ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $res, clean_pre( $source ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingConvertInvalidEntriesphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/ConvertInvalidEntries.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,7 +7,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_windows1252_entities_with_unicode_ones() {
</span><span class="cx" style="display: block; padding: 0 10px"> $input = '‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ';
</span><span class="cx" style="display: block; padding: 0 10px"> $output = '‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $output, convert_invalid_entities( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $output, convert_invalid_entities( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,10 +16,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_latin_letter_z_with_caron() {
</span><span class="cx" style="display: block; padding: 0 10px"> $input = 'Žž';
</span><span class="cx" style="display: block; padding: 0 10px"> $output = 'Žž';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $output, convert_invalid_entities( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $output, convert_invalid_entities( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_escapes_lone_ampersands() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'at&t', convert_chars( 'at&t' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'at&t', convert_chars( 'at&t' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingEscAttrphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/EscAttr.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,27 +6,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_EscAttr extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px"> function test_esc_attr_quotes() {
</span><span class="cx" style="display: block; padding: 0 10px"> $attr = '"double quotes"';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '"double quotes"', esc_attr( $attr ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '"double quotes"', esc_attr( $attr ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $attr = "'single quotes'";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( ''single quotes'', esc_attr( $attr ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( ''single quotes'', esc_attr( $attr ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $attr = "'mixed' " . '"quotes"';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( ''mixed' "quotes"', esc_attr( $attr ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( ''mixed' "quotes"', esc_attr( $attr ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Handles double encoding?
</span><span class="cx" style="display: block; padding: 0 10px"> $attr = '"double quotes"';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '"double quotes"', esc_attr( esc_attr( $attr ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '"double quotes"', esc_attr( esc_attr( $attr ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $attr = "'single quotes'";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( ''single quotes'', esc_attr( esc_attr( $attr ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( ''single quotes'', esc_attr( esc_attr( $attr ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $attr = "'mixed' " . '"quotes"';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( ''mixed' "quotes"', esc_attr( esc_attr( $attr ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( ''mixed' "quotes"', esc_attr( esc_attr( $attr ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_esc_attr_amp() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = esc_attr( 'foo & bar &baz; ' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo & bar &baz; ', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo & bar &baz; ', $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingEscHtmlphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/EscHtml.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,34 +7,34 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_esc_html_basics() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Simple string.
</span><span class="cx" style="display: block; padding: 0 10px"> $html = 'The quick brown fox.';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $html, esc_html( $html ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $html, esc_html( $html ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // URL with &.
</span><span class="cx" style="display: block; padding: 0 10px"> $html = 'http://localhost/trunk/wp-login.php?action=logout&_wpnonce=cd57d75985';
</span><span class="cx" style="display: block; padding: 0 10px"> $escaped = 'http://localhost/trunk/wp-login.php?action=logout&_wpnonce=cd57d75985';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $escaped, esc_html( $html ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $escaped, esc_html( $html ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // SQL query.
</span><span class="cx" style="display: block; padding: 0 10px"> $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";
</span><span class="cx" style="display: block; padding: 0 10px"> $escaped = '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';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $escaped, esc_html( $html ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $escaped, esc_html( $html ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_escapes_ampersands() {
</span><span class="cx" style="display: block; padding: 0 10px"> $source = 'penn & teller & at&t';
</span><span class="cx" style="display: block; padding: 0 10px"> $res = 'penn & teller & at&t';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $res, esc_html( $source ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $res, esc_html( $source ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_escapes_greater_and_less_than() {
</span><span class="cx" style="display: block; padding: 0 10px"> $source = 'this > that < that <randomhtml />';
</span><span class="cx" style="display: block; padding: 0 10px"> $res = 'this > that < that <randomhtml />';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $res, esc_html( $source ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $res, esc_html( $source ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_ignores_existing_entities() {
</span><span class="cx" style="display: block; padding: 0 10px"> $source = '& £ " &';
</span><span class="cx" style="display: block; padding: 0 10px"> $res = '& £ " &';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $res, esc_html( $source ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $res, esc_html( $source ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingEscTextareaphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/EscTextarea.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,7 +16,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_esc_textarea_charset_iso_8859_1() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'pre_option_blog_charset', array( $this, '_charset_iso_8859_1' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $iso8859_1 = 'Fran' . chr( 135 ) . 'ais';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $iso8859_1, esc_textarea( $iso8859_1 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $iso8859_1, esc_textarea( $iso8859_1 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_option_blog_charset', array( $this, '_charset_iso_8859_1' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -30,7 +30,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_esc_textarea_charset_utf_8() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'pre_option_blog_charset', array( $this, '_charset_utf_8' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $utf8 = 'Fran' . chr( 195 ) . chr( 167 ) . 'ais';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $utf8, esc_textarea( $utf8 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $utf8, esc_textarea( $utf8 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_option_blog_charset', array( $this, '_charset_utf_8' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingEscUrlphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/EscUrl.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,41 +9,41 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 23605
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_spaces() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://example.com/Mr%20WordPress', esc_url( 'http://example.com/Mr WordPress' ) );
- $this->assertEquals( 'http://example.com/Mr%20WordPress', esc_url( 'http://example.com/Mr%20WordPress' ) );
- $this->assertEquals( 'http://example.com/Mr%20%20WordPress', esc_url( 'http://example.com/Mr%20%20WordPress' ) );
- $this->assertEquals( 'http://example.com/Mr+WordPress', esc_url( 'http://example.com/Mr+WordPress' ) );
- $this->assertEquals( 'http://example.com/Mr+WordPress', esc_url( ' http://example.com/Mr+WordPress' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://example.com/?foo=one%20two%20three&bar=four', esc_url( 'http://example.com/?foo=one two three&bar=four' ) );
- $this->assertEquals( 'http://example.com/?foo=one%20two%20three&bar=four', esc_url( 'http://example.com/?foo=one%20two%20three&bar=four' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://example.com/?foo=one%20two%20three&bar=four', esc_url( 'http://example.com/?foo=one two three&bar=four' ) );
+ $this->assertSame( 'http://example.com/?foo=one%20two%20three&bar=four', esc_url( 'http://example.com/?foo=one%20two%20three&bar=four' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_bad_characters() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://example.com/watchthelinefeedgo', esc_url( 'http://example.com/watchthelinefeed%0Ago' ) );
- $this->assertEquals( 'http://example.com/watchthelinefeedgo', esc_url( 'http://example.com/watchthelinefeed%0ago' ) );
- $this->assertEquals( 'http://example.com/watchthecarriagereturngo', esc_url( 'http://example.com/watchthecarriagereturn%0Dgo' ) );
- $this->assertEquals( 'http://example.com/watchthecarriagereturngo', esc_url( 'http://example.com/watchthecarriagereturn%0dgo' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Nesting checks.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://example.com/watchthecarriagereturngo', esc_url( 'http://example.com/watchthecarriagereturn%0%0ddgo' ) );
- $this->assertEquals( 'http://example.com/watchthecarriagereturngo', esc_url( 'http://example.com/watchthecarriagereturn%0%0DDgo' ) );
- $this->assertEquals( 'http://example.com/', esc_url( 'http://example.com/%0%0%0DAD' ) );
- $this->assertEquals( 'http://example.com/', esc_url( 'http://example.com/%0%0%0ADA' ) );
- $this->assertEquals( 'http://example.com/', esc_url( 'http://example.com/%0%0%0DAd' ) );
- $this->assertEquals( 'http://example.com/', esc_url( 'http://example.com/%0%0%0ADa' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_relative() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/example.php', esc_url( '/example.php' ) );
- $this->assertEquals( 'example.php', esc_url( 'example.php' ) );
- $this->assertEquals( '#fragment', esc_url( '#fragment' ) );
- $this->assertEquals( '?foo=bar', esc_url( '?foo=bar' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_all_url_parts() {
</span><span class="cx" style="display: block; padding: 0 10px"> $url = 'https://user:pass@host.example.com:1234/path;p=1?query=2&r[]=3#fragment';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'scheme' => 'https',
</span><span class="cx" style="display: block; padding: 0 10px"> 'host' => 'host.example.com',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,35 +56,35 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> parse_url( $url )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'https://user:pass@host.example.com:1234/path;p=1?query=2&r%5B%5D=3#fragment', esc_url_raw( $url ) );
- $this->assertEquals( 'https://user:pass@host.example.com:1234/path;p=1?query=2&r%5B%5D=3#fragment', esc_url( $url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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&r%5B%5D=3#fragment', esc_url( $url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_bare() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://example.com?foo', esc_url( 'example.com?foo' ) );
- $this->assertEquals( 'http://example.com', esc_url( 'example.com' ) );
- $this->assertEquals( 'http://localhost', esc_url( 'localhost' ) );
- $this->assertEquals( 'http://example.com/foo', esc_url( 'example.com/foo' ) );
- $this->assertEquals( 'http://баба.org/баба', esc_url( 'баба.org/баба' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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/баба' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_encoding() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://example.com?foo=1&bar=2', esc_url_raw( 'http://example.com?foo=1&bar=2' ) );
- $this->assertEquals( 'http://example.com?foo=1&bar=2', esc_url_raw( 'http://example.com?foo=1&bar=2' ) );
- $this->assertEquals( 'http://example.com?foo=1&bar=2', esc_url_raw( 'http://example.com?foo=1&bar=2' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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&bar=2', esc_url_raw( 'http://example.com?foo=1&bar=2' ) );
+ $this->assertSame( 'http://example.com?foo=1&bar=2', esc_url_raw( 'http://example.com?foo=1&bar=2' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://example.com?foo=1&bar=2', esc_url( 'http://example.com?foo=1&bar=2' ) );
- $this->assertEquals( 'http://example.com?foo=1&bar=2', esc_url( 'http://example.com?foo=1&bar=2' ) );
- $this->assertEquals( 'http://example.com?foo=1&bar=2', esc_url( 'http://example.com?foo=1&bar=2' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://example.com?foo=1&bar=2', esc_url( 'http://example.com?foo=1&bar=2' ) );
+ $this->assertSame( 'http://example.com?foo=1&bar=2', esc_url( 'http://example.com?foo=1&bar=2' ) );
+ $this->assertSame( 'http://example.com?foo=1&bar=2', esc_url( 'http://example.com?foo=1&bar=2' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $param = urlencode( 'http://example.com/?one=1&two=2' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "http://example.com?url={$param}", esc_url( "http://example.com?url={$param}" ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "http://example.com?url={$param}", esc_url( "http://example.com?url={$param}" ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_protocol() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://example.com', esc_url( 'http://example.com' ) );
- $this->assertEquals( '', esc_url( 'nasty://example.com/' ) );
- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://example.com', esc_url( 'http://example.com' ) );
+ $this->assertSame( '', esc_url( 'nasty://example.com/' ) );
+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> '',
</span><span class="cx" style="display: block; padding: 0 10px"> esc_url(
</span><span class="cx" style="display: block; padding: 0 10px"> 'example.com',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -93,7 +93,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> '',
</span><span class="cx" style="display: block; padding: 0 10px"> esc_url(
</span><span class="cx" style="display: block; padding: 0 10px"> 'http://example.com',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -102,7 +102,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'https://example.com',
</span><span class="cx" style="display: block; padding: 0 10px"> esc_url(
</span><span class="cx" style="display: block; padding: 0 10px"> 'https://example.com',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -114,8 +114,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( wp_allowed_protocols() as $scheme ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "{$scheme}://example.com", esc_url( "{$scheme}://example.com" ), $scheme );
- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "{$scheme}://example.com", esc_url( "{$scheme}://example.com" ), $scheme );
+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> "{$scheme}://example.com",
</span><span class="cx" style="display: block; padding: 0 10px"> esc_url(
</span><span class="cx" style="display: block; padding: 0 10px"> "{$scheme}://example.com",
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -128,10 +128,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( ! in_array( 'data', wp_allowed_protocols(), true ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', esc_url( 'data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', esc_url( 'data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( ! in_array( 'foo', wp_allowed_protocols(), true ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'foo://example.com',
</span><span class="cx" style="display: block; padding: 0 10px"> esc_url(
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo://example.com',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -147,27 +147,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 23187
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_protocol_case() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://example.com', esc_url( 'HTTP://example.com' ) );
- $this->assertEquals( 'http://example.com', esc_url( 'Http://example.com' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://example.com', esc_url( 'HTTP://example.com' ) );
+ $this->assertSame( 'http://example.com', esc_url( 'Http://example.com' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_display_extras() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://example.com/'quoted'', esc_url( 'http://example.com/\'quoted\'' ) );
- $this->assertEquals( 'http://example.com/\'quoted\'', esc_url( 'http://example.com/\'quoted\'', null, 'notdisplay' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://example.com/'quoted'', esc_url( 'http://example.com/\'quoted\'' ) );
+ $this->assertSame( 'http://example.com/\'quoted\'', esc_url( 'http://example.com/\'quoted\'', null, 'notdisplay' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_non_ascii() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://example.org/баба', esc_url( 'http://example.org/баба' ) );
- $this->assertEquals( 'http://баба.org/баба', esc_url( 'http://баба.org/баба' ) );
- $this->assertEquals( 'http://müller.com/', esc_url( 'http://müller.com/' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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/' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_feed() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', esc_url( 'feed:javascript:alert(1)' ) );
- $this->assertEquals( '', esc_url( 'feed:javascript:feed:alert(1)' ) );
- $this->assertEquals( '', esc_url( 'feed:feed:javascript:alert(1)' ) );
- $this->assertEquals( 'feed:feed:alert(1)', esc_url( 'feed:feed:alert(1)' ) );
- $this->assertEquals( 'feed:http://wordpress.org/feed/', esc_url( 'feed:http://wordpress.org/feed/' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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/' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -174,15 +174,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 16859
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_square_brackets() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/example.php?one%5B%5D=two', esc_url( '/example.php?one[]=two' ) );
- $this->assertEquals( '?foo%5Bbar%5D=baz', esc_url( '?foo[bar]=baz' ) );
- $this->assertEquals( '//example.com/?foo%5Bbar%5D=baz', esc_url( '//example.com/?foo[bar]=baz' ) );
- $this->assertEquals( 'http://example.com/?foo%5Bbar%5D=baz', esc_url( 'example.com/?foo[bar]=baz' ) );
- $this->assertEquals( 'http://localhost?foo%5Bbar%5D=baz', esc_url( 'localhost?foo[bar]=baz' ) );
- $this->assertEquals( 'http://example.com/?foo%5Bbar%5D=baz', esc_url( 'http://example.com/?foo[bar]=baz' ) );
- $this->assertEquals( 'http://example.com/?foo%5Bbar%5D=baz', esc_url( 'http://example.com/?foo%5Bbar%5D=baz' ) );
- $this->assertEquals( 'http://example.com/?baz=bar&foo%5Bbar%5D=baz', esc_url( 'http://example.com/?baz=bar&foo[bar]=baz' ) );
- $this->assertEquals( 'http://example.com/?baz=bar&foo%5Bbar%5D=baz', esc_url( 'http://example.com/?baz=bar&foo%5Bbar%5D=baz' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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&foo%5Bbar%5D=baz', esc_url( 'http://example.com/?baz=bar&foo[bar]=baz' ) );
+ $this->assertSame( 'http://example.com/?baz=bar&foo%5Bbar%5D=baz', esc_url( 'http://example.com/?baz=bar&foo%5Bbar%5D=baz' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -190,7 +190,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_reserved_characters() {
</span><span class="cx" style="display: block; padding: 0 10px"> $url = "http://example.com/:@-._~!$&'()*+,=;:@-._~!$&'()*+,=:@-._~!$&'()*+,==?/?:@-._~!$%27()*+,;=/?:@-._~!$%27()*+,;==#/?:@-._~!$&'()*+,;=";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $url, esc_url_raw( $url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $url, esc_url_raw( $url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -197,7 +197,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 21974
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_protocol_relative_with_colon() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '//example.com/foo?foo=abc:def', esc_url( '//example.com/foo?foo=abc:def' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '//example.com/foo?foo=abc:def', esc_url( '//example.com/foo?foo=abc:def' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -212,7 +212,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $body = str_replace( "\r\n", "\n", $body );
</span><span class="cx" style="display: block; padding: 0 10px"> $email_link = 'mailto:?body=' . rawurlencode( $body );
</span><span class="cx" style="display: block; padding: 0 10px"> $email_link = esc_url( $email_link );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'mailto:?body=Hi%20there%2C%0A%0AI%20thought%20you%20might%20want%20to%20sign%20up%20for%20this%20newsletter', $email_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'mailto:?body=Hi%20there%2C%0A%0AI%20thought%20you%20might%20want%20to%20sign%20up%20for%20this%20newsletter', $email_link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -227,7 +227,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $body = str_replace( "\r\n", "\n", $body );
</span><span class="cx" style="display: block; padding: 0 10px"> $email_link = 'http://example.com/mailto:?body=' . rawurlencode( $body );
</span><span class="cx" style="display: block; padding: 0 10px"> $email_link = esc_url( $email_link );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://example.com/mailto:?body=Hi%20there%2CI%20thought%20you%20might%20want%20to%20sign%20up%20for%20this%20newsletter', $email_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://example.com/mailto:?body=Hi%20there%2CI%20thought%20you%20might%20want%20to%20sign%20up%20for%20this%20newsletter', $email_link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -238,7 +238,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $email_link = 'mailto:?body=' . $body;
</span><span class="cx" style="display: block; padding: 0 10px"> $email_link = esc_url( $email_link );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'mailto:?body=Hi%20there,%20I%20thought%20you%20might%20want%20to%20sign%20up%20for%20this%20newsletter', $email_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'mailto:?body=Hi%20there,%20I%20thought%20you%20might%20want%20to%20sign%20up%20for%20this%20newsletter', $email_link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -252,14 +252,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 34202
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_ipv6_hosts() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '//[::127.0.0.1]', esc_url( '//[::127.0.0.1]' ) );
- $this->assertEquals( 'http://[::FFFF::127.0.0.1]', esc_url( 'http://[::FFFF::127.0.0.1]' ) );
- $this->assertEquals( 'http://[::127.0.0.1]', esc_url( 'http://[::127.0.0.1]' ) );
- $this->assertEquals( 'http://[::DEAD:BEEF:DEAD:BEEF:DEAD:BEEF:DEAD:BEEF]', esc_url( 'http://[::DEAD:BEEF:DEAD:BEEF:DEAD:BEEF:DEAD:BEEF]' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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]' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // IPv6 with square brackets in the query? Why not.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '//[::FFFF::127.0.0.1]/?foo%5Bbar%5D=baz', esc_url( '//[::FFFF::127.0.0.1]/?foo[bar]=baz' ) );
- $this->assertEquals( 'http://[::FFFF::127.0.0.1]/?foo%5Bbar%5D=baz', esc_url( 'http://[::FFFF::127.0.0.1]/?foo[bar]=baz' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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 class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingEscXmlphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/EscXml.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,7 +14,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_esc_xml_basics( $source, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = esc_xml( $source );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,7 +49,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $source = 'penn & teller & at&t';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = 'penn & teller & at&t';
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = esc_xml( $source );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_escapes_greater_and_less_than() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,7 +56,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $source = 'this > that < that <randomhtml />';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = 'this > that < that <randomhtml />';
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = esc_xml( $source );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_escapes_html_named_entities() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,7 +63,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $source = 'this & is a … followed by › and more and a &nonexistent; entity';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = 'this & is a … followed by › and more and a &nonexistent; entity';
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = esc_xml( $source );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_ignores_existing_entities() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,7 +71,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // note that _wp_specialchars() strips leading 0's from numeric character references.
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '& £ " &';
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = esc_xml( $source );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -84,7 +84,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_ignores_cdata_sections( $source, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = esc_xml( $source );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingExcerptRemoveBlocksphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/ExcerptRemoveBlocks.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -99,7 +99,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( excerpt_remove_blocks( $content ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Dynamic block with options, embedded in other content.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->filtered_content, excerpt_remove_blocks( $this->content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->filtered_content, excerpt_remove_blocks( $this->content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingGetUrlInContentphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/GetUrlInContent.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,6 +45,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider get_input_output
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_url_in_content( $in_str, $exp_str ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $exp_str, get_url_in_content( $in_str ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $exp_str, get_url_in_content( $in_str ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingHtmlExcerptphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/HtmlExcerpt.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,15 +5,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_HtmlExcerpt extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px"> function test_simple() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Baba', wp_html_excerpt( 'Baba told me not to come', 4 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Baba', wp_html_excerpt( 'Baba told me not to come', 4 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> function test_html() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Baba', wp_html_excerpt( "<a href='http://baba.net/'>Baba</a> told me not to come", 4 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Baba', wp_html_excerpt( "<a href='http://baba.net/'>Baba</a> told me not to come", 4 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> function test_entities() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Baba', wp_html_excerpt( 'Baba & Dyado', 8 ) );
- $this->assertEquals( 'Baba', wp_html_excerpt( 'Baba & Dyado', 8 ) );
- $this->assertEquals( 'Baba & D', wp_html_excerpt( 'Baba & Dyado', 12 ) );
- $this->assertEquals( 'Baba & Dyado', wp_html_excerpt( 'Baba & Dyado', 100 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Baba', wp_html_excerpt( 'Baba & Dyado', 8 ) );
+ $this->assertSame( 'Baba', wp_html_excerpt( 'Baba & Dyado', 8 ) );
+ $this->assertSame( 'Baba & D', wp_html_excerpt( 'Baba & Dyado', 12 ) );
+ $this->assertSame( 'Baba & Dyado', wp_html_excerpt( 'Baba & Dyado', 100 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingHumanTimeDiffphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/HumanTimeDiff.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,7 +13,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_human_time_diff( $expected, $stopdate, $message ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $startdate = new DateTime( '2016-01-01 12:00:00' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, human_time_diff( $startdate->format( 'U' ), $stopdate->format( 'U' ) ), $message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, human_time_diff( $startdate->format( 'U' ), $stopdate->format( 'U' ) ), $message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Data for test_human_time_diff.
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingIsEmailphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/IsEmail.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,7 +13,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'a@b.co',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $data as $datum ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $datum, is_email( $datum ), $datum );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $datum, is_email( $datum ), $datum );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingJSEscapephp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/JSEscape.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,13 +6,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_JSEscape extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px"> function test_js_escape_simple() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = esc_js( 'foo bar baz();' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo bar baz();', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo bar baz();', $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_js_escape_quotes() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = esc_js( 'foo "bar" \'baz\'' );
</span><span class="cx" style="display: block; padding: 0 10px"> // Does it make any sense to change " into "? Why not \"?
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "foo "bar" \'baz\'", $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "foo "bar" \'baz\'", $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_js_escape_backslash() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -19,17 +19,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $bs = '\\';
</span><span class="cx" style="display: block; padding: 0 10px"> $out = esc_js( 'foo ' . $bs . 't bar ' . $bs . $bs . ' baz' );
</span><span class="cx" style="display: block; padding: 0 10px"> // \t becomes t - bug?
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo t bar ' . $bs . $bs . ' baz', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo t bar ' . $bs . $bs . ' baz', $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_js_escape_amp() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = esc_js( 'foo & bar &baz; ' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo & bar &baz; ', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo & bar &baz; ', $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_js_escape_quote_entity() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = esc_js( 'foo ' bar ' baz &' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "foo \\' bar \\' baz &", $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "foo \\' bar \\' baz &", $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_js_no_carriage_return() {
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingLikeEscapephp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/LikeEscape.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,7 +24,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $inputs as $key => $input ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected[ $key ], like_escape( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected[ $key ], like_escape( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingLinksAddTargetphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/LinksAddTarget.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,11 +74,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_normalize_whitespace( $content, $target, $tags, $exp_str ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( true === is_null( $target ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $exp_str, links_add_target( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $exp_str, links_add_target( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( true === is_null( $tags ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $exp_str, links_add_target( $content, $target ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $exp_str, links_add_target( $content, $target ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $exp_str, links_add_target( $content, $target, $tags ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $exp_str, links_add_target( $content, $target, $tags ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingMakeClickablephp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/MakeClickable.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,7 +6,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_MakeClickable extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px"> function test_mailto_xss() {
</span><span class="cx" style="display: block; padding: 0 10px"> $in = 'testzzz@"STYLE="behavior:url(\'#default#time2\')"onBegin="alert(\'refresh-XSS\')"';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $in, make_clickable( $in ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $in, make_clickable( $in ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_valid_mailto() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -18,7 +18,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo@example-example.com',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $valid_emails as $email ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<a href="mailto:' . $email . '">' . $email . '</a>', make_clickable( $email ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<a href="mailto:' . $email . '">' . $email . '</a>', make_clickable( $email ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,7 +32,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo@example',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $invalid_emails as $email ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $email, make_clickable( $email ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $email, make_clickable( $email ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,7 +59,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $urls_before as $key => $url ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $urls_expected[ $key ], make_clickable( $url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -88,7 +88,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $urls_before as $key => $url ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $urls_expected[ $key ], make_clickable( $url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -115,7 +115,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $urls_before as $key => $url ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $urls_expected[ $key ], make_clickable( $url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -142,7 +142,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $urls_before as $key => $url ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $urls_expected[ $key ], make_clickable( $url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -161,7 +161,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '<a href="http://example.com/?a=баба&b=дядо" rel="nofollow">http://example.com/?a=баба&b=дядо</a>',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $urls_before as $key => $url ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $urls_expected[ $key ], make_clickable( $url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -198,7 +198,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> Richard Hamming wrote about people getting more done with their doors closed, but',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $urls_before as $key => $url ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $urls_expected[ $key ], make_clickable( $url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -221,7 +221,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '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...',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $urls_before as $key => $url ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $urls_expected[ $key ], make_clickable( $url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -240,7 +240,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'This is a really good tweet <a href="http://twitter.com/#!/wordpress/status/25907440233" rel="nofollow">http://twitter.com/#!/wordpress/status/25907440233</a>!',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $urls_before as $key => $url ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $urls_expected[ $key ], make_clickable( $url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -256,7 +256,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'mailto wrapped in angle brackets <foo@example.com>',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $before as $key => $url ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected[ $key ], make_clickable( $url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected[ $key ], make_clickable( $url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -278,7 +278,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'Question mark then URL?<a href="http://example.com/" rel="nofollow">http://example.com/</a>',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $before as $key => $url ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected[ $key ], make_clickable( $url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected[ $key ], make_clickable( $url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -302,7 +302,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '<a href="http://example.com/example.gif" title="Image from http://example.com">Look at this image!</a>',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $urls_before as $key => $url ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $urls_expected[ $key ], make_clickable( $url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -343,7 +343,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $before as $key => $url ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected[ $key ], make_clickable( $url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected[ $key ], make_clickable( $url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -360,7 +360,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '<p><a href="http://example.com/" rel="nofollow">http://example.com/</a></p>',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $urls_before as $key => $url ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $urls_expected[ $key ], make_clickable( $url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -370,7 +370,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // '<a href="http://wordpress.org">This is already a link www.wordpress.org</a>', // Fails in 3.3.1 too.
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $in as $text ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $text, make_clickable( $text ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $text, make_clickable( $text ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -380,7 +380,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_no_segfault() {
</span><span class="cx" style="display: block; padding: 0 10px"> $in = str_repeat( 'http://example.com/2011/03/18/post-title/', 256 );
</span><span class="cx" style="display: block; padding: 0 10px"> $out = make_clickable( $in );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $in, $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $in, $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -389,7 +389,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_line_break_in_existing_clickable_link() {
</span><span class="cx" style="display: block; padding: 0 10px"> $html = "<a
</span><span class="cx" style="display: block; padding: 0 10px"> href='mailto:someone@example.com'>someone@example.com</a>";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $html, make_clickable( $html ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $html, make_clickable( $html ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -397,7 +397,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_script_and_style_tags
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_dont_link_script_and_style_tags( $tag ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $tag, make_clickable( $tag ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $tag, make_clickable( $tag ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_script_and_style_tags() {
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingMapDeepphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/MapDeep.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,11 +7,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_MapDeep extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_map_deep_with_any_function_over_empty_array_should_return_empty_array() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), map_deep( array(), array( $this, 'append_baba' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), map_deep( array(), array( $this, 'append_baba' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_map_deep_should_map_each_element_of_array_one_level_deep() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'ababa',
</span><span class="cx" style="display: block; padding: 0 10px"> 'xbaba',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_map_deep_should_map_each_element_of_array_two_levels_deep() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'ababa',
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,11 +67,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_map_deep_should_apply_the_function_to_a_string() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'xbaba', map_deep( 'x', array( $this, 'append_baba' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'xbaba', map_deep( 'x', array( $this, 'append_baba' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_map_deep_should_apply_the_function_to_an_integer() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '5baba', map_deep( 5, array( $this, 'append_baba' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '5baba', map_deep( 5, array( $this, 'append_baba' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_map_deep_should_map_each_property_of_an_object() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -157,7 +157,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'var0' => &$array_a['var0'],
</span><span class="cx" style="display: block; padding: 0 10px"> 'var1' => 'x',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'var0' => 'ababa',
</span><span class="cx" style="display: block; padding: 0 10px"> 'var1' => 'xbaba',
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingNormalizeWhitespacephp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/NormalizeWhitespace.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,6 +47,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider get_input_output
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_normalize_whitespace( $in_str, $exp_str ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $exp_str, normalize_whitespace( $in_str ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $exp_str, normalize_whitespace( $in_str ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingRemoveAccentsphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/RemoveAccents.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,7 +5,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_RemoveAccents extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_remove_accents_simple() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'abcdefghijkl', remove_accents( 'abcdefghijkl' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'abcdefghijkl', remove_accents( 'abcdefghijkl' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,7 +15,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $input = 'ªºÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ';
</span><span class="cx" style="display: block; padding: 0 10px"> $output = 'aoAAAAAAAECEEEEIIIIDNOOOOOOUUUUYTHsaaaaaaaeceeeeiiiidnoooooouuuuythy';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $output, remove_accents( $input ), 'remove_accents replaces Latin-1 Supplement' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $output, remove_accents( $input ), 'remove_accents replaces Latin-1 Supplement' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_remove_accents_latin_extended_a() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,16 +22,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $input = 'ĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıIJijĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſ';
</span><span class="cx" style="display: block; padding: 0 10px"> $output = 'AaAaAaCcCcCcCcDdDdEeEeEeEeEeGgGgGgGgHhHhIiIiIiIiIiIJijJjKkkLlLlLlLlLlNnNnNnnNnOoOoOoOEoeRrRrRrSsSsSsSsTtTtTtUuUuUuUuUuUuWwYyYZzZzZzs';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $output, remove_accents( $input ), 'remove_accents replaces Latin Extended A' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $output, remove_accents( $input ), 'remove_accents replaces Latin Extended A' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_remove_accents_latin_extended_b() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'SsTt', remove_accents( 'ȘșȚț' ), 'remove_accents replaces Latin Extended B' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'SsTt', remove_accents( 'ȘșȚț' ), 'remove_accents replaces Latin Extended B' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_remove_accents_euro_pound_signs() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'E', remove_accents( '€' ), 'remove_accents replaces euro sign' );
- $this->assertEquals( '', remove_accents( '£' ), 'remove_accents replaces pound sign' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'E', remove_accents( '€' ), 'remove_accents replaces euro sign' );
+ $this->assertSame( '', remove_accents( '£' ), 'remove_accents replaces pound sign' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_remove_accents_iso8859() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,7 +41,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $input = trim( $input );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = 'EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyyOEoeAEDHTHssaedhth';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $output, remove_accents( $input ), 'remove_accents from ISO-8859-1 text' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $output, remove_accents( $input ), 'remove_accents from ISO-8859-1 text' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -50,17 +50,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_remove_accents_vowels_diacritic() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Vowels with diacritic.
</span><span class="cx" style="display: block; padding: 0 10px"> // Unmarked.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'OoUu', remove_accents( 'ƠơƯư' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'OoUu', remove_accents( 'ƠơƯư' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Grave accent.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'AaAaEeOoOoUuYy', remove_accents( 'ẦầẰằỀềỒồỜờỪừỲỳ' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'AaAaEeOoOoUuYy', remove_accents( 'ẦầẰằỀềỒồỜờỪừỲỳ' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Hook.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'AaAaAaEeEeIiOoOoOoUuUuYy', remove_accents( 'ẢảẨẩẲẳẺẻỂểỈỉỎỏỔổỞởỦủỬửỶỷ' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'AaAaAaEeEeIiOoOoOoUuUuYy', remove_accents( 'ẢảẨẩẲẳẺẻỂểỈỉỎỏỔổỞởỦủỬửỶỷ' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Tilde.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'AaAaEeEeOoOoUuYy', remove_accents( 'ẪẫẴẵẼẽỄễỖỗỠỡỮữỸỹ' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'AaAaEeEeOoOoUuYy', remove_accents( 'ẪẫẴẵẼẽỄễỖỗỠỡỮữỸỹ' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Acute accent.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'AaAaEeOoOoUu', remove_accents( 'ẤấẮắẾếỐốỚớỨứ' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'AaAaEeOoOoUu', remove_accents( 'ẤấẮắẾếỐốỚớỨứ' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Dot below.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'AaAaAaEeEeIiOoOoOoUuUuYy', remove_accents( 'ẠạẬậẶặẸẹỆệỊịỌọỘộỢợỤụỰựỴỵ' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'AaAaAaEeEeIiOoOoOoUuUuYy', remove_accents( 'ẠạẬậẶặẸẹỆệỊịỌọỘộỢợỤụỰựỴỵ' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -69,15 +69,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_remove_accents_hanyu_pinyin() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Vowels with diacritic (Chinese, Hanyu Pinyin).
</span><span class="cx" style="display: block; padding: 0 10px"> // Macron.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'aeiouuAEIOUU', remove_accents( 'āēīōūǖĀĒĪŌŪǕ' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'aeiouuAEIOUU', remove_accents( 'āēīōūǖĀĒĪŌŪǕ' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Acute accent.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'aeiouuAEIOUU', remove_accents( 'áéíóúǘÁÉÍÓÚǗ' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'aeiouuAEIOUU', remove_accents( 'áéíóúǘÁÉÍÓÚǗ' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Caron.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'aeiouuAEIOUU', remove_accents( 'ǎěǐǒǔǚǍĚǏǑǓǙ' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'aeiouuAEIOUU', remove_accents( 'ǎěǐǒǔǚǍĚǏǑǓǙ' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Grave accent.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'aeiouuAEIOUU', remove_accents( 'àèìòùǜÀÈÌÒÙǛ' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'aeiouuAEIOUU', remove_accents( 'àèìòùǜÀÈÌÒÙǛ' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Unmarked.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'aaeiouuAEIOUU', remove_accents( 'aɑeiouüAEIOUÜ' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'aaeiouuAEIOUU', remove_accents( 'aɑeiouüAEIOUÜ' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function _remove_accents_germanic_umlauts_cb() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,7 +90,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_remove_accents_germanic_umlauts() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'locale', array( $this, '_remove_accents_germanic_umlauts_cb' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'AeOeUeaeoeuess', remove_accents( 'ÄÖÜäöüß' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'AeOeUeaeoeuess', remove_accents( 'ÄÖÜäöüß' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'locale', array( $this, '_remove_accents_germanic_umlauts_cb' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -105,7 +105,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_remove_danish_accents() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'locale', array( $this, '_set_locale_to_danish' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'AeOeAaaeoeaa', remove_accents( 'ÆØÅæøå' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'AeOeAaaeoeaa', remove_accents( 'ÆØÅæøå' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'locale', array( $this, '_set_locale_to_danish' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -120,11 +120,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_remove_catalan_middot() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'locale', array( $this, '_set_locale_to_catalan' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'allallalla', remove_accents( 'al·lallaŀla' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'allallalla', remove_accents( 'al·lallaŀla' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'locale', array( $this, '_set_locale_to_catalan' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'al·lallalla', remove_accents( 'al·lallaŀla' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'al·lallalla', remove_accents( 'al·lallaŀla' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function _set_locale_to_serbian() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,10 +137,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_transcribe_serbian_crossed_d() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'locale', array( $this, '_set_locale_to_serbian' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'DJdj', remove_accents( 'Đđ' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'DJdj', remove_accents( 'Đđ' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'locale', array( $this, '_set_locale_to_serbian' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Dd', remove_accents( 'Đđ' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Dd', remove_accents( 'Đđ' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingSanitizeFileNamephp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/SanitizeFileName.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,7 +7,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_munges_extensions() {
</span><span class="cx" style="display: block; padding: 0 10px"> # r17990
</span><span class="cx" style="display: block; padding: 0 10px"> $file_name = sanitize_file_name( 'test.phtml.txt' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test.phtml_.txt', $file_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test.phtml_.txt', $file_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_removes_special_chars() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,7 +17,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $string .= $char;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $string .= 'test';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'testtest', sanitize_file_name( $string ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'testtest', sanitize_file_name( $string ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,7 +26,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_removes_accents() {
</span><span class="cx" style="display: block; padding: 0 10px"> $in = 'àáâãäåæçèéêëìíîïñòóôõöøùúûüýÿ';
</span><span class="cx" style="display: block; padding: 0 10px"> $out = 'aaaaaaaeceeeeiiiinoooooouuuuyy';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $out, sanitize_file_name( $in ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $out, sanitize_file_name( $in ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,21 +43,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $urls as $test => $expected ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, sanitize_file_name( $test ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, sanitize_file_name( $test ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_any_number_of_hyphens_with_one_hyphen() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a-t-t', sanitize_file_name( 'a----t----t' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a-t-t', sanitize_file_name( 'a----t----t' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_trims_trailing_hyphens() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a-t-t', sanitize_file_name( 'a----t----t----' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a-t-t', sanitize_file_name( 'a----t----t----' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_any_amount_of_whitespace_with_one_hyphen() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a-t', sanitize_file_name( 'a t' ) );
- $this->assertEquals( 'a-t', sanitize_file_name( "a \n\n\nt" ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a-t', sanitize_file_name( 'a t' ) );
+ $this->assertSame( 'a-t', sanitize_file_name( "a \n\n\nt" ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,18 +64,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 16226
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_percent_sign() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a22b.jpg', sanitize_file_name( 'a%22b.jpg' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a22b.jpg', sanitize_file_name( 'a%22b.jpg' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_unnamed_file_extensions() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Test filenames with both supported and unsupported extensions.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'unnamed-file.exe', sanitize_file_name( '_.exe' ) );
- $this->assertEquals( 'unnamed-file.jpg', sanitize_file_name( '_.jpg' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'unnamed-file.exe', sanitize_file_name( '_.exe' ) );
+ $this->assertSame( 'unnamed-file.jpg', sanitize_file_name( '_.jpg' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_unnamed_file_extensionless() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Test a filenames that becomes extensionless.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'no-extension', sanitize_file_name( '_.no-extension' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'no-extension', sanitize_file_name( '_.no-extension' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -82,7 +82,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_wp_filenames
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_invalid_utf8_characters( $input, $expected ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, sanitize_file_name( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, sanitize_file_name( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_wp_filenames() {
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingSanitizeMimeTypephp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/SanitizeMimeType.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -35,7 +35,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $inputs as $input ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $input, sanitize_mime_type( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $input, sanitize_mime_type( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingSanitizeOrderbyphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/SanitizeOrderby.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,7 +10,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider valid_orderbys
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_valid( $orderby ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $orderby, sanitize_sql_orderby( $orderby ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $orderby, sanitize_sql_orderby( $orderby ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> function valid_orderbys() {
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingSanitizeTextFieldphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/SanitizeTextField.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -136,8 +136,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_oneline = $expected;
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_multiline = $expected;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_oneline, sanitize_text_field( $string ) );
- $this->assertEqualsIgnoreEOL( $expected_multiline, sanitize_textarea_field( $string ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_oneline, sanitize_text_field( $string ) );
+ $this->assertSameIgnoreEOL( $expected_multiline, sanitize_textarea_field( $string ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingSanitizeTitlephp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/SanitizeTitle.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,12 +7,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_strips_html() {
</span><span class="cx" style="display: block; padding: 0 10px"> $input = 'Captain <strong>Awesome</strong>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = 'captain-awesome';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, sanitize_title( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, sanitize_title( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_titles_sanitized_to_nothing_are_replaced_with_optional_fallback() {
</span><span class="cx" style="display: block; padding: 0 10px"> $input = '<strong></strong>';
</span><span class="cx" style="display: block; padding: 0 10px"> $fallback = 'Captain Awesome';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $fallback, sanitize_title( $input, $fallback ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $fallback, sanitize_title( $input, $fallback ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingSanitizeTitleWithDashesphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/SanitizeTitleWithDashes.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,60 +7,60 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_strips_html() {
</span><span class="cx" style="display: block; padding: 0 10px"> $input = 'Captain <strong>Awesome</strong>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = 'captain-awesome';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, sanitize_title( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, sanitize_title( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_strips_unencoded_percent_signs() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'fran%c3%a7ois', sanitize_title_with_dashes( 'fran%c3%a7%ois' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'fran%c3%a7ois', sanitize_title_with_dashes( 'fran%c3%a7%ois' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_makes_title_lowercase() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'abc', sanitize_title_with_dashes( 'ABC' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'abc', sanitize_title_with_dashes( 'ABC' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_any_amount_of_whitespace_with_one_hyphen() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a-t', sanitize_title_with_dashes( 'a t' ) );
- $this->assertEquals( 'a-t', sanitize_title_with_dashes( "a \n\n\nt" ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a-t', sanitize_title_with_dashes( 'a t' ) );
+ $this->assertSame( 'a-t', sanitize_title_with_dashes( "a \n\n\nt" ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_any_number_of_hyphens_with_one_hyphen() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a-t-t', sanitize_title_with_dashes( 'a----t----t' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a-t-t', sanitize_title_with_dashes( 'a----t----t' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_trims_trailing_hyphens() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a-t-t', sanitize_title_with_dashes( 'a----t----t----' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a-t-t', sanitize_title_with_dashes( 'a----t----t----' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_handles_non_entity_ampersands() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'penn-teller-bull', sanitize_title_with_dashes( 'penn & teller bull' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'penn-teller-bull', sanitize_title_with_dashes( 'penn & teller bull' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_strips_nbsp_ndash_and_amp() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'no-entities-here', sanitize_title_with_dashes( 'No Entities – Here &' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'no-entities-here', sanitize_title_with_dashes( 'No Entities – Here &' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_strips_encoded_ampersand() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'one-two', sanitize_title_with_dashes( 'One & Two', '', 'save' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'one-two', sanitize_title_with_dashes( 'One & Two', '', 'save' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_strips_url_encoded_ampersand() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'one-two', sanitize_title_with_dashes( 'One { Two;', '', 'save' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'one-two', sanitize_title_with_dashes( 'One { Two;', '', 'save' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_strips_trademark_symbol() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'one-two', sanitize_title_with_dashes( 'One Two™;', '', 'save' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'one-two', sanitize_title_with_dashes( 'One Two™;', '', 'save' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_strips_unencoded_ampersand_followed_by_encoded_ampersand() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'one-two', sanitize_title_with_dashes( 'One && Two;', '', 'save' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'one-two', sanitize_title_with_dashes( 'One && Two;', '', 'save' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_strips_unencoded_ampersand_when_not_surrounded_by_spaces() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'onetwo', sanitize_title_with_dashes( 'One&Two', '', 'save' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'onetwo', sanitize_title_with_dashes( 'One&Two', '', 'save' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_nbsp() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'dont-break-the-space', sanitize_title_with_dashes( "don't break the space", '', 'save' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'dont-break-the-space', sanitize_title_with_dashes( "don't break the space", '', 'save' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,12 +67,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 31790
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_nbsp_entities() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'dont-break-the-space', sanitize_title_with_dashes( "don't break the space", '', 'save' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'dont-break-the-space', sanitize_title_with_dashes( "don't break the space", '', 'save' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_ndash_mdash() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'do-the-dash', sanitize_title_with_dashes( 'Do – the Dash', '', 'save' ) );
- $this->assertEquals( 'do-the-dash', sanitize_title_with_dashes( 'Do the — Dash', '', 'save' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -79,26 +79,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 31790
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_ndash_mdash_entities() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'do-the-dash', sanitize_title_with_dashes( 'Do – the – Dash', '', 'save' ) );
- $this->assertEquals( 'do-the-dash', sanitize_title_with_dashes( 'Do — the — Dash', '', 'save' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_iexcel_iquest() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'just-a-slug', sanitize_title_with_dashes( 'Just ¡a Slug', '', 'save' ) );
- $this->assertEquals( 'just-a-slug', sanitize_title_with_dashes( 'Just a Slug¿', '', 'save' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_angle_quotes() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'just-a-slug', sanitize_title_with_dashes( '‹Just a Slug›', '', 'save' ) );
- $this->assertEquals( 'just-a-slug', sanitize_title_with_dashes( '«Just a Slug»', '', 'save' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_curly_quotes() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'hey-its-curly-joe', sanitize_title_with_dashes( 'Hey its “Curly Joe”', '', 'save' ) );
- $this->assertEquals( 'hey-its-curly-joe', sanitize_title_with_dashes( 'Hey its ‘Curly Joe’', '', 'save' ) );
- $this->assertEquals( 'hey-its-curly-joe', sanitize_title_with_dashes( 'Hey its „Curly Joe“', '', 'save' ) );
- $this->assertEquals( 'hey-its-curly-joe', sanitize_title_with_dashes( 'Hey its ‚Curly Joe‛', '', 'save' ) );
- $this->assertEquals( 'hey-its-curly-joe', sanitize_title_with_dashes( 'Hey its „Curly Joe‟', '', 'save' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -105,14 +105,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49791
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_bullet() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'fancy-title-amazing', sanitize_title_with_dashes( 'Fancy Title • Amazing', '', 'save' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'fancy-title-amazing', sanitize_title_with_dashes( 'Fancy Title • Amazing', '', 'save' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_copy_reg_deg_trade() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'just-a-slug', sanitize_title_with_dashes( 'Just © a Slug', '', 'save' ) );
- $this->assertEquals( 'just-a-slug', sanitize_title_with_dashes( '® Just a Slug', '', 'save' ) );
- $this->assertEquals( 'just-a-slug', sanitize_title_with_dashes( 'Just a ° Slug', '', 'save' ) );
- $this->assertEquals( 'just-a-slug', sanitize_title_with_dashes( 'Just ™ a Slug', '', 'save' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -119,11 +119,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 10792
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_forward_slash() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'songs-by-lennon-mccartney', sanitize_title_with_dashes( 'songs by Lennon/McCartney', '', 'save' ) );
- $this->assertEquals( 'songs-by-lennon-mccartney', sanitize_title_with_dashes( 'songs by Lennon//McCartney', '', 'save' ) );
- $this->assertEquals( 'songs-by-lennon-mccartney', sanitize_title_with_dashes( 'songs by Lennon///McCartney', '', 'save' ) );
- $this->assertEquals( 'songs-by-lennon-mccartney', sanitize_title_with_dashes( 'songs by Lennon/-McCartney', '', 'save' ) );
- $this->assertEquals( 'songs-by-lennon-mccartney', sanitize_title_with_dashes( '//songs by Lennon/McCartney', '', 'save' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,7 +130,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 19820
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_multiply_sign() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '6x7-is-42', sanitize_title_with_dashes( '6×7 is 42', '', 'save' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '6x7-is-42', sanitize_title_with_dashes( '6×7 is 42', '', 'save' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,7 +137,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 20772
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_standalone_diacritic() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'aaaa', sanitize_title_with_dashes( 'āáǎà', '', 'save' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'aaaa', sanitize_title_with_dashes( 'āáǎà', '', 'save' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -144,7 +144,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 22395
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_replaces_acute_accents() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'aaaa', sanitize_title_with_dashes( 'ááa´aˊ', '', 'save' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'aaaa', sanitize_title_with_dashes( 'ááa´aˊ', '', 'save' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingSanitizeTrackbackUrlsphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/SanitizeTrackbackUrls.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,7 +9,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider breaks
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_sanitize_trackback_urls_with_multiple_urls( $break ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "http://example.com\nhttp://example.org", sanitize_trackback_urls( "http://example.com{$break}http://example.org" ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "http://example.com\nhttp://example.org", sanitize_trackback_urls( "http://example.com{$break}http://example.org" ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function breaks() {
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingSanitizeUserphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/SanitizeUser.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,7 +7,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_strips_html() {
</span><span class="cx" style="display: block; padding: 0 10px"> $input = 'Captain <strong>Awesome</strong>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = is_multisite() ? 'captain awesome' : 'Captain Awesome';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, sanitize_user( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, sanitize_user( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_strips_encoded_ampersand() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -18,7 +18,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = strtolower( $expected );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, sanitize_user( 'AT&T' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, sanitize_user( 'AT&T' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_strips_encoded_ampersand_when_followed_by_semicolon() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,14 +29,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = strtolower( $expected );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, sanitize_user( 'AT&T Test;' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, sanitize_user( 'AT&T Test;' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_strips_percent_encoded_octets() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = is_multisite() ? 'franois' : 'Franois';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, sanitize_user( 'Fran%c3%a7ois' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, sanitize_user( 'Fran%c3%a7ois' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> function test_optional_strict_mode_reduces_to_safe_ascii_subset() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'abc', sanitize_user( '()~ab~ˆcˆ!', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'abc', sanitize_user( '()~ab~ˆcˆ!', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingSlashitphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/Slashit.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,20 +5,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_Slashit extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px"> function test_backslashes_middle_numbers() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "\\a-!9\\a943\\b\\c", backslashit( 'a-!9a943bc' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "\\a-!9\\a943\\b\\c", backslashit( 'a-!9a943bc' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_backslashes_alphas() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "\\a943\\b\\c", backslashit( 'a943bc' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "\\a943\\b\\c", backslashit( 'a943bc' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_double_backslashes_leading_numbers() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '\\\\95', backslashit( '95' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '\\\\95', backslashit( '95' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_removes_trailing_slashes() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a', untrailingslashit( 'a/' ) );
- $this->assertEquals( 'a', untrailingslashit( 'a////' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a', untrailingslashit( 'a/' ) );
+ $this->assertSame( 'a', untrailingslashit( 'a////' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,8 +25,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 22267
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_removes_trailing_backslashes() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a', untrailingslashit( 'a\\' ) );
- $this->assertEquals( 'a', untrailingslashit( 'a\\\\\\\\' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a', untrailingslashit( 'a\\' ) );
+ $this->assertSame( 'a', untrailingslashit( 'a\\\\\\\\' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,16 +33,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 22267
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_removes_trailing_mixed_slashes() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a', untrailingslashit( 'a/\\' ) );
- $this->assertEquals( 'a', untrailingslashit( 'a\\/\\///\\\\//' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a', untrailingslashit( 'a/\\' ) );
+ $this->assertSame( 'a', untrailingslashit( 'a\\/\\///\\\\//' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_adds_trailing_slash() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a/', trailingslashit( 'a' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a/', trailingslashit( 'a' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_does_not_add_trailing_slash_if_one_exists() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a/', trailingslashit( 'a/' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a/', trailingslashit( 'a/' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,6 +49,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 22267
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_converts_trailing_backslash_to_slash_if_one_exists() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a/', trailingslashit( 'a\\' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a/', trailingslashit( 'a\\' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingSmiliesphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/Smilies.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,12 +54,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> smilies_init();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $converted_txt, convert_smilies( $in_txt ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Standard smilies, use_smilies: OFF.
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'use_smilies', 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $in_txt, convert_smilies( $in_txt ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $in_txt, convert_smilies( $in_txt ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -112,12 +112,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> smilies_init();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $converted_txt, convert_smilies( $in_txt ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Standard smilies, use_smilies: OFF.
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'use_smilies', 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $in_txt, convert_smilies( $in_txt ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $in_txt, convert_smilies( $in_txt ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wpsmiliestrans = $trans_orig; // Reset original translations array.
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -153,7 +153,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'use_smilies', 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> smilies_init();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $exp_str, convert_smilies( $in_str ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $exp_str, convert_smilies( $in_str ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Standard smilies, use_smilies: OFF.
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'use_smilies', 0 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -205,12 +205,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'use_smilies', 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> smilies_init();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $converted_txt, convert_smilies( $in_txt ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Custom smilies, use_smilies: OFF.
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'use_smilies', 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $in_txt, convert_smilies( $in_txt ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $in_txt, convert_smilies( $in_txt ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -260,12 +260,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> smilies_init();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $converted_txt, convert_smilies( $in_txt ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Standard smilies, use_smilies: OFF.
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'use_smilies', 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $in_txt, convert_smilies( $in_txt ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $in_txt, convert_smilies( $in_txt ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wpsmiliestrans = $orig_trans; // Reset original translations array.
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -305,7 +305,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> smilies_init();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $converted_txt, convert_smilies( $in_txt ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Standard smilies, use_smilies: OFF.
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'use_smilies', 0 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -323,7 +323,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $txt = ':oops: I did it again';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $txt, convert_smilies( $txt ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $txt, convert_smilies( $txt ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -339,7 +339,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $txt = 'You played with my <3';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_txt = 'You played with my \xe2\x9d\xa4';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_txt, convert_smilies( $txt ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_txt, convert_smilies( $txt ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingStripSlashesDeepphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/StripSlashesDeep.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,10 +10,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_preserves_original_datatype() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( true, stripslashes_deep( true ) );
- $this->assertEquals( false, stripslashes_deep( false ) );
- $this->assertEquals( 4, stripslashes_deep( 4 ) );
- $this->assertEquals( 'foo', stripslashes_deep( 'foo' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertTrue( stripslashes_deep( true ) );
+ $this->assertFalse( stripslashes_deep( false ) );
+ $this->assertSame( 4, stripslashes_deep( 4 ) );
+ $this->assertSame( 'foo', stripslashes_deep( 'foo' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $arr = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'a' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'b' => false,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,23 +21,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'd' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $arr['e'] = $arr; // Add a sub-array.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $arr, stripslashes_deep( $arr ) ); // Keyed array.
- $this->assertEquals( array_values( $arr ), stripslashes_deep( array_values( $arr ) ) ); // Non-keyed.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $arr, stripslashes_deep( $arr ) ); // Keyed array.
+ $this->assertSame( array_values( $arr ), stripslashes_deep( array_values( $arr ) ) ); // Non-keyed.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $obj = new stdClass;
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $arr as $k => $v ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $obj->$k = $v;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $obj, stripslashes_deep( $obj ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $obj, stripslashes_deep( $obj ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_strips_slashes() {
</span><span class="cx" style="display: block; padding: 0 10px"> $old = "I can\'t see, isn\'t that it?";
</span><span class="cx" style="display: block; padding: 0 10px"> $new = "I can't see, isn't that it?";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new, stripslashes_deep( $old ) );
- $this->assertEquals( $new, stripslashes_deep( "I can\\'t see, isn\\'t that it?" ) );
- $this->assertEquals( array( 'a' => $new ), stripslashes_deep( array( 'a' => $old ) ) ); // Keyed array.
- $this->assertEquals( array( $new ), stripslashes_deep( array( $old ) ) ); // Non-keyed.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $obj_old = new stdClass;
</span><span class="cx" style="display: block; padding: 0 10px"> $obj_old->a = $old;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,7 +48,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_permits_escaped_slash() {
</span><span class="cx" style="display: block; padding: 0 10px"> $txt = "I can't see, isn\'t that it?";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $txt, stripslashes_deep( "I can\'t see, isn\\\'t that it?" ) );
- $this->assertEquals( $txt, stripslashes_deep( "I can\'t see, isn\\\\\'t that it?" ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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 class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingURLShortenphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/URLShorten.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,10 +14,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'http://wordpress.org/about/philosophy/#decisions' => 'wordpress.org/about/philosophy/#…', // Shorten to 32 if > 35 after cleaning.
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $tests as $k => $v ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $v, url_shorten( $k ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $v, url_shorten( $k ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Shorten to 31 if > 34 after cleaning.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'wordpress.org/about/philosophy/#…', url_shorten( 'http://wordpress.org/about/philosophy/#decisions' ), 31 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'wordpress.org/about/philosophy/#…', url_shorten( 'http://wordpress.org/about/philosophy/#decisions' ), 31 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingUrlencodeDeepphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/UrlencodeDeep.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,7 +28,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $expected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_urlencode_deep_should_encode_individual_value( $actual, $expected ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, urlencode_deep( $actual ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, urlencode_deep( $actual ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,7 +40,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = wp_list_pluck( $data, 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = wp_list_pluck( $data, 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, urlencode_deep( $actual ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, urlencode_deep( $actual ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingUtf8UriEncodephp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/Utf8UriEncode.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -12,7 +12,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_percent_encodes_non_reserved_characters( $utf8, $urlencoded ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $urlencoded, utf8_uri_encode( $utf8 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $urlencoded, utf8_uri_encode( $utf8 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingWPBasenamephp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/WPBasename.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,7 +6,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_WP_Basename extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_basename_unix() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'file',
</span><span class="cx" style="display: block; padding: 0 10px"> wp_basename( '/home/test/file' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,7 +13,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_basename_unix_utf8_support() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'žluťoučký kůň.txt',
</span><span class="cx" style="display: block; padding: 0 10px"> wp_basename( '/test/žluťoučký kůň.txt' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,7 +23,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 22138
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_basename_windows() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'file.txt',
</span><span class="cx" style="display: block; padding: 0 10px"> wp_basename( 'C:\Documents and Settings\User\file.txt' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 22138
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_basename_windows_utf8_support() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'щипцы.txt',
</span><span class="cx" style="display: block; padding: 0 10px"> wp_basename( 'C:\test\щипцы.txt' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingWPMakeLinkRelativephp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/WPMakeLinkRelative.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,13 +8,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_make_link_relative_with_http_scheme() {
</span><span class="cx" style="display: block; padding: 0 10px"> $link = 'http://example.com/this-is-a-test-http-url/';
</span><span class="cx" style="display: block; padding: 0 10px"> $relative_link = wp_make_link_relative( $link );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/this-is-a-test-http-url/', $relative_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/this-is-a-test-http-url/', $relative_link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_make_link_relative_with_https_scheme() {
</span><span class="cx" style="display: block; padding: 0 10px"> $link = 'https://example.com/this-is-a-test-https-url/';
</span><span class="cx" style="display: block; padding: 0 10px"> $relative_link = wp_make_link_relative( $link );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/this-is-a-test-https-url/', $relative_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/this-is-a-test-https-url/', $relative_link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,7 +23,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_make_link_relative_with_no_scheme() {
</span><span class="cx" style="display: block; padding: 0 10px"> $link = '//example.com/this-is-a-test-schemeless-url/';
</span><span class="cx" style="display: block; padding: 0 10px"> $relative_link = wp_make_link_relative( $link );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/this-is-a-test-schemeless-url/', $relative_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/this-is-a-test-schemeless-url/', $relative_link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,7 +32,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_make_link_relative_should_retain_URL_param_that_is_also_a_URL() {
</span><span class="cx" style="display: block; padding: 0 10px"> $link = 'https://example.com/this-is-a-test/?redirect=https://example.org/a-different-test-post/';
</span><span class="cx" style="display: block; padding: 0 10px"> $relative_link = wp_make_link_relative( $link );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/this-is-a-test/?redirect=https://example.org/a-different-test-post/', $relative_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/this-is-a-test/?redirect=https://example.org/a-different-test-post/', $relative_link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,7 +41,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_make_link_relative_with_no_path() {
</span><span class="cx" style="display: block; padding: 0 10px"> $link = 'http://example.com';
</span><span class="cx" style="display: block; padding: 0 10px"> $relative_link = wp_make_link_relative( $link );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $relative_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $relative_link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingWPRelNoFollowphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/WPRelNoFollow.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,7 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_add_no_follow() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<p>This is some cool <a href="/">Code</a></p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>This is some cool <a href=\"/\" rel=\"nofollow\">Code</a></p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_rel_nofollow( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_rel_nofollow( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_convert_no_follow() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<p>This is some cool <a href="/" rel="weird">Code</a></p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>This is some cool <a href=\"/\" rel=\"weird nofollow\">Code</a></p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_rel_nofollow( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_rel_nofollow( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,7 +28,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_wp_rel_nofollow
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_rel_nofollow( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( wp_slash( $output ), wp_rel_nofollow( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( wp_slash( $output ), wp_rel_nofollow( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_wp_rel_nofollow() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,6 +78,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_append_no_follow_with_valueless_attribute() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<p>This is some cool <a href="demo.com" download rel="hola">Code</a></p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>This is some cool <a href=\"demo.com\" download rel=\"hola nofollow\">Code</a></p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_rel_nofollow( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_rel_nofollow( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingWPRelUgcphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/WPRelUgc.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,7 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_add_ugc() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<p>This is some cool <a href="/">Code</a></p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>This is some cool <a href=\"/\" rel=\"nofollow ugc\">Code</a></p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_rel_ugc( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_rel_ugc( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_convert_ugc() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<p>This is some cool <a href="/" rel="weird">Code</a></p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>This is some cool <a href=\"/\" rel=\"weird nofollow ugc\">Code</a></p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_rel_ugc( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_rel_ugc( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,7 +28,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_wp_rel_ugc
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_rel_ugc( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( wp_slash( $output ), wp_rel_ugc( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( wp_slash( $output ), wp_rel_ugc( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_wp_rel_ugc() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,6 +78,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_append_ugc_with_valueless_attribute() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<p>This is some cool <a href="demo.com" download rel="hola">Code</a></p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>This is some cool <a href=\"demo.com\" download rel=\"hola nofollow ugc\">Code</a></p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_rel_ugc( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_rel_ugc( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingWPSlashphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/WPSlash.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -57,10 +57,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_adds_slashes() {
</span><span class="cx" style="display: block; padding: 0 10px"> $old = "I can't see, isn't that it?";
</span><span class="cx" style="display: block; padding: 0 10px"> $new = "I can\'t see, isn\'t that it?";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new, wp_slash( $old ) );
- $this->assertEquals( "I can\\\\\'t see, isn\\\\\'t that it?", wp_slash( $new ) );
- $this->assertEquals( array( 'a' => $new ), wp_slash( array( 'a' => $old ) ) ); // Keyed array.
- $this->assertEquals( array( $new ), wp_slash( array( $old ) ) ); // Non-keyed.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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.
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,10 +68,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_preserves_original_datatype() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( true, wp_slash( true ) );
- $this->assertEquals( false, wp_slash( false ) );
- $this->assertEquals( 4, wp_slash( 4 ) );
- $this->assertEquals( 'foo', wp_slash( 'foo' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertTrue( wp_slash( true ) );
+ $this->assertFalse( wp_slash( false ) );
+ $this->assertSame( 4, wp_slash( 4 ) );
+ $this->assertSame( 'foo', wp_slash( 'foo' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $arr = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'a' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'b' => false,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -79,14 +79,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'd' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $arr['e'] = $arr; // Add a sub-array.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $arr, wp_slash( $arr ) ); // Keyed array.
- $this->assertEquals( array_values( $arr ), wp_slash( array_values( $arr ) ) ); // Non-keyed.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $arr, wp_slash( $arr ) ); // Keyed array.
+ $this->assertSame( array_values( $arr ), wp_slash( array_values( $arr ) ) ); // Non-keyed.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $obj = new stdClass;
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $arr as $k => $v ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $obj->$k = $v;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $obj, wp_slash( $obj ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $obj, wp_slash( $obj ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -95,9 +95,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_add_even_more_slashes() {
</span><span class="cx" style="display: block; padding: 0 10px"> $old = 'single\\slash double\\\\slash triple\\\\\\slash';
</span><span class="cx" style="display: block; padding: 0 10px"> $new = 'single\\\\slash double\\\\\\\\slash triple\\\\\\\\\\\\slash';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new, wp_slash( $old ) );
- $this->assertEquals( array( 'a' => $new ), wp_slash( array( 'a' => $old ) ) ); // Keyed array.
- $this->assertEquals( array( $new ), wp_slash( array( $old ) ) ); // Non-keyed.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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 class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingWPSpecialcharsphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/WPSpecialchars.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,10 +6,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_WPSpecialchars extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_specialchars_basics() {
</span><span class="cx" style="display: block; padding: 0 10px"> $html = '&<hello world>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $html, _wp_specialchars( $html ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $html, _wp_specialchars( $html ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $double = '&amp;&lt;hello world&gt;';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $double, _wp_specialchars( $html, ENT_NOQUOTES, false, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $double, _wp_specialchars( $html, ENT_NOQUOTES, false, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_allowed_entity_names() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,7 +22,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $ent = '&' . $ent . ';';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $ent, _wp_specialchars( $ent ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $ent, _wp_specialchars( $ent ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,16 +32,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $ents as $ent ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $escaped = '&' . $ent . ';';
</span><span class="cx" style="display: block; padding: 0 10px"> $ent = '&' . $ent . ';';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $escaped, _wp_specialchars( $ent ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $escaped, _wp_specialchars( $ent ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_optionally_escapes_quotes() {
</span><span class="cx" style="display: block; padding: 0 10px"> $source = "\"'hello!'\"";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '"'hello!'"', _wp_specialchars( $source, 'single' ) );
- $this->assertEquals( ""'hello!'"", _wp_specialchars( $source, 'double' ) );
- $this->assertEquals( '"'hello!'"', _wp_specialchars( $source, true ) );
- $this->assertEquals( $source, _wp_specialchars( $source ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '"'hello!'"', _wp_specialchars( $source, 'single' ) );
+ $this->assertSame( ""'hello!'"", _wp_specialchars( $source, 'double' ) );
+ $this->assertSame( '"'hello!'"', _wp_specialchars( $source, true ) );
+ $this->assertSame( $source, _wp_specialchars( $source ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,7 +51,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_double_encoding
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_double_encoding( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, _wp_specialchars( $input, ENT_NOQUOTES, false, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, _wp_specialchars( $input, ENT_NOQUOTES, false, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_double_encoding() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,7 +78,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_no_double_encoding
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_no_double_encoding( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, _wp_specialchars( $input, ENT_NOQUOTES, false, false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, _wp_specialchars( $input, ENT_NOQUOTES, false, false ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_no_double_encoding() {
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingWPStripAllTagsphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/WPStripAllTags.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,25 +9,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_strip_all_tags() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $text = 'lorem<br />ipsum';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'loremipsum', wp_strip_all_tags( $text ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'loremipsum', wp_strip_all_tags( $text ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $text = "lorem<br />\nipsum";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "lorem\nipsum", wp_strip_all_tags( $text ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "lorem\nipsum", wp_strip_all_tags( $text ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test removing breaks is working.
</span><span class="cx" style="display: block; padding: 0 10px"> $text = 'lorem<br />ipsum';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'loremipsum', wp_strip_all_tags( $text, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'loremipsum', wp_strip_all_tags( $text, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test script / style tag's contents is removed.
</span><span class="cx" style="display: block; padding: 0 10px"> $text = 'lorem<script>alert(document.cookie)</script>ipsum';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'loremipsum', wp_strip_all_tags( $text ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'loremipsum', wp_strip_all_tags( $text ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $text = "lorem<style>* { display: 'none' }</style>ipsum";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'loremipsum', wp_strip_all_tags( $text ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'loremipsum', wp_strip_all_tags( $text ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test "marlformed" markup of contents.
</span><span class="cx" style="display: block; padding: 0 10px"> $text = "lorem<style>* { display: 'none' }<script>alert( document.cookie )</script></style>ipsum";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'loremipsum', wp_strip_all_tags( $text ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'loremipsum', wp_strip_all_tags( $text ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingWPTargetedLinkRelphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/WPTargetedLinkRel.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,61 +9,61 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_add_to_links_with_target_blank() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<p>Links: <a href="/" target="_blank">No rel</a></p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>Links: <a href="/" target="_blank" rel="noopener noreferrer">No rel</a></p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_targeted_link_rel( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_add_to_links_with_target_foo() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<p>Links: <a href="/" target="foo">No rel</a></p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>Links: <a href="/" target="foo" rel="noopener noreferrer">No rel</a></p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_targeted_link_rel( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_target_as_first_attribute() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<p>Links: <a target="_blank" href="#">No rel</a></p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>Links: <a target="_blank" href="#" rel="noopener noreferrer">No rel</a></p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_targeted_link_rel( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_add_to_existing_rel() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<p>Links: <a href="/" rel="existing values" target="_blank">Existing rel</a></p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>Links: <a href="/" rel="existing values noopener noreferrer" target="_blank">Existing rel</a></p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_targeted_link_rel( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_no_duplicate_values_added() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<p>Links: <a href="/" rel="existing noopener values" target="_blank">Existing rel</a></p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>Links: <a href="/" rel="existing noopener values noreferrer" target="_blank">Existing rel</a></p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_targeted_link_rel( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rel_with_single_quote_delimiter() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<p>Links: <a href="/" rel=\'existing values\' target="_blank">Existing rel</a></p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>Links: <a href="/" rel="existing values noopener noreferrer" target="_blank">Existing rel</a></p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_targeted_link_rel( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rel_with_no_delimiter() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<p>Links: <a href="/" rel=existing target="_blank">Existing rel</a></p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>Links: <a href="/" rel="existing noopener noreferrer" target="_blank">Existing rel</a></p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_targeted_link_rel( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rel_value_spaced_and_no_delimiter() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<p>Links: <a href="/" rel = existing target="_blank">Existing rel</a></p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>Links: <a href="/" rel="existing noopener noreferrer" target="_blank">Existing rel</a></p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_targeted_link_rel( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_escaped_quotes() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<p>Links: <a href=\"/\" rel=\"existing values\" target=\"_blank\">Existing rel</a></p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>Links: <a href=\"/\" rel=\"existing values noopener noreferrer\" target=\"_blank\">Existing rel</a></p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_targeted_link_rel( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_ignore_links_with_no_target() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<p>Links: <a href="/" target="_blank">Change me</a> <a href="/">Do not change me</a></p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>Links: <a href="/" target="_blank" rel="noopener noreferrer">Change me</a> <a href="/">Do not change me</a></p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_targeted_link_rel( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,7 +75,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'wp_targeted_link_rel', '__return_empty_string' );
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<p>Links: <a href="/" target="_blank">Do not change me</a></p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>Links: <a href="/" target="_blank">Do not change me</a></p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_targeted_link_rel( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -93,7 +93,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $post->post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $post->post_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,7 +104,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_targeted_link_rel_should_preserve_json() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '<p>Links: <a href=\"\/\" target=\"_blank\">No rel<\/a><\/p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>Links: <a href=\"\/\" target=\"_blank\" rel=\"noopener noreferrer\">No rel<\/a><\/p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_targeted_link_rel( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -115,7 +115,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_targeted_link_rel_skips_style_and_scripts() {
</span><span class="cx" style="display: block; padding: 0 10px"> $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>';
</span><span class="cx" style="display: block; padding: 0 10px"> $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 noreferrer">aq</a></p><script>console.log("<a href=\'last\' target=\'_blank\'")</script>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_targeted_link_rel( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -126,13 +126,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_ignore_entirely_serialized_content() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = 'a:1:{s:4:"html";s:52:"<p>Links: <a href="/" target="_blank">No Rel</a></p>";}';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = 'a:1:{s:4:"html";s:52:"<p>Links: <a href="/" target="_blank">No Rel</a></p>";}';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_targeted_link_rel( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_targeted_link_rel_tab_separated_values_are_split() {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = "<p>Links: <a href=\"/\" target=\"_blank\" rel=\"ugc\t\tnoopener\t\">No rel</a></p>";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p>Links: <a href="/" target="_blank" rel="ugc noopener noreferrer">No rel</a></p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_targeted_link_rel( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingWPTexturizephp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/WPTexturize.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,30 +5,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_WPTexturize extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px"> function test_dashes() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Hey — boo?', wptexturize( 'Hey -- boo?' ) );
- $this->assertEquals( '<a href="http://xx--xx">Hey — boo?</a>', wptexturize( '<a href="http://xx--xx">Hey -- boo?</a>' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Hey — boo?', wptexturize( 'Hey -- boo?' ) );
+ $this->assertSame( '<a href="http://xx--xx">Hey — boo?</a>', wptexturize( '<a href="http://xx--xx">Hey -- boo?</a>' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_disable() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<pre>---&</pre>', wptexturize( '<pre>---&</pre>' ) );
- $this->assertEquals( '<pre><code></code>--&</pre>', wptexturize( '<pre><code></code>--&</pre>' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<pre>---&</pre>', wptexturize( '<pre>---&</pre>' ) );
+ $this->assertSame( '<pre><code></code>--&</pre>', wptexturize( '<pre><code></code>--&</pre>' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<code>---&</code>', wptexturize( '<code>---&</code>' ) );
- $this->assertEquals( '<kbd>---&</kbd>', wptexturize( '<kbd>---&</kbd>' ) );
- $this->assertEquals( '<style>---&</style>', wptexturize( '<style>---&</style>' ) );
- $this->assertEquals( '<script>---&</script>', wptexturize( '<script>---&</script>' ) );
- $this->assertEquals( '<tt>---&</tt>', wptexturize( '<tt>---&</tt>' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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>' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<code>href="baba"</code> “baba”', wptexturize( '<code>href="baba"</code> "baba"' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<code>href="baba"</code> “baba”', wptexturize( '<code>href="baba"</code> "baba"' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $enabled_tags_inside_code = '<code>curl -s <a href="http://x/">baba</a> | grep sfive | cut -d "\"" -f 10 > topmp3.txt</code>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $enabled_tags_inside_code, wptexturize( $enabled_tags_inside_code ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $enabled_tags_inside_code, wptexturize( $enabled_tags_inside_code ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $double_nest = '<pre>"baba"<code>"baba"<pre></pre></code>"baba"</pre>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $double_nest, wptexturize( $double_nest ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $double_nest, wptexturize( $double_nest ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $invalid_nest = '<pre></code>"baba"</pre>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $invalid_nest, wptexturize( $invalid_nest ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $invalid_nest, wptexturize( $invalid_nest ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,9 +36,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 1418
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_bracketed_quotes_1418() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '(“test”)', wptexturize( '("test")' ) );
- $this->assertEquals( '(‘test’)', wptexturize( "('test')" ) );
- $this->assertEquals( '(’twas)', wptexturize( "('twas)" ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '(“test”)', wptexturize( '("test")' ) );
+ $this->assertSame( '(‘test’)', wptexturize( "('test')" ) );
+ $this->assertSame( '(’twas)', wptexturize( "('twas)" ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,7 +45,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 3810
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_bracketed_quotes_3810() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'A dog (“Hubertus”) was sent out.', wptexturize( 'A dog ("Hubertus") was sent out.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'A dog (“Hubertus”) was sent out.', wptexturize( 'A dog ("Hubertus") was sent out.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,22 +52,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 4539
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_basic_quotes() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test’s', wptexturize( 'test\'s' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test’s', wptexturize( 'test\'s' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '‘quoted’', wptexturize( '\'quoted\'' ) );
- $this->assertEquals( '“quoted”', wptexturize( '"quoted"' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '‘quoted’', wptexturize( '\'quoted\'' ) );
+ $this->assertSame( '“quoted”', wptexturize( '"quoted"' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'space before ‘quoted’ space after', wptexturize( 'space before \'quoted\' space after' ) );
- $this->assertEquals( 'space before “quoted” space after', wptexturize( 'space before "quoted" space after' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'space before ‘quoted’ space after', wptexturize( 'space before \'quoted\' space after' ) );
+ $this->assertSame( 'space before “quoted” space after', wptexturize( 'space before "quoted" space after' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '(‘quoted’)', wptexturize( '(\'quoted\')' ) );
- $this->assertEquals( '{“quoted”}', wptexturize( '{"quoted"}' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '(‘quoted’)', wptexturize( '(\'quoted\')' ) );
+ $this->assertSame( '{“quoted”}', wptexturize( '{"quoted"}' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '‘qu(ot)ed’', wptexturize( '\'qu(ot)ed\'' ) );
- $this->assertEquals( '“qu{ot}ed”', wptexturize( '"qu{ot}ed"' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '‘qu(ot)ed’', wptexturize( '\'qu(ot)ed\'' ) );
+ $this->assertSame( '“qu{ot}ed”', wptexturize( '"qu{ot}ed"' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( ' ‘test’s quoted’ ', wptexturize( ' \'test\'s quoted\' ' ) );
- $this->assertEquals( ' “test’s quoted” ', wptexturize( ' "test\'s quoted" ' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( ' ‘test’s quoted’ ', wptexturize( ' \'test\'s quoted\' ' ) );
+ $this->assertSame( ' “test’s quoted” ', wptexturize( ' "test\'s quoted" ' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,7 +75,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 15241
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_full_sentences_with_unmatched_single_quotes() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'That means every moment you’re working on something without it being in the public it’s actually dying.',
</span><span class="cx" style="display: block; padding: 0 10px"> wptexturize( "That means every moment you're working on something without it being in the public it's actually dying." )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -85,19 +85,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 4539
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_quotes() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '“Quoted String”', wptexturize( '"Quoted String"' ) );
- // $this->assertEquals( 'Here is “<a href="http://example.com">a test with a link</a>”', wptexturize( 'Here is "<a href="http://example.com">a test with a link</a>"' ) );
- // $this->assertEquals( 'Here is “<a href="http://example.com">a test with a link and a period</a>”.', wptexturize( 'Here is "<a href="http://example.com">a test with a link and a period</a>".' ) );
- $this->assertEquals( 'Here is “<a href="http://example.com">a test with a link</a>” and a space.', wptexturize( 'Here is "<a href="http://example.com">a test with a link</a>" and a space.' ) );
- $this->assertEquals( 'Here is “<a href="http://example.com">a test with a link</a> and some text quoted”', wptexturize( 'Here is "<a href="http://example.com">a test with a link</a> and some text quoted"' ) );
- // $this->assertEquals( 'Here is “<a href="http://example.com">a test with a link</a>”, and a comma.', wptexturize( 'Here is "<a href="http://example.com">a test with a link</a>", and a comma.' ) );
- // $this->assertEquals( 'Here is “<a href="http://example.com">a test with a link</a>”; and a semi-colon.', wptexturize( 'Here is "<a href="http://example.com">a test with a link</a>"; and a semi-colon.' ) );
- // $this->assertEquals( 'Here is “<a href="http://example.com">a test with a link</a>”- and a dash.', wptexturize( 'Here is "<a href="http://example.com">a test with a link</a>"- and a dash.' ) );
- // $this->assertEquals( 'Here is “<a href="http://example.com">a test with a link</a>”… and ellipses.', wptexturize( 'Here is "<a href="http://example.com">a test with a link</a>"... and ellipses.' ) );
- // $this->assertEquals( 'Here is “a test <a href="http://example.com">with a link</a>”.', wptexturize( 'Here is "a test <a href="http://example.com">with a link</a>".' ) );
- // $this->assertEquals( 'Here is “<a href="http://example.com">a test with a link</a>”and a work stuck to the end.', wptexturize( 'Here is "<a href="http://example.com">a test with a link</a>"and a work stuck to the end.' ) );
- $this->assertEquals( 'A test with a finishing number, “like 23”.', wptexturize( 'A test with a finishing number, "like 23".' ) );
- $this->assertEquals( 'A test with a number, “like 62”, is nice to have.', wptexturize( 'A test with a number, "like 62", is nice to have.' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '“Quoted String”', wptexturize( '"Quoted String"' ) );
+ // $this->assertSame( 'Here is “<a href="http://example.com">a test with a link</a>”', wptexturize( 'Here is "<a href="http://example.com">a test with a link</a>"' ) );
+ // $this->assertSame( 'Here is “<a href="http://example.com">a test with a link and a period</a>”.', wptexturize( 'Here is "<a href="http://example.com">a test with a link and a period</a>".' ) );
+ $this->assertSame( 'Here is “<a href="http://example.com">a test with a link</a>” and a space.', wptexturize( 'Here is "<a href="http://example.com">a test with a link</a>" and a space.' ) );
+ $this->assertSame( 'Here is “<a href="http://example.com">a test with a link</a> and some text quoted”', wptexturize( 'Here is "<a href="http://example.com">a test with a link</a> and some text quoted"' ) );
+ // $this->assertSame( 'Here is “<a href="http://example.com">a test with a link</a>”, and a comma.', wptexturize( 'Here is "<a href="http://example.com">a test with a link</a>", and a comma.' ) );
+ // $this->assertSame( 'Here is “<a href="http://example.com">a test with a link</a>”; 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 “<a href="http://example.com">a test with a link</a>”- and a dash.', wptexturize( 'Here is "<a href="http://example.com">a test with a link</a>"- and a dash.' ) );
+ // $this->assertSame( 'Here is “<a href="http://example.com">a test with a link</a>”… and ellipses.', wptexturize( 'Here is "<a href="http://example.com">a test with a link</a>"... and ellipses.' ) );
+ // $this->assertSame( 'Here is “a test <a href="http://example.com">with a link</a>”.', wptexturize( 'Here is "a test <a href="http://example.com">with a link</a>".' ) );
+ // $this->assertSame( 'Here is “<a href="http://example.com">a test with a link</a>”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, “like 23”.', wptexturize( 'A test with a finishing number, "like 23".' ) );
+ $this->assertSame( 'A test with a number, “like 62”, is nice to have.', wptexturize( 'A test with a number, "like 62", is nice to have.' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,11 +104,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 4539
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_quotes_before_s() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test’s', wptexturize( "test's" ) );
- $this->assertEquals( '‘test’s', wptexturize( "'test's" ) );
- $this->assertEquals( '‘test’s’', wptexturize( "'test's'" ) );
- $this->assertEquals( '‘string’', wptexturize( "'string'" ) );
- $this->assertEquals( '‘string’s’', wptexturize( "'string's'" ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test’s', wptexturize( "test's" ) );
+ $this->assertSame( '‘test’s', wptexturize( "'test's" ) );
+ $this->assertSame( '‘test’s’', wptexturize( "'test's'" ) );
+ $this->assertSame( '‘string’', wptexturize( "'string'" ) );
+ $this->assertSame( '‘string’s’', wptexturize( "'string's'" ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -115,34 +115,34 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 4539
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_quotes_before_numbers() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Class of ’99', wptexturize( "Class of '99" ) );
- $this->assertEquals( 'Class of ’99’s', wptexturize( "Class of '99's" ) );
- $this->assertEquals( '‘Class of ’99’', wptexturize( "'Class of '99'" ) );
- $this->assertEquals( '‘Class of ’99’ ', wptexturize( "'Class of '99' " ) );
- $this->assertEquals( '‘Class of ’99’.', wptexturize( "'Class of '99'." ) );
- $this->assertEquals( '‘Class of ’99’, she said', wptexturize( "'Class of '99', she said" ) );
- $this->assertEquals( '‘Class of ’99’:', wptexturize( "'Class of '99':" ) );
- $this->assertEquals( '‘Class of ’99’;', wptexturize( "'Class of '99';" ) );
- $this->assertEquals( '‘Class of ’99’!', wptexturize( "'Class of '99'!" ) );
- $this->assertEquals( '‘Class of ’99’?', wptexturize( "'Class of '99'?" ) );
- $this->assertEquals( '‘Class of ’99’s’', wptexturize( "'Class of '99's'" ) );
- $this->assertEquals( '‘Class of ’99’s’', wptexturize( "'Class of '99’s'" ) );
- $this->assertEquals( '“Class of 99”', wptexturize( '"Class of 99"' ) );
- $this->assertEquals( '“Class of ’99”', wptexturize( "\"Class of '99\"" ) );
- $this->assertEquals( '{“Class of ’99”}', wptexturize( "{\"Class of '99\"}" ) );
- $this->assertEquals( ' “Class of ’99” ', wptexturize( " \"Class of '99\" " ) );
- $this->assertEquals( ' “Class of ’99”.', wptexturize( " \"Class of '99\"." ) );
- $this->assertEquals( ' “Class of ’99”, she said', wptexturize( " \"Class of '99\", she said" ) );
- $this->assertEquals( ' “Class of ’99”:', wptexturize( " \"Class of '99\":" ) );
- $this->assertEquals( ' “Class of ’99”;', wptexturize( " \"Class of '99\";" ) );
- $this->assertEquals( ' “Class of ’99”!', wptexturize( " \"Class of '99\"!" ) );
- $this->assertEquals( ' “Class of ’99”?', wptexturize( " \"Class of '99\"?" ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Class of ’99', wptexturize( "Class of '99" ) );
+ $this->assertSame( 'Class of ’99’s', wptexturize( "Class of '99's" ) );
+ $this->assertSame( '‘Class of ’99’', wptexturize( "'Class of '99'" ) );
+ $this->assertSame( '‘Class of ’99’ ', wptexturize( "'Class of '99' " ) );
+ $this->assertSame( '‘Class of ’99’.', wptexturize( "'Class of '99'." ) );
+ $this->assertSame( '‘Class of ’99’, she said', wptexturize( "'Class of '99', she said" ) );
+ $this->assertSame( '‘Class of ’99’:', wptexturize( "'Class of '99':" ) );
+ $this->assertSame( '‘Class of ’99’;', wptexturize( "'Class of '99';" ) );
+ $this->assertSame( '‘Class of ’99’!', wptexturize( "'Class of '99'!" ) );
+ $this->assertSame( '‘Class of ’99’?', wptexturize( "'Class of '99'?" ) );
+ $this->assertSame( '‘Class of ’99’s’', wptexturize( "'Class of '99's'" ) );
+ $this->assertSame( '‘Class of ’99’s’', wptexturize( "'Class of '99’s'" ) );
+ $this->assertSame( '“Class of 99”', wptexturize( '"Class of 99"' ) );
+ $this->assertSame( '“Class of ’99”', wptexturize( "\"Class of '99\"" ) );
+ $this->assertSame( '{“Class of ’99”}', wptexturize( "{\"Class of '99\"}" ) );
+ $this->assertSame( ' “Class of ’99” ', wptexturize( " \"Class of '99\" " ) );
+ $this->assertSame( ' “Class of ’99”.', wptexturize( " \"Class of '99\"." ) );
+ $this->assertSame( ' “Class of ’99”, she said', wptexturize( " \"Class of '99\", she said" ) );
+ $this->assertSame( ' “Class of ’99”:', wptexturize( " \"Class of '99\":" ) );
+ $this->assertSame( ' “Class of ’99”;', wptexturize( " \"Class of '99\";" ) );
+ $this->assertSame( ' “Class of ’99”!', wptexturize( " \"Class of '99\"!" ) );
+ $this->assertSame( ' “Class of ’99”?', wptexturize( " \"Class of '99\"?" ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Not a quotation, may be between two other quotations.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '}”Class of ’99″{', wptexturize( "}\"Class of '99\"{" ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '}”Class of ’99″{', wptexturize( "}\"Class of '99\"{" ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_quotes_after_numbers() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Class of ’99', wptexturize( "Class of '99" ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Class of ’99', wptexturize( "Class of '99" ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,24 +150,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 15241
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_other_html() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '‘<strong>', wptexturize( "'<strong>" ) );
- // $this->assertEquals( '‘<strong>Quoted Text</strong>’,', wptexturize( "'<strong>Quoted Text</strong>'," ) );
- // $this->assertEquals( '“<strong>Quoted Text</strong>”,', wptexturize( '"<strong>Quoted Text</strong>",' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '‘<strong>', wptexturize( "'<strong>" ) );
+ // $this->assertSame( '‘<strong>Quoted Text</strong>’,', wptexturize( "'<strong>Quoted Text</strong>'," ) );
+ // $this->assertSame( '“<strong>Quoted Text</strong>”,', wptexturize( '"<strong>Quoted Text</strong>",' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_x() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '14×24', wptexturize( '14x24' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '14×24', wptexturize( '14x24' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_minutes_seconds() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '9′', wptexturize( '9\'' ) );
- $this->assertEquals( '9″', wptexturize( '9"' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '9′', wptexturize( '9\'' ) );
+ $this->assertSame( '9″', wptexturize( '9"' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a 9′ b', wptexturize( 'a 9\' b' ) );
- $this->assertEquals( 'a 9″ b', wptexturize( 'a 9" b' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a 9′ b', wptexturize( 'a 9\' b' ) );
+ $this->assertSame( 'a 9″ b', wptexturize( 'a 9" b' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '“a 9′ b”', wptexturize( '"a 9\' b"' ) );
- $this->assertEquals( '‘a 9″ b’', wptexturize( "'a 9\" b'" ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '“a 9′ b”', wptexturize( '"a 9\' b"' ) );
+ $this->assertSame( '‘a 9″ b’', wptexturize( "'a 9\" b'" ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -174,10 +174,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 8775
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wptexturize_quotes_around_numbers() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '“12345”', wptexturize( '"12345"' ) );
- $this->assertEquals( '‘12345’', wptexturize( '\'12345\'' ) );
- $this->assertEquals( '“a 9′ plus a ‘9’, maybe a 9′ ‘9’”', wptexturize( '"a 9\' plus a \'9\', maybe a 9\' \'9\'"' ) );
- $this->assertEquals( '<p>’99<br />‘123’<br />’tis<br />‘s’</p>', wptexturize( '<p>\'99<br />\'123\'<br />\'tis<br />\'s\'</p>' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '“12345”', wptexturize( '"12345"' ) );
+ $this->assertSame( '‘12345’', wptexturize( '\'12345\'' ) );
+ $this->assertSame( '“a 9′ plus a ‘9’, maybe a 9′ ‘9’”', wptexturize( '"a 9\' plus a \'9\', maybe a 9\' \'9\'"' ) );
+ $this->assertSame( '<p>’99<br />‘123’<br />’tis<br />‘s’</p>', wptexturize( '<p>\'99<br />\'123\'<br />\'tis<br />\'s\'</p>' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -184,9 +184,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 8912
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wptexturize_html_comments() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<!--[if !IE]>--><!--<![endif]-->', wptexturize( '<!--[if !IE]>--><!--<![endif]-->' ) );
- $this->assertEquals( '<!--[if !IE]>"a 9\' plus a \'9\', maybe a 9\' \'9\' "<![endif]-->', wptexturize( '<!--[if !IE]>"a 9\' plus a \'9\', maybe a 9\' \'9\' "<![endif]-->' ) );
- $this->assertEquals( '<ul><li>Hello.</li><!--<li>Goodbye.</li>--></ul>', wptexturize( '<ul><li>Hello.</li><!--<li>Goodbye.</li>--></ul>' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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>' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -194,8 +194,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 15241
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_entity_quote_cuddling() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( ' “Testing”', wptexturize( ' "Testing"' ) );
- // $this->assertEquals( '&“Testing”', wptexturize( '&"Testing"' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( ' “Testing”', wptexturize( ' "Testing"' ) );
+ // $this->assertSame( '&“Testing”', wptexturize( '&"Testing"' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -202,7 +202,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 22823
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_apostrophes_before_primes() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'WordPress 3.5’s release date', wptexturize( "WordPress 3.5's release date" ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'WordPress 3.5’s release date', wptexturize( "WordPress 3.5's release date" ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -211,21 +211,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_spaces_around_hyphens() {
</span><span class="cx" style="display: block; padding: 0 10px"> $nbsp = "\xC2\xA0";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( ' – ', wptexturize( ' - ' ) );
- $this->assertEquals( ' – ', wptexturize( ' - ' ) );
- $this->assertEquals( ' – ', wptexturize( ' - ' ) );
- $this->assertEquals( ' – ', wptexturize( ' - ' ) );
- $this->assertEquals( "$nbsp–$nbsp", wptexturize( "$nbsp-$nbsp" ) );
- $this->assertEquals( " –$nbsp", wptexturize( " -$nbsp" ) );
- $this->assertEquals( "$nbsp– ", wptexturize( "$nbsp- " ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( ' – ', wptexturize( ' - ' ) );
+ $this->assertSame( ' – ', wptexturize( ' - ' ) );
+ $this->assertSame( ' – ', wptexturize( ' - ' ) );
+ $this->assertSame( ' – ', wptexturize( ' - ' ) );
+ $this->assertSame( "$nbsp–$nbsp", wptexturize( "$nbsp-$nbsp" ) );
+ $this->assertSame( " –$nbsp", wptexturize( " -$nbsp" ) );
+ $this->assertSame( "$nbsp– ", wptexturize( "$nbsp- " ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( ' — ', wptexturize( ' -- ' ) );
- $this->assertEquals( ' — ', wptexturize( ' -- ' ) );
- $this->assertEquals( ' — ', wptexturize( ' -- ' ) );
- $this->assertEquals( ' — ', wptexturize( ' -- ' ) );
- $this->assertEquals( "$nbsp—$nbsp", wptexturize( "$nbsp--$nbsp" ) );
- $this->assertEquals( " —$nbsp", wptexturize( " --$nbsp" ) );
- $this->assertEquals( "$nbsp— ", wptexturize( "$nbsp-- " ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( ' — ', wptexturize( ' -- ' ) );
+ $this->assertSame( ' — ', wptexturize( ' -- ' ) );
+ $this->assertSame( ' — ', wptexturize( ' -- ' ) );
+ $this->assertSame( ' — ', wptexturize( ' -- ' ) );
+ $this->assertSame( "$nbsp—$nbsp", wptexturize( "$nbsp--$nbsp" ) );
+ $this->assertSame( " —$nbsp", wptexturize( " --$nbsp" ) );
+ $this->assertSame( "$nbsp— ", wptexturize( "$nbsp-- " ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -232,13 +232,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 31030
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_hyphens_at_start_and_end() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '– ', wptexturize( '- ' ) );
- $this->assertEquals( '– –', wptexturize( '- -' ) );
- $this->assertEquals( ' –', wptexturize( ' -' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '– ', wptexturize( '- ' ) );
+ $this->assertSame( '– –', wptexturize( '- -' ) );
+ $this->assertSame( ' –', wptexturize( ' -' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '— ', wptexturize( '-- ' ) );
- $this->assertEquals( '— —', wptexturize( '-- --' ) );
- $this->assertEquals( ' —', wptexturize( ' --' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '— ', wptexturize( '-- ' ) );
+ $this->assertSame( '— —', wptexturize( '-- --' ) );
+ $this->assertSame( ' —', wptexturize( ' --' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -266,7 +266,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_spaces_around_quotes
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_spaces_around_quotes( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_spaces_around_quotes() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -322,7 +322,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_apos_before_digits
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_apos_before_digits( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_apos_before_digits() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -363,7 +363,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_opening_single_quote
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_opening_single_quote( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_opening_single_quote() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -492,7 +492,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_double_prime
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_double_prime( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_double_prime() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -525,7 +525,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_single_prime
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_single_prime( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_single_prime() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -558,7 +558,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_contractions
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_contractions( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_contractions() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -599,7 +599,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_opening_quote
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_opening_quote( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_opening_quote() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -676,7 +676,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_closing_quote
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_closing_quote( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_closing_quote() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -765,7 +765,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_closing_single_quote
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_closing_single_quote( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_closing_single_quote() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -855,7 +855,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_multiplication
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_multiplication( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_multiplication() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -905,7 +905,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_ampersand
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_ampersand( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_ampersand() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -970,7 +970,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_cockney
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_cockney( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_cockney() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1031,7 +1031,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_smart_dashes
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_smart_dashes( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_smart_dashes() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1084,7 +1084,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_misc_static_replacements
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_misc_static_replacements( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_misc_static_replacements() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1139,7 +1139,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_quoted_numbers
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_quoted_numbers( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_quoted_numbers() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1190,7 +1190,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_quotes_and_dashes
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_quotes_and_dashes( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_quotes_and_dashes() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1253,7 +1253,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_tag_avoidance
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_tag_avoidance( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_tag_avoidance() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1476,7 +1476,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_year_abbr
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_year_abbr( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_year_abbr() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1572,7 +1572,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'gettext_with_context', array( $this, 'filter_translate' ), 10, 4 );
</span><span class="cx" style="display: block; padding: 0 10px"> wptexturize( 'reset', true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function filter_translate( $translations, $text, $context, $domain ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1792,7 +1792,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_element_stack
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_element_stack( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_element_stack() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1845,7 +1845,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_unregistered_shortcodes( $input, $output ) {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'no_texturize_shortcodes', array( $this, 'filter_shortcodes' ), 10, 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output = $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output = $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'no_texturize_shortcodes', array( $this, 'filter_shortcodes' ), 10, 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> return $output;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1928,7 +1928,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_primes_vs_quotes
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_primes_vs_quotes( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wptexturize( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wptexturize( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_primes_vs_quotes() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1997,7 +1997,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'gettext_with_context', array( $this, 'filter_translate2' ), 10, 4 );
</span><span class="cx" style="display: block; padding: 0 10px"> wptexturize( 'reset', true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function filter_translate2( $translations, $text, $context, $domain ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2103,7 +2103,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 35864
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_trailing_less_than() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'F–oo<', wptexturize( 'F--oo<', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'F–oo<', wptexturize( 'F--oo<', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_whole_posts() {
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingWPTrimWordsphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/WPTrimWords.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,23 +16,23 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_trims_to_55_by_default() {
</span><span class="cx" style="display: block; padding: 0 10px"> $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…';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $trimmed, wp_trim_words( $this->long_text ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $trimmed, wp_trim_words( $this->long_text ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_trims_to_10() {
</span><span class="cx" style="display: block; padding: 0 10px"> $trimmed = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce varius…';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $trimmed, wp_trim_words( $this->long_text, 10 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $trimmed, wp_trim_words( $this->long_text, 10 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_trims_to_5_and_uses_custom_more() {
</span><span class="cx" style="display: block; padding: 0 10px"> $trimmed = 'Lorem ipsum dolor sit amet,[...] Read on!';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $trimmed, wp_trim_words( $this->long_text, 5, '[...] Read on!' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $trimmed, wp_trim_words( $this->long_text, 5, '[...] Read on!' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_strips_tags_before_trimming() {
</span><span class="cx" style="display: block; padding: 0 10px"> $text = 'This text contains a <a href="http://wordpress.org"> link </a> to WordPress.org!';
</span><span class="cx" style="display: block; padding: 0 10px"> $trimmed = 'This text contains a link…';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $trimmed, wp_trim_words( $text, 5 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $trimmed, wp_trim_words( $text, 5 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -42,15 +42,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $trimmed = 'This text contains. It should go.';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $text = 'This text contains<script>alert(" Javascript");</script>. It should go.';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $trimmed, wp_trim_words( $text ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $trimmed, wp_trim_words( $text ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $text = 'This text contains<style>#css { width:expression(alert("css")) }</style>. It should go.';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $trimmed, wp_trim_words( $text ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $trimmed, wp_trim_words( $text ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_doesnt_trim_short_text() {
</span><span class="cx" style="display: block; padding: 0 10px"> $text = 'This is some short text.';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $text, wp_trim_words( $text ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $text, wp_trim_words( $text ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -61,7 +61,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = substr( $this->long_text, 0, 20 ) . '…';
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = wp_trim_words( $this->long_text, 20 );
</span><span class="cx" style="display: block; padding: 0 10px"> restore_previous_locale();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -73,7 +73,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = str_repeat( 'あ', 19 ) . '…';
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = wp_trim_words( $text, 19 );
</span><span class="cx" style="display: block; padding: 0 10px"> restore_previous_locale();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -80,9 +80,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 47867
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_works_with_non_numeric_num_words() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', wp_trim_words( $this->long_text, '', '' ) );
- $this->assertEquals( '', wp_trim_words( $this->long_text, 'abc', '' ) );
- $this->assertEquals( '', wp_trim_words( $this->long_text, null, '' ) );
- $this->assertEquals( 'Lorem ipsum dolor', wp_trim_words( $this->long_text, '3', '' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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 class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingWpHtmlEditPrephp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/WpHtmlEditPre.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,7 +17,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_htmledit_pre_charset_iso_8859_1() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'pre_option_blog_charset', array( $this, '_charset_iso_8859_1' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $iso8859_1 = 'Fran' . chr( 135 ) . 'ais';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $iso8859_1, wp_htmledit_pre( $iso8859_1 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $iso8859_1, wp_htmledit_pre( $iso8859_1 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_option_blog_charset', array( $this, '_charset_iso_8859_1' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,7 +31,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_htmledit_pre_charset_utf_8() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'pre_option_blog_charset', array( $this, '_charset_utf_8' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $utf8 = 'Fran' . chr( 195 ) . chr( 167 ) . 'ais';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $utf8, wp_htmledit_pre( $utf8 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $utf8, wp_htmledit_pre( $utf8 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_option_blog_charset', array( $this, '_charset_utf_8' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingWpHtmlSplitphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/WpHtmlSplit.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,7 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_basic_features
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_basic_features( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wp_html_split( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wp_html_split( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_basic_features() {
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingWpReplaceInHtmlTagsphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/WpReplaceInHtmlTags.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,7 +10,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_wp_replace_in_html_tags
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_replace_in_html_tags( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wp_replace_in_html_tags( $input, array( "\n" => ' ' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wp_replace_in_html_tags( $input, array( "\n" => ' ' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_wp_replace_in_html_tags() {
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingWpRichEditPrephp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/WpRichEditPre.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,7 +17,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_richedit_pre_charset_iso_8859_1() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'pre_option_blog_charset', array( $this, '_charset_iso_8859_1' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $iso8859_1 = 'Fran' . chr( 135 ) . 'ais';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<p>' . $iso8859_1 . "</p>\n", wp_richedit_pre( $iso8859_1 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<p>' . $iso8859_1 . "</p>\n", wp_richedit_pre( $iso8859_1 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_option_blog_charset', array( $this, '_charset_iso_8859_1' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,7 +31,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_richedit_pre_charset_utf_8() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'pre_option_blog_charset', array( $this, '_charset_utf_8' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $utf8 = 'Fran' . chr( 195 ) . chr( 167 ) . 'ais';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<p>' . $utf8 . "</p>\n", wp_richedit_pre( $utf8 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<p>' . $utf8 . "</p>\n", wp_richedit_pre( $utf8 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_option_blog_charset', array( $this, '_charset_utf_8' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingZeroisephp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/Zeroise.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,10 +5,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_Zeroise extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px"> function test_pads_with_leading_zeroes() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '00005', zeroise( 5, 5 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '00005', zeroise( 5, 5 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_does_nothing_if_input_is_already_longer() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '5000000', zeroise( 5000000, 2 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '5000000', zeroise( 5000000, 2 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingbalanceTagsphp"></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/balanceTags.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/balanceTags.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/balanceTags.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -154,7 +154,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_detects_traditional_tag_names( $tag ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $normalized = strtolower( $tag );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "<$normalized>inside</$normalized>", balanceTags( "<$tag>inside", true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "<$normalized>inside</$normalized>", balanceTags( "<$tag>inside", true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -162,7 +162,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider supported_custom_element_tag_names
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_detects_supported_custom_element_tag_names( $tag ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "<$tag>inside</$tag>", balanceTags( "<$tag>inside", true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "<$tag>inside</$tag>", balanceTags( "<$tag>inside", true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -170,7 +170,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider invalid_tag_names
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_ignores_invalid_tag_names( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $output, balanceTags( $input, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $output, balanceTags( $input, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -178,7 +178,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider unsupported_valid_tag_names
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_ignores_unsupported_custom_tag_names( $tag ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "<$tag>inside", balanceTags( "<$tag>inside", true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "<$tag>inside", balanceTags( "<$tag>inside", true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,7 +186,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider supported_invalid_tag_names
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_detects_supported_invalid_tag_names( $tag ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "<$tag>inside</$tag>", balanceTags( "<$tag>inside", true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "<$tag>inside</$tag>", balanceTags( "<$tag>inside", true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -196,7 +196,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider single_tags
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_selfcloses_unclosed_known_single_tags( $tag ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "<$tag />", balanceTags( "<$tag>", true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "<$tag />", balanceTags( "<$tag>", true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -207,7 +207,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider single_tags
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_selfcloses_known_single_tags_having_closing_tag( $tag ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "<$tag />", balanceTags( "<$tag></$tag>", true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "<$tag />", balanceTags( "<$tag></$tag>", true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -232,7 +232,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $inputs as $key => $input ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected[ $key ], balanceTags( $inputs[ $key ], true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected[ $key ], balanceTags( $inputs[ $key ], true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -247,7 +247,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $inputs as $key => $input ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected[ $key ], balanceTags( $inputs[ $key ], true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected[ $key ], balanceTags( $inputs[ $key ], true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -260,7 +260,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $inputs as $key => $input ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $inputs[ $key ], balanceTags( $inputs[ $key ], true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $inputs[ $key ], balanceTags( $inputs[ $key ], true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -280,7 +280,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $inputs as $key => $input ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected[ $key ], balanceTags( $inputs[ $key ], true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected[ $key ], balanceTags( $inputs[ $key ], true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -294,7 +294,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $inputs as $key => $input ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $inputs[ $key ], balanceTags( $inputs[ $key ], true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $inputs[ $key ], balanceTags( $inputs[ $key ], true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -303,7 +303,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_allows_immediately_nested_object_tags() {
</span><span class="cx" style="display: block; padding: 0 10px"> $object = '<object id="obj1"><param name="param1"/><object id="obj2"><param name="param2"/></object></object>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $object, balanceTags( $object, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $object, balanceTags( $object, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_balances_nested_non_nestable_tags() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -317,7 +317,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $inputs as $key => $input ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected[ $key ], balanceTags( $inputs[ $key ], true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected[ $key ], balanceTags( $inputs[ $key ], true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -332,7 +332,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $inputs as $key => $input ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected[ $key ], balanceTags( $inputs[ $key ], true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected[ $key ], balanceTags( $inputs[ $key ], true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -353,7 +353,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $inputs as $key => $input ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected[ $key ], balanceTags( $inputs[ $key ], true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected[ $key ], balanceTags( $inputs[ $key ], true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -372,7 +372,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $inputs as $key => $input ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected[ $key ], balanceTags( $inputs[ $key ], true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected[ $key ], balanceTags( $inputs[ $key ], true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -438,6 +438,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $expected Expected.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_custom_elements( $source, $expected ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, balanceTags( $source, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, balanceTags( $source, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingdatephp"></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/date.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/date.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/date.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,7 +15,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'timezone_string', 'Europe/London' );
</span><span class="cx" style="display: block; padding: 0 10px"> $local = '2012-01-01 12:34:56';
</span><span class="cx" style="display: block; padding: 0 10px"> $gmt = $local;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $local, get_date_from_gmt( $gmt ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $local, get_date_from_gmt( $gmt ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'timezone_string', 'Europe/London' );
</span><span class="cx" style="display: block; padding: 0 10px"> $gmt = '2012-06-01 12:34:56';
</span><span class="cx" style="display: block; padding: 0 10px"> $local = '2012-06-01 13:34:56';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $local, get_date_from_gmt( $gmt ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $local, get_date_from_gmt( $gmt ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,7 +37,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'timezone_string', 'Europe/London' );
</span><span class="cx" style="display: block; padding: 0 10px"> $local = '2012-01-01 12:34:56';
</span><span class="cx" style="display: block; padding: 0 10px"> $gmt = $local;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $gmt, get_gmt_from_date( $local ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $gmt, get_gmt_from_date( $local ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,7 +47,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'timezone_string', 'Europe/London' );
</span><span class="cx" style="display: block; padding: 0 10px"> $local = '2012-06-01 12:34:56';
</span><span class="cx" style="display: block; padding: 0 10px"> $gmt = '2012-06-01 11:34:56';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $gmt, get_gmt_from_date( $local ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $gmt, get_gmt_from_date( $local ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,7 +56,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_date_and_time_from_gmt_no_timezone() {
</span><span class="cx" style="display: block; padding: 0 10px"> $local = '2012-01-01 12:34:56';
</span><span class="cx" style="display: block; padding: 0 10px"> $gmt = $local;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $gmt, get_date_from_gmt( $local ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $gmt, get_date_from_gmt( $local ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,7 +65,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_gmt_from_date_no_timezone() {
</span><span class="cx" style="display: block; padding: 0 10px"> $gmt = '2012-12-01 00:00:00';
</span><span class="cx" style="display: block; padding: 0 10px"> $date = '2012-12-01';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $gmt, get_gmt_from_date( $date ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $gmt, get_gmt_from_date( $date ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,7 +75,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'timezone_string', 'Europe/London' );
</span><span class="cx" style="display: block; padding: 0 10px"> $local = '2012-12-01';
</span><span class="cx" style="display: block; padding: 0 10px"> $gmt = '2012-12-01 00:00:00';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $gmt, get_gmt_from_date( $local ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $gmt, get_gmt_from_date( $local ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,7 +110,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $utc = $local->setTimezone( new DateTimeZone( 'UTC' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $mysql_local = $local->format( 'Y-m-d H:i:s' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $utc->format( DATE_RFC3339 ), get_gmt_from_date( $mysql_local, DATE_RFC3339 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $utc->format( DATE_RFC3339 ), get_gmt_from_date( $mysql_local, DATE_RFC3339 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -126,7 +126,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $utc = $local->setTimezone( new DateTimeZone( 'UTC' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $mysql_utc = $utc->format( 'Y-m-d H:i:s' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $local->format( DATE_RFC3339 ), get_date_from_gmt( $mysql_utc, DATE_RFC3339 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $local->format( DATE_RFC3339 ), get_date_from_gmt( $mysql_utc, DATE_RFC3339 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -144,45 +144,45 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $local = new DateTimeImmutable( 'now', wp_timezone() );
</span><span class="cx" style="display: block; padding: 0 10px"> $utc = $local->setTimezone( new DateTimeZone( 'UTC' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $local->format( 'Y-m-d H:i:s' ),
</span><span class="cx" style="display: block; padding: 0 10px"> iso8601_to_datetime( $local->format( $format ) ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'Local time from local time.'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $utc->format( 'Y-m-d H:i:s' ),
</span><span class="cx" style="display: block; padding: 0 10px"> iso8601_to_datetime( $local->format( $format ), 'gmt' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'UTC time from local time.'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $local->format( 'Y-m-d H:i:s' ),
</span><span class="cx" style="display: block; padding: 0 10px"> iso8601_to_datetime( $local->format( $format_no_tz ) ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'Local time from local time w/o timezone.'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $utc->format( 'Y-m-d H:i:s' ),
</span><span class="cx" style="display: block; padding: 0 10px"> iso8601_to_datetime( $local->format( $format_no_tz ), 'gmt' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'UTC time from local time w/o timezone.'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $local->format( 'Y-m-d H:i:s' ),
</span><span class="cx" style="display: block; padding: 0 10px"> iso8601_to_datetime( $utc->format( $format ) ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'Local time from UTC time.'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $utc->format( 'Y-m-d H:i:s' ),
</span><span class="cx" style="display: block; padding: 0 10px"> iso8601_to_datetime( $utc->format( $format ), 'gmt' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'UTC time from UTC time.'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $local->format( 'Y-m-d H:i:s' ),
</span><span class="cx" style="display: block; padding: 0 10px"> iso8601_to_datetime( $utc->format( $format_no_tz ) . 'Z' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'Local time from UTC w/ Z timezone.'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $utc->format( 'Y-m-d H:i:s' ),
</span><span class="cx" style="display: block; padding: 0 10px"> iso8601_to_datetime( $utc->format( $format_no_tz ) . 'Z', 'gmt' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'UTC time from UTC w/ Z timezone.'
</span></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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/ent2ncr.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,7 +10,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_converts_named_entities_to_numeric_character_references( $entity, $ncr ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $entity = '&' . $entity . ';';
</span><span class="cx" style="display: block; padding: 0 10px"> $ncr = '&#' . $ncr . ';';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $ncr, ent2ncr( $entity ), $entity );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $ncr, ent2ncr( $entity ), $entity );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingisoDescramblerphp"></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/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 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/isoDescrambler.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,6 +9,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * =?iso-8859-1?q?this=20is=20some=20text?=
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_decodes_iso_8859_1_rfc2047_q_encoding() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'this is some text', wp_iso_descrambler( '=?iso-8859-1?q?this=20is=20some=20text?=' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'this is some text', wp_iso_descrambler( '=?iso-8859-1?q?this=20is=20some=20text?=' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingredirectphp"></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/redirect.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/redirect.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/formatting/redirect.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,19 +46,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_sanitize_redirect() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://example.com/watchthelinefeedgo', wp_sanitize_redirect( 'http://example.com/watchthelinefeed%0Ago' ) );
- $this->assertEquals( 'http://example.com/watchthelinefeedgo', wp_sanitize_redirect( 'http://example.com/watchthelinefeed%0ago' ) );
- $this->assertEquals( 'http://example.com/watchthecarriagereturngo', wp_sanitize_redirect( 'http://example.com/watchthecarriagereturn%0Dgo' ) );
- $this->assertEquals( 'http://example.com/watchthecarriagereturngo', wp_sanitize_redirect( 'http://example.com/watchthecarriagereturn%0dgo' ) );
- $this->assertEquals( 'http://example.com/watchtheallowedcharacters-~+_.?#=&;,/:%!*stay', wp_sanitize_redirect( 'http://example.com/watchtheallowedcharacters-~+_.?#=&;,/:%!*stay' ) );
- $this->assertEquals( 'http://example.com/watchtheutf8convert%F0%9D%8C%86', wp_sanitize_redirect( "http://example.com/watchtheutf8convert\xf0\x9d\x8c\x86" ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://example.com/watchthelinefeedgo', wp_sanitize_redirect( 'http://example.com/watchthelinefeed%0Ago' ) );
+ $this->assertSame( 'http://example.com/watchthelinefeedgo', wp_sanitize_redirect( 'http://example.com/watchthelinefeed%0ago' ) );
+ $this->assertSame( 'http://example.com/watchthecarriagereturngo', wp_sanitize_redirect( 'http://example.com/watchthecarriagereturn%0Dgo' ) );
+ $this->assertSame( 'http://example.com/watchthecarriagereturngo', wp_sanitize_redirect( 'http://example.com/watchthecarriagereturn%0dgo' ) );
+ $this->assertSame( 'http://example.com/watchtheallowedcharacters-~+_.?#=&;,/:%!*stay', wp_sanitize_redirect( 'http://example.com/watchtheallowedcharacters-~+_.?#=&;,/:%!*stay' ) );
+ $this->assertSame( 'http://example.com/watchtheutf8convert%F0%9D%8C%86', wp_sanitize_redirect( "http://example.com/watchtheutf8convert\xf0\x9d\x8c\x86" ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Nesting checks.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://example.com/watchthecarriagereturngo', wp_sanitize_redirect( 'http://example.com/watchthecarriagereturn%0%0ddgo' ) );
- $this->assertEquals( 'http://example.com/watchthecarriagereturngo', wp_sanitize_redirect( 'http://example.com/watchthecarriagereturn%0%0DDgo' ) );
- $this->assertEquals( 'http://example.com/whyisthisintheurl/?param[1]=foo', wp_sanitize_redirect( 'http://example.com/whyisthisintheurl/?param[1]=foo' ) );
- $this->assertEquals( 'http://[2606:2800:220:6d:26bf:1447:aa7]/', wp_sanitize_redirect( 'http://[2606:2800:220:6d:26bf:1447:aa7]/' ) );
- $this->assertEquals( 'http://example.com/search.php?search=(amistillhere)', wp_sanitize_redirect( 'http://example.com/search.php?search=(amistillhere)' ) );
- $this->assertEquals( 'http://example.com/@username', wp_sanitize_redirect( 'http://example.com/@username' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://example.com/watchthecarriagereturngo', wp_sanitize_redirect( 'http://example.com/watchthecarriagereturn%0%0ddgo' ) );
+ $this->assertSame( 'http://example.com/watchthecarriagereturngo', wp_sanitize_redirect( 'http://example.com/watchthecarriagereturn%0%0DDgo' ) );
+ $this->assertSame( 'http://example.com/whyisthisintheurl/?param[1]=foo', wp_sanitize_redirect( 'http://example.com/whyisthisintheurl/?param[1]=foo' ) );
+ $this->assertSame( 'http://[2606:2800:220:6d:26bf:1447:aa7]/', wp_sanitize_redirect( 'http://[2606:2800:220:6d:26bf:1447:aa7]/' ) );
+ $this->assertSame( 'http://example.com/search.php?search=(amistillhere)', wp_sanitize_redirect( 'http://example.com/search.php?search=(amistillhere)' ) );
+ $this->assertSame( 'http://example.com/@username', wp_sanitize_redirect( 'http://example.com/@username' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,8 +65,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @group 36998
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_sanitize_redirect_should_encode_spaces() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://example.com/test%20spaces', wp_sanitize_redirect( 'http://example.com/test%20spaces' ) );
- $this->assertEquals( 'http://example.com/test%20spaces%20in%20url', wp_sanitize_redirect( 'http://example.com/test spaces in url' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://example.com/test%20spaces', wp_sanitize_redirect( 'http://example.com/test%20spaces' ) );
+ $this->assertSame( 'http://example.com/test%20spaces%20in%20url', wp_sanitize_redirect( 'http://example.com/test spaces in url' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -73,7 +73,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider valid_url_provider
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_validate_redirect_valid_url( $url, $expected ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_validate_redirect( $url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_validate_redirect( $url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -183,7 +183,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Set the global to current URI.
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['REQUEST_URI'] = $current_uri;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_validate_redirect( $url, false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_validate_redirect( $url, false ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Delete or reset the global as required.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $unset ) {
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionsallowedProtocolsphp"></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/functions/allowedProtocols.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/allowedProtocols.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/functions/allowedProtocols.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,8 +29,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string Example URL.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_allowed_protocols( $protocol, $url ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $url, esc_url( $url, $protocol ) );
- $this->assertEquals( $url, esc_url( $url, wp_allowed_protocols() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $url, esc_url( $url, $protocol ) );
+ $this->assertSame( $url, esc_url( $url, wp_allowed_protocols() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionsanonymizationphp"></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/functions/anonymization.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/anonymization.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/functions/anonymization.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Todo test ipv6_fallback mode if keeping it.*/
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_result, $actual_result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_result, $actual_result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -226,7 +226,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Test date anonymization of `wp_privacy_anonymize_data()`.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_anonymize_date() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0000-00-00 00:00:00', wp_privacy_anonymize_data( 'date', '2003-12-25 12:34:56' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0000-00-00 00:00:00', wp_privacy_anonymize_data( 'date', '2003-12-25 12:34:56' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -234,7 +234,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_anonymize_text() {
</span><span class="cx" style="display: block; padding: 0 10px"> $text = __( 'Four score and seven years ago' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '[deleted]', wp_privacy_anonymize_data( 'text', $text ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '[deleted]', wp_privacy_anonymize_data( 'text', $text ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -242,7 +242,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_anonymize_long_text() {
</span><span class="cx" style="display: block; padding: 0 10px"> $text = __( 'Four score and seven years ago' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'This content was deleted by the author.', wp_privacy_anonymize_data( 'longtext', $text ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'This content was deleted by the author.', wp_privacy_anonymize_data( 'longtext', $text ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionscanonicalCharsetphp"></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/functions/canonicalCharset.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/canonicalCharset.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/functions/canonicalCharset.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,43 +9,43 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Functions_CanonicalCharset extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_utf_8_lower() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'UTF-8', _canonical_charset( 'utf-8' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'UTF-8', _canonical_charset( 'utf-8' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_utf_8_upper() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'UTF-8', _canonical_charset( 'UTF-8' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'UTF-8', _canonical_charset( 'UTF-8' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_utf_8_mixxed() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'UTF-8', _canonical_charset( 'Utf-8' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'UTF-8', _canonical_charset( 'Utf-8' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_utf_8() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'UTF-8', _canonical_charset( 'UTF8' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'UTF-8', _canonical_charset( 'UTF8' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_iso_lower() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'ISO-8859-1', _canonical_charset( 'iso-8859-1' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'ISO-8859-1', _canonical_charset( 'iso-8859-1' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_iso_upper() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'ISO-8859-1', _canonical_charset( 'ISO-8859-1' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'ISO-8859-1', _canonical_charset( 'ISO-8859-1' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_iso_mixxed() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'ISO-8859-1', _canonical_charset( 'Iso8859-1' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'ISO-8859-1', _canonical_charset( 'Iso8859-1' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_iso() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'ISO-8859-1', _canonical_charset( 'ISO8859-1' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'ISO-8859-1', _canonical_charset( 'ISO8859-1' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_random() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'random', _canonical_charset( 'random' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'random', _canonical_charset( 'random' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_empty() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', _canonical_charset( '' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', _canonical_charset( '' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,32 +55,32 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $orig_blog_charset = get_option( 'blog_charset' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', 'utf8' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'UTF-8', get_option( 'blog_charset' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'UTF-8', get_option( 'blog_charset' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', 'utf-8' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'UTF-8', get_option( 'blog_charset' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'UTF-8', get_option( 'blog_charset' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', 'UTF8' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'UTF-8', get_option( 'blog_charset' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'UTF-8', get_option( 'blog_charset' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', 'UTF-8' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'UTF-8', get_option( 'blog_charset' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'UTF-8', get_option( 'blog_charset' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', 'ISO-8859-1' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'ISO-8859-1', get_option( 'blog_charset' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'ISO-8859-1', get_option( 'blog_charset' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', 'ISO8859-1' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'ISO-8859-1', get_option( 'blog_charset' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'ISO-8859-1', get_option( 'blog_charset' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', 'iso8859-1' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'ISO-8859-1', get_option( 'blog_charset' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'ISO-8859-1', get_option( 'blog_charset' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', 'iso-8859-1' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'ISO-8859-1', get_option( 'blog_charset' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'ISO-8859-1', get_option( 'blog_charset' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Arbitrary strings are passed through.
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', 'foobarbaz' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foobarbaz', get_option( 'blog_charset' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foobarbaz', get_option( 'blog_charset' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', $orig_blog_charset );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionscleanupHeaderCommentphp"></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/functions/cleanupHeaderComment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/cleanupHeaderComment.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/functions/cleanupHeaderComment.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,7 +17,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $expected
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_cleanup_header_comment( $test_string, $expected ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, _cleanup_header_comment( $test_string ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, _cleanup_header_comment( $test_string ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionsgetWeekstartendphp"></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/functions/getWeekstartend.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/getWeekstartend.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/functions/getWeekstartend.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,7 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'end' => 1455494399,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_weekstartend( '2016-02-12' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_weekstartend( '2016-02-12' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_start_of_week_sunday() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'end' => 1455407999,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_weekstartend( '2016-02-12', 0 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_weekstartend( '2016-02-12', 0 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_start_of_week_should_fall_back_on_start_of_week_option() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,7 +31,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'end' => 1455580799,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_weekstartend( '2016-02-12' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_weekstartend( '2016-02-12' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_start_of_week_should_fall_back_on_sunday_when_option_is_missing() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -42,6 +42,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'end' => 1455407999,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_weekstartend( '2016-02-12' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_weekstartend( '2016-02-12' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionsnumberFormatI18nphp"></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/functions/numberFormatI18n.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/numberFormatI18n.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/functions/numberFormatI18n.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,8 +16,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['wp_locale'] = $locale;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '123,457', $actual_1 );
- $this->assertEquals( '123,456.7890', $actual_2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '123,457', $actual_1 );
+ $this->assertSame( '123,456.7890', $actual_2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_should_respect_number_format_of_locale() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,17 +33,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['wp_locale']->number_format['decimal_point'] = $decimal_point;
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['wp_locale']->number_format['thousands_sep'] = $thousands_sep;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '123^457', $actual_1 );
- $this->assertEquals( '123^456@7890', $actual_2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '123^457', $actual_1 );
+ $this->assertSame( '123^456@7890', $actual_2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_should_default_to_en_us_format() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '123,457', number_format_i18n( 123456.789, 0 ) );
- $this->assertEquals( '123,456.7890', number_format_i18n( 123456.789, 4 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '123,457', number_format_i18n( 123456.789, 0 ) );
+ $this->assertSame( '123,456.7890', number_format_i18n( 123456.789, 4 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_should_handle_negative_precision() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '123,457', number_format_i18n( 123456.789, 0 ) );
- $this->assertEquals( '123,456.7890', number_format_i18n( 123456.789, -4 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '123,457', number_format_i18n( 123456.789, 0 ) );
+ $this->assertSame( '123,456.7890', number_format_i18n( 123456.789, -4 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionsremoveQueryArgphp"></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/functions/removeQueryArg.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/removeQueryArg.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/functions/removeQueryArg.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,7 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = remove_query_arg( $keys_to_remove, $url );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $actual );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function remove_query_arg_provider() {
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionswpGetArchivesphp"></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/functions/wpGetArchives.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/wpGetArchives.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/functions/wpGetArchives.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,12 +31,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_get_archives_default() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected['default'] = "<li><a href='" . $this->month_url . "'>" . gmdate( 'F Y' ) . '</a></li>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected['default'], trim( wp_get_archives( array( 'echo' => false ) ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected['default'], trim( wp_get_archives( array( 'echo' => false ) ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_get_archives_type() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected['type'] = "<li><a href='" . $this->year_url . "'>" . gmdate( 'Y' ) . '</a></li>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $expected['type'],
</span><span class="cx" style="display: block; padding: 0 10px"> trim(
</span><span class="cx" style="display: block; padding: 0 10px"> wp_get_archives(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,7 +71,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <li><a href='$link4'>$title4</a></li>
</span><span class="cx" style="display: block; padding: 0 10px"> <li><a href='$link5'>$title5</a></li>
</span><span class="cx" style="display: block; padding: 0 10px"> EOF;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL(
</ins><span class="cx" style="display: block; padding: 0 10px"> $expected['limit'],
</span><span class="cx" style="display: block; padding: 0 10px"> trim(
</span><span class="cx" style="display: block; padding: 0 10px"> wp_get_archives(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -87,7 +87,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_get_archives_format() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected['format'] = "<option value='" . $this->month_url . "'> " . gmdate( 'F Y' ) . ' </option>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $expected['format'],
</span><span class="cx" style="display: block; padding: 0 10px"> trim(
</span><span class="cx" style="display: block; padding: 0 10px"> wp_get_archives(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -102,7 +102,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_get_archives_before_and_after() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected['before_and_after'] = "<div><a href='" . $this->month_url . "'>" . gmdate( 'F Y' ) . '</a></div>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $expected['before_and_after'],
</span><span class="cx" style="display: block; padding: 0 10px"> trim(
</span><span class="cx" style="display: block; padding: 0 10px"> wp_get_archives(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -119,7 +119,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_get_archives_show_post_count() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected['show_post_count'] = "<li><a href='" . $this->month_url . "'>" . gmdate( 'F Y' ) . '</a> (8)</li>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $expected['show_post_count'],
</span><span class="cx" style="display: block; padding: 0 10px"> trim(
</span><span class="cx" style="display: block; padding: 0 10px"> wp_get_archives(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -153,7 +153,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <li><a href='{$oct_url}'>October 2012</a></li>
</span><span class="cx" style="display: block; padding: 0 10px"> <li><a href='{$this->month_url}'>$date_full</a></li>
</span><span class="cx" style="display: block; padding: 0 10px"> EOF;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL(
</ins><span class="cx" style="display: block; padding: 0 10px"> $expected['order_asc'],
</span><span class="cx" style="display: block; padding: 0 10px"> trim(
</span><span class="cx" style="display: block; padding: 0 10px"> wp_get_archives(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -169,7 +169,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <li><a href='{$this->month_url}'>$date_full</a></li>
</span><span class="cx" style="display: block; padding: 0 10px"> <li><a href='{$oct_url}'>October 2012</a></li>
</span><span class="cx" style="display: block; padding: 0 10px"> EOF;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL(
</ins><span class="cx" style="display: block; padding: 0 10px"> $expected['order_desc'],
</span><span class="cx" style="display: block; padding: 0 10px"> trim(
</span><span class="cx" style="display: block; padding: 0 10px"> wp_get_archives(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -204,6 +204,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_type' => 'taco',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, trim( $archives ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, trim( $archives ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionswpListFilterphp"></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/functions/wpListFilter.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/wpListFilter.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/functions/wpListFilter.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,7 +49,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'AND'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $list ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $list ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'foo', $list );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'bar', $list );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,7 +63,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'OR'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $list ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $list ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'foo', $list );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'bar', $list );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'baz', $list );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,7 +78,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'NOT'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $list ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $list ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'baz', $list );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,7 +92,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'AND',
</span><span class="cx" style="display: block; padding: 0 10px"> 'name'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'bar' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -111,7 +111,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'OR',
</span><span class="cx" style="display: block; padding: 0 10px"> 'name'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'bar' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,12 +130,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'NOT',
</span><span class="cx" style="display: block; padding: 0 10px"> 'name'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'baz' => 'baz' ), $list );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'baz' => 'baz' ), $list );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_list_pluck() {
</span><span class="cx" style="display: block; padding: 0 10px"> $list = wp_list_pluck( $this->object_list, 'name' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'bar' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -145,7 +145,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $list = wp_list_pluck( $this->array_list, 'name' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'bar' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -160,7 +160,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_list_pluck_index_key() {
</span><span class="cx" style="display: block; padding: 0 10px"> $list = wp_list_pluck( $this->array_list, 'name', 'id' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'f' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'b' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -175,7 +175,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_list_pluck_object_index_key() {
</span><span class="cx" style="display: block; padding: 0 10px"> $list = wp_list_pluck( $this->object_list, 'name', 'id' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'f' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'b' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -190,7 +190,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_list_pluck_missing_index_key() {
</span><span class="cx" style="display: block; padding: 0 10px"> $list = wp_list_pluck( $this->array_list, 'name', 'nonexistent' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 0 => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 1 => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -207,7 +207,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $array_list = $this->array_list;
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $array_list['bar']['id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $list = wp_list_pluck( $array_list, 'name', 'id' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'f' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 0 => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -224,7 +224,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $mixed_list = $this->array_list;
</span><span class="cx" style="display: block; padding: 0 10px"> $mixed_list['bar'] = (object) $mixed_list['bar'];
</span><span class="cx" style="display: block; padding: 0 10px"> $list = wp_list_pluck( $mixed_list, 'name', 'id' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'f' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'b' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -247,7 +247,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'stdClass', $ref_list[1] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $list = wp_list_pluck( $ref_list, 'name' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -272,7 +272,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'stdClass', $ref_list[1] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $list = wp_list_pluck( $ref_list, 'name', 'id' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'f' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'b' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -286,13 +286,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_filter_object_list_nested_array_and() {
</span><span class="cx" style="display: block; padding: 0 10px"> $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'AND' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $list ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $list ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'baz', $list );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_filter_object_list_nested_array_not() {
</span><span class="cx" style="display: block; padding: 0 10px"> $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'red' ) ), 'NOT' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $list ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $list ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'bar', $list );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'baz', $list );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -306,7 +306,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'OR'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $list ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $list ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'foo', $list );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'baz', $list );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -313,7 +313,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_filter_object_list_nested_array_or_singular() {
</span><span class="cx" style="display: block; padding: 0 10px"> $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'OR' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $list ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $list ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'baz', $list );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -320,12 +320,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_filter_object_list_nested_array_and_field() {
</span><span class="cx" style="display: block; padding: 0 10px"> $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'AND', 'name' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'baz' => 'baz' ), $list );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'baz' => 'baz' ), $list );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_filter_object_list_nested_array_not_field() {
</span><span class="cx" style="display: block; padding: 0 10px"> $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'green' ) ), 'NOT', 'name' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'baz' => 'baz',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -344,7 +344,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'OR',
</span><span class="cx" style="display: block; padding: 0 10px"> 'name'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'baz' => 'baz',
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionswpListUtilphp"></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/functions/wpListUtil.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/wpListUtil.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/functions/wpListUtil.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -691,7 +691,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $order Either 'ASC' or 'DESC'.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_list_sort( $list, $orderby, $order, $expected ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_list_sort( $list, $orderby, $order ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_list_sort( $list, $orderby, $order ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_test_wp_list_sort_preserve_keys() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1016,7 +1016,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $order Either 'ASC' or 'DESC'.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_list_sort_preserve_keys( $list, $orderby, $order, $expected ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_list_sort( $list, $orderby, $order, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_list_sort( $list, $orderby, $order, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_list_util_get_input() {
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionswpRemoteFopenphp"></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/functions/wpRemoteFopen.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/wpRemoteFopen.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/functions/wpRemoteFopen.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,6 +29,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = wp_remote_fopen( $url );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $response );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 40148, strlen( $response ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 40148, strlen( $response ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionsphp"></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/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/functions.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,7 +9,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $x->_baba = 5;
</span><span class="cx" style="display: block; padding: 0 10px"> $x->yZ = 'baba'; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
</span><span class="cx" style="display: block; padding: 0 10px"> $x->a = array( 5, 111, 'x' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> '_baba' => 5,
</span><span class="cx" style="display: block; padding: 0 10px"> 'yZ' => 'baba',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -18,19 +18,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_parse_args( $x )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $y = new MockClass;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), wp_parse_args( $y ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), wp_parse_args( $y ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_parse_args_array() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Arrays.
</span><span class="cx" style="display: block; padding: 0 10px"> $a = array();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), wp_parse_args( $a ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), wp_parse_args( $a ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $b = array(
</span><span class="cx" style="display: block; padding: 0 10px"> '_baba' => 5,
</span><span class="cx" style="display: block; padding: 0 10px"> 'yZ' => 'baba',
</span><span class="cx" style="display: block; padding: 0 10px"> 'a' => array( 5, 111, 'x' ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> '_baba' => 5,
</span><span class="cx" style="display: block; padding: 0 10px"> 'yZ' => 'baba',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,7 +46,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $x->yZ = 'baba'; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
</span><span class="cx" style="display: block; padding: 0 10px"> $x->a = array( 5, 111, 'x' );
</span><span class="cx" style="display: block; padding: 0 10px"> $d = array( 'pu' => 'bu' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'pu' => 'bu',
</span><span class="cx" style="display: block; padding: 0 10px"> '_baba' => 5,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,7 +56,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_parse_args( $x, $d )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $e = array( '_baba' => 6 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> '_baba' => 5,
</span><span class="cx" style="display: block; padding: 0 10px"> 'yZ' => 'baba',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -69,10 +69,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_parse_args_other() {
</span><span class="cx" style="display: block; padding: 0 10px"> $b = true;
</span><span class="cx" style="display: block; padding: 0 10px"> wp_parse_str( $b, $s );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $s, wp_parse_args( $b ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $s, wp_parse_args( $b ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $q = 'x=5&_baba=dudu&';
</span><span class="cx" style="display: block; padding: 0 10px"> wp_parse_str( $q, $ss );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $ss, wp_parse_args( $q ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $ss, wp_parse_args( $q ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -136,7 +136,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_wp_normalize_path
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_normalize_path( $path, $expected ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_normalize_path( $path ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_normalize_path( $path ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_wp_normalize_path() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -168,32 +168,32 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $testdir = DIR_TESTDATA . '/images/';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Sanity check.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'abcdefg.png', wp_unique_filename( $testdir, 'abcdefg.png' ), 'Sanitiy check failed' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'abcdefg.png', wp_unique_filename( $testdir, 'abcdefg.png' ), 'Sanitiy check failed' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check number is appended for file already exists.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFileExists( $testdir . 'test-image.png', 'Test image does not exist' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test-image-1.png', wp_unique_filename( $testdir, 'test-image.png' ), 'Number not appended correctly' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test-image-1.png', wp_unique_filename( $testdir, 'test-image.png' ), 'Number not appended correctly' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFileNotExists( $testdir . 'test-image-1.png' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check special chars.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'testtest-image.png', wp_unique_filename( $testdir, 'testtést-imagé.png' ), 'Filename with special chars failed' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'testtest-image.png', wp_unique_filename( $testdir, 'testtést-imagé.png' ), 'Filename with special chars failed' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check special chars with potential conflicting name.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test-image-1.png', wp_unique_filename( $testdir, 'tést-imagé.png' ), 'Filename with special chars failed' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test-image-1.png', wp_unique_filename( $testdir, 'tést-imagé.png' ), 'Filename with special chars failed' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check with single quotes in name (somehow).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'abcdefgh.png', wp_unique_filename( $testdir, "abcdefg'h.png" ), 'File with quote failed' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'abcdefgh.png', wp_unique_filename( $testdir, "abcdefg'h.png" ), 'File with quote failed' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check with double quotes in name (somehow).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'abcdefgh.png', wp_unique_filename( $testdir, 'abcdefg"h.png' ), 'File with quote failed' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'abcdefgh.png', wp_unique_filename( $testdir, 'abcdefg"h.png' ), 'File with quote failed' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test crazy name (useful for regression tests).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '12af34567890@..^_qwerty-fghjkl-zx.png', wp_unique_filename( $testdir, '12%af34567890#~!@#$..%^&*()|_+qwerty fgh`jkl zx<>?:"{}[]="\'/?.png' ), 'Failed crazy file name' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '12af34567890@..^_qwerty-fghjkl-zx.png', wp_unique_filename( $testdir, '12%af34567890#~!@#$..%^&*()|_+qwerty fgh`jkl zx<>?:"{}[]="\'/?.png' ), 'Failed crazy file name' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test slashes in names.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'abcdefg.png', wp_unique_filename( $testdir, 'abcde\fg.png' ), 'Slash not removed' );
- $this->assertEquals( 'abcdefg.png', wp_unique_filename( $testdir, 'abcde\\fg.png' ), 'Double slashed not removed' );
- $this->assertEquals( 'abcdefg.png', wp_unique_filename( $testdir, 'abcde\\\fg.png' ), 'Tripple slashed not removed' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'abcdefg.png', wp_unique_filename( $testdir, 'abcde\fg.png' ), 'Slash not removed' );
+ $this->assertSame( 'abcdefg.png', wp_unique_filename( $testdir, 'abcde\\fg.png' ), 'Double slashed not removed' );
+ $this->assertSame( 'abcdefg.png', wp_unique_filename( $testdir, 'abcde\\\fg.png' ), 'Tripple slashed not removed' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -205,12 +205,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'upload_dir', array( $this, 'upload_dir_patch_basedir' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test collision with "dimension-like" original filename.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'one-blue-pixel-100x100-1.png', wp_unique_filename( $testdir, 'one-blue-pixel-100x100.png' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'one-blue-pixel-100x100-1.png', wp_unique_filename( $testdir, 'one-blue-pixel-100x100.png' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Test collision with existing sub-size filename.
</span><span class="cx" style="display: block; padding: 0 10px"> // Existing files: one-blue-pixel-100x100.png, one-blue-pixel-1-100x100.png.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'one-blue-pixel-2.png', wp_unique_filename( $testdir, 'one-blue-pixel.png' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'one-blue-pixel-2.png', wp_unique_filename( $testdir, 'one-blue-pixel.png' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Same as above with upper case extension.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'one-blue-pixel-2.png', wp_unique_filename( $testdir, 'one-blue-pixel.PNG' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'one-blue-pixel-2.png', wp_unique_filename( $testdir, 'one-blue-pixel.PNG' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'upload_dir', array( $this, 'upload_dir_patch_basedir' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -368,9 +368,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $urls as $url ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['REQUEST_URI'] = 'nothing';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "$url?foo=1", add_query_arg( 'foo', '1', $url ) );
- $this->assertEquals( "$url?foo=1", add_query_arg( array( 'foo' => '1' ), $url ) );
- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "$url?foo=1", add_query_arg( 'foo', '1', $url ) );
+ $this->assertSame( "$url?foo=1", add_query_arg( array( 'foo' => '1' ), $url ) );
+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> "$url?foo=2",
</span><span class="cx" style="display: block; padding: 0 10px"> add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -380,7 +380,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> "$url?foo=1&bar=2",
</span><span class="cx" style="display: block; padding: 0 10px"> add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -393,9 +393,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['REQUEST_URI'] = $url;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "$url?foo=1", add_query_arg( 'foo', '1' ) );
- $this->assertEquals( "$url?foo=1", add_query_arg( array( 'foo' => '1' ) ) );
- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "$url?foo=1", add_query_arg( 'foo', '1' ) );
+ $this->assertSame( "$url?foo=1", add_query_arg( array( 'foo' => '1' ) ) );
+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> "$url?foo=2",
</span><span class="cx" style="display: block; padding: 0 10px"> add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -404,7 +404,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> "$url?foo=1&bar=2",
</span><span class="cx" style="display: block; padding: 0 10px"> add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -419,9 +419,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['REQUEST_URI'] = 'nothing';
</span><span class="cx" style="display: block; padding: 0 10px"> $url = str_replace( '#frag', '', $frag_url );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "$url?foo=1#frag", add_query_arg( 'foo', '1', $frag_url ) );
- $this->assertEquals( "$url?foo=1#frag", add_query_arg( array( 'foo' => '1' ), $frag_url ) );
- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "$url?foo=1#frag", add_query_arg( 'foo', '1', $frag_url ) );
+ $this->assertSame( "$url?foo=1#frag", add_query_arg( array( 'foo' => '1' ), $frag_url ) );
+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> "$url?foo=2#frag",
</span><span class="cx" style="display: block; padding: 0 10px"> add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -431,7 +431,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $frag_url
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> "$url?foo=1&bar=2#frag",
</span><span class="cx" style="display: block; padding: 0 10px"> add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -444,9 +444,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['REQUEST_URI'] = $frag_url;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "$url?foo=1#frag", add_query_arg( 'foo', '1' ) );
- $this->assertEquals( "$url?foo=1#frag", add_query_arg( array( 'foo' => '1' ) ) );
- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "$url?foo=1#frag", add_query_arg( 'foo', '1' ) );
+ $this->assertSame( "$url?foo=1#frag", add_query_arg( array( 'foo' => '1' ) ) );
+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> "$url?foo=2#frag",
</span><span class="cx" style="display: block; padding: 0 10px"> add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -455,7 +455,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> "$url?foo=1&bar=2#frag",
</span><span class="cx" style="display: block; padding: 0 10px"> add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -481,9 +481,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $qs_urls as $url ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['REQUEST_URI'] = 'nothing';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "$url&foo=1", add_query_arg( 'foo', '1', $url ) );
- $this->assertEquals( "$url&foo=1", add_query_arg( array( 'foo' => '1' ), $url ) );
- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "$url&foo=1", add_query_arg( 'foo', '1', $url ) );
+ $this->assertSame( "$url&foo=1", add_query_arg( array( 'foo' => '1' ), $url ) );
+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> "$url&foo=2",
</span><span class="cx" style="display: block; padding: 0 10px"> add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -493,7 +493,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> "$url&foo=1&bar=2",
</span><span class="cx" style="display: block; padding: 0 10px"> add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -506,9 +506,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['REQUEST_URI'] = $url;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "$url&foo=1", add_query_arg( 'foo', '1' ) );
- $this->assertEquals( "$url&foo=1", add_query_arg( array( 'foo' => '1' ) ) );
- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "$url&foo=1", add_query_arg( 'foo', '1' ) );
+ $this->assertSame( "$url&foo=1", add_query_arg( array( 'foo' => '1' ) ) );
+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> "$url&foo=2",
</span><span class="cx" style="display: block; padding: 0 10px"> add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -517,7 +517,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> "$url&foo=1&bar=2",
</span><span class="cx" style="display: block; padding: 0 10px"> add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -536,7 +536,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_add_query_arg_numeric_keys() {
</span><span class="cx" style="display: block; padding: 0 10px"> $url = add_query_arg( array( 'foo' => 'bar' ), '1=1' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1=1&foo=bar', $url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1=1&foo=bar', $url );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $url = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -545,10 +545,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> '1=1'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1=2&foo=bar', $url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1=2&foo=bar', $url );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $url = add_query_arg( array( '1' => '2' ), 'foo=bar' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo=bar&1=2', $url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo=bar&1=2', $url );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -600,7 +600,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $mimes2 = wp_get_mime_types();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $mimes2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $mimes2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $mimes2, $mimes );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $mimes2, $mimes );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -610,32 +610,32 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $orig_blog_charset = get_option( 'blog_charset' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', 'utf8' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'UTF-8', get_option( 'blog_charset' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'UTF-8', get_option( 'blog_charset' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', 'utf-8' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'UTF-8', get_option( 'blog_charset' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'UTF-8', get_option( 'blog_charset' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', 'UTF8' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'UTF-8', get_option( 'blog_charset' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'UTF-8', get_option( 'blog_charset' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', 'UTF-8' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'UTF-8', get_option( 'blog_charset' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'UTF-8', get_option( 'blog_charset' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', 'ISO-8859-1' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'ISO-8859-1', get_option( 'blog_charset' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'ISO-8859-1', get_option( 'blog_charset' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', 'ISO8859-1' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'ISO-8859-1', get_option( 'blog_charset' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'ISO-8859-1', get_option( 'blog_charset' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', 'iso8859-1' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'ISO-8859-1', get_option( 'blog_charset' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'ISO-8859-1', get_option( 'blog_charset' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', 'iso-8859-1' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'ISO-8859-1', get_option( 'blog_charset' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'ISO-8859-1', get_option( 'blog_charset' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Arbitrary strings are passed through.
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', 'foobarbaz' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foobarbaz', get_option( 'blog_charset' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foobarbaz', get_option( 'blog_charset' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_charset', $orig_blog_charset );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -706,7 +706,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTP_USER_AGENT'] = $user_agent;
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = _device_can_upload();
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $_SERVER['HTTP_USER_AGENT'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_device_can_upload() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -888,14 +888,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $urls );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $urls );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( count( $original_urls ), $urls );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $original_urls, $urls );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $original_urls, $urls );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $exploded = array_values( array_filter( array_map( 'trim', explode( "\n", $blob ) ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> // wp_extract_urls() calls html_entity_decode().
</span><span class="cx" style="display: block; padding: 0 10px"> $decoded = array_map( 'html_entity_decode', $exploded );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $decoded, $urls );
- $this->assertEquals( $original_urls, $decoded );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $decoded, $urls );
+ $this->assertSame( $original_urls, $decoded );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $blob = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
</span><span class="cx" style="display: block; padding: 0 10px"> incididunt ut labore http://woo.com/1,2,3,4,5,6/-1-2-3-4-/woo.html et dolore magna aliqua.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -909,7 +909,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $urls );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $urls );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 8, $urls );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array_slice( $original_urls, 0, 8 ), $urls );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array_slice( $original_urls, 0, 8 ), $urls );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $blob = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
</span><span class="cx" style="display: block; padding: 0 10px"> incididunt ut labore <a href="http://woo.com/1,2,3,4,5,6/-1-2-3-4-/woo.html">343462^</a> et dolore magna aliqua.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -923,7 +923,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $urls );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $urls );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 8, $urls );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array_slice( $original_urls, 0, 8 ), $urls );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array_slice( $original_urls, 0, 8 ), $urls );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -930,7 +930,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 28786
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_json_encode() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_json_encode( 'a' ), '"a"' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_json_encode( 'a' ), '"a"' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -937,7 +937,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 28786
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_json_encode_utf8() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_json_encode( '这' ), '"\u8fd9"' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_json_encode( '这' ), '"\u8fd9"' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -958,9 +958,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $eucjp = mb_convert_encoding( 'aあb', 'EUC-JP', 'UTF-8' );
</span><span class="cx" style="display: block; padding: 0 10px"> $utf8 = mb_convert_encoding( $eucjp, 'UTF-8', 'EUC-JP' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'aあb', $utf8 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'aあb', $utf8 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '"a\u3042b"', wp_json_encode( $eucjp ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '"a\u3042b"', wp_json_encode( $eucjp ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> mb_detect_order( $old_charsets );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -983,9 +983,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $eucjp = mb_convert_encoding( 'aあb', 'EUC-JP', 'UTF-8' );
</span><span class="cx" style="display: block; padding: 0 10px"> $utf8 = mb_convert_encoding( $eucjp, 'UTF-8', 'EUC-JP' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'aあb', $utf8 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'aあb', $utf8 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '["c","a\u3042b"]', wp_json_encode( array( 'c', $eucjp ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '["c","a\u3042b"]', wp_json_encode( array( 'c', $eucjp ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> mb_detect_order( $old_charsets );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -994,7 +994,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 28786
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_json_encode_array() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_json_encode( array( 'a' ) ), '["a"]' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_json_encode( array( 'a' ) ), '["a"]' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1003,7 +1003,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_json_encode_object() {
</span><span class="cx" style="display: block; padding: 0 10px"> $object = new stdClass;
</span><span class="cx" style="display: block; padding: 0 10px"> $object->a = 'b';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_json_encode( $object ), '{"a":"b"}' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_json_encode( $object ), '{"a":"b"}' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1028,7 +1028,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_string( $date_return ), 'The date return must be a string' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $date_return, 'The date return could not be an empty string' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $date_return, 'The date does not match' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $date_return, 'The date does not match' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( new DateTime( $expected ), new DateTime( $date_return ), 'The date is not the same after the call method' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1069,8 +1069,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $extensions as $type => $extension_list ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $extension_list as $extension ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $type, wp_ext2type( $extension ) );
- $this->assertEquals( $type, wp_ext2type( strtoupper( $extension ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $type, wp_ext2type( $extension ) );
+ $this->assertSame( $type, wp_ext2type( strtoupper( $extension ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1095,7 +1095,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $ini_limit_after = ini_get( 'memory_limit' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $ini_limit_before, $ini_limit_after );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( false, $raised_limit );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $raised_limit );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( WP_MAX_MEMORY_LIMIT, $ini_limit_after );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1114,7 +1114,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $unique_uuids = array_unique( $uuids );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $uuids, $unique_uuids );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $uuids, $unique_uuids );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1183,7 +1183,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_numeric( $id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $ids[] = $id;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $ids, array_unique( $ids ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $ids, array_unique( $ids ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test with prefix.
</span><span class="cx" style="display: block; padding: 0 10px"> $ids = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1192,7 +1192,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertRegExp( '/^foo-\d+$/', $id );
</span><span class="cx" style="display: block; padding: 0 10px"> $ids[] = $id;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $ids, array_unique( $ids ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $ids, array_unique( $ids ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1204,7 +1204,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->markTestSkipped( 'The exif PHP extension is not loaded.' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_get_image_mime( $file ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_get_image_mime( $file ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1216,7 +1216,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_check_filetype_and_ext( $file, $filename ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_check_filetype_and_ext( $file, $filename ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1238,7 +1238,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'upload_mimes', array( $this, '_filter_mime_types_svg' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_check_filetype_and_ext( $file, $filename ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_check_filetype_and_ext( $file, $filename ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Cleanup.
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'upload_mimes', array( $this, '_test_add_mime_types_svg' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1263,7 +1263,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'upload_mimes', array( $this, '_filter_mime_types_woff' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_check_filetype_and_ext( $file, $filename ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_check_filetype_and_ext( $file, $filename ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Cleanup.
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'upload_mimes', array( $this, '_test_add_mime_types_woff' ) );
</span></span></pre></div>
<a id="trunktestsphpunittestsgeneralarchivesphp"></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/general/archives.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/general/archives.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/general/archives.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,7 +32,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $time1 = wp_cache_get( 'last_changed', 'posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $time1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_queries + 1, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,8 +44,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Change args, resulting in a different query string. Cache is not primed, expect 1 query.
</span><span class="cx" style="display: block; padding: 0 10px"> $result = wp_get_archives(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,8 +56,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
- $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+ $this->assertSame( $num_queries + 1, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,8 +70,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,8 +83,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
- $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+ $this->assertSame( $num_queries + 1, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -96,8 +96,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Change type. Cache is not primed, expect 1 query.
</span><span class="cx" style="display: block; padding: 0 10px"> $result = wp_get_archives(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -107,8 +107,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
- $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+ $this->assertSame( $num_queries + 1, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -120,8 +120,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Change type. Cache is not primed, expect 1 query.
</span><span class="cx" style="display: block; padding: 0 10px"> $result = wp_get_archives(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -131,8 +131,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
- $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+ $this->assertSame( $num_queries + 1, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -144,8 +144,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Change type. Cache is not primed, expect 1 query.
</span><span class="cx" style="display: block; padding: 0 10px"> $result = wp_get_archives(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -155,8 +155,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
- $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+ $this->assertSame( $num_queries + 1, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -168,7 +168,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsgeneraldocumenttitlephp"></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/general/document-title.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/general/document-title.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/general/document-title.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -80,7 +80,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'pre_get_document_title', array( $this, '_short_circuit_title' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'A Wild Title', wp_get_document_title() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'A Wild Title', wp_get_document_title() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function _short_circuit_title( $title ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -101,12 +101,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'document_title_parts', array( $this, '_front_page_title_parts' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( '/' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( '%s – Just another WordPress site', $this->blog_name ), wp_get_document_title() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( '%s – Just another WordPress site', $this->blog_name ), wp_get_document_title() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'show_on_front', 'posts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( '/' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( '%s – Just another WordPress site', $this->blog_name ), wp_get_document_title() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( '%s – Just another WordPress site', $this->blog_name ), wp_get_document_title() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function _front_page_title_parts( $parts ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -129,7 +129,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Show page name on home page if it's not the front page.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( get_permalink( $blog_page_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( 'blog-page – %s', $this->blog_name ), wp_get_document_title() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( 'blog-page – %s', $this->blog_name ), wp_get_document_title() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_paged_title() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,7 +137,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'document_title_parts', array( $this, '_paged_title_parts' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( '%s – Page 4 – Just another WordPress site', $this->blog_name ), wp_get_document_title() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( '%s – Page 4 – Just another WordPress site', $this->blog_name ), wp_get_document_title() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function _paged_title_parts( $parts ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -154,7 +154,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'document_title_parts', array( $this, '_singular_title_parts' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( 'test_title – %s', $this->blog_name ), wp_get_document_title() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( 'test_title – %s', $this->blog_name ), wp_get_document_title() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function _singular_title_parts( $parts ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -168,19 +168,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_category_title() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( '?cat=' . self::$category_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( 'test_category – %s', $this->blog_name ), wp_get_document_title() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( 'test_category – %s', $this->blog_name ), wp_get_document_title() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_search_title() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( '?s=test_title' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( 'Search Results for “test_title” – %s', $this->blog_name ), wp_get_document_title() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( 'Search Results for “test_title” – %s', $this->blog_name ), wp_get_document_title() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_author_title() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( '?author=' . self::$author_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( 'test_author – %s', $this->blog_name ), wp_get_document_title() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( 'test_author – %s', $this->blog_name ), wp_get_document_title() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_post_type_archive_title() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -203,31 +203,31 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( '?post_type=cpt' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( 'test_cpt – %s', $this->blog_name ), wp_get_document_title() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( 'test_cpt – %s', $this->blog_name ), wp_get_document_title() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_year_title() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( '?year=2015' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( '2015 – %s', $this->blog_name ), wp_get_document_title() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( '2015 – %s', $this->blog_name ), wp_get_document_title() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_month_title() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( '?monthnum=09' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( 'September 2015 – %s', $this->blog_name ), wp_get_document_title() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( 'September 2015 – %s', $this->blog_name ), wp_get_document_title() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_day_title() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( '?day=22' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( 'September 22, 2015 – %s', $this->blog_name ), wp_get_document_title() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( 'September 22, 2015 – %s', $this->blog_name ), wp_get_document_title() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_404_title() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( '?m=404' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( 'Page not found – %s', $this->blog_name ), wp_get_document_title() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( 'Page not found – %s', $this->blog_name ), wp_get_document_title() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_paged_post_title() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -235,7 +235,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'title_tag_parts', array( $this, '_paged_post_title_parts' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( 'test_title – Page 4 – %s', $this->blog_name ), wp_get_document_title() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( 'test_title – Page 4 – %s', $this->blog_name ), wp_get_document_title() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function _paged_post_title_parts( $parts ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -252,7 +252,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'document_title_parts', array( $this, '_rearrange_title_parts' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( '%s – test_title', $this->blog_name ), wp_get_document_title() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( '%s – test_title', $this->blog_name ), wp_get_document_title() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function _rearrange_title_parts( $parts ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -269,7 +269,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'document_title_separator', array( $this, '_change_title_separator' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( sprintf( 'test_title %%%% %s', $this->blog_name ), wp_get_document_title() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( sprintf( 'test_title %%%% %s', $this->blog_name ), wp_get_document_title() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function _change_title_separator( $sep ) {
</span></span></pre></div>
<a id="trunktestsphpunittestsgeneralpaginateLinksphp"></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/general/paginateLinks.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/general/paginateLinks.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/general/paginateLinks.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,7 +25,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> EXPECTED;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $links = paginate_links( array( 'total' => 50 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, $links );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, $links );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_format() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,7 +48,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'format' => 'page/%#%/',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, $links );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, $links );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_prev_next_false() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -73,7 +73,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'current' => 2,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, $links );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, $links );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_prev_next_true() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -100,7 +100,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'current' => 2,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, $links );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, $links );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function increment_i18n_count() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,7 +125,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> // The links should be:
</span><span class="cx" style="display: block; padding: 0 10px"> // < Previous 1 ... 49 50 51 ... 100 Next >
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 5, $this->i18n_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 5, $this->i18n_count );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'number_format_i18n', array( $this, 'increment_i18n_count' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -170,8 +170,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $href = $tag->attributes->getNamedItem( 'href' )->value;
</span><span class="cx" style="display: block; padding: 0 10px"> $class = $tag->attributes->getNamedItem( 'class' )->value;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $attributes['href'], $href );
- $this->assertEquals( $attributes['class'], $class );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $attributes['href'], $href );
+ $this->assertSame( $attributes['class'], $class );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Current page: 1.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -190,7 +190,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotNull( $tag );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $class = $tag->attributes->getNamedItem( 'class' )->value;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'page-numbers current', $class );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'page-numbers current', $class );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $document->loadHTML( $links[1] );
</span><span class="cx" style="display: block; padding: 0 10px"> $tag = $document->getElementsByTagName( 'a' )->item( 0 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -197,7 +197,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotNull( $tag );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $href = $tag->attributes->getNamedItem( 'href' )->value;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_pagenum_link( 2 ), $href );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_pagenum_link( 2 ), $href );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function add_query_arg( $url ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -244,7 +244,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotNull( $tag );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $href = $tag->attributes->getNamedItem( 'href' )->value;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_href, $href );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_href, $href );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -284,7 +284,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotNull( $tag );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $href = $tag->attributes->getNamedItem( 'href' )->value;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_href, $href );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_href, $href );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsgeneralresourceHintsphp"></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/general/resourceHints.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/general/resourceHints.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/general/resourceHints.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -50,7 +50,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'wp_resource_hints', array( $this, '_add_dns_prefetch_domains' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function _add_dns_prefetch_domains( $hints, $method ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -82,7 +82,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'wp_resource_hints', array( $this, '_add_preconnect_domains' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function _add_preconnect_domains( $hints, $method ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -109,7 +109,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'wp_resource_hints', array( $this, '_add_prerender_urls' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function _add_prerender_urls( $hints, $method ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -133,7 +133,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'wp_resource_hints', array( $this, '_add_dns_prefetch_long_urls' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function _add_dns_prefetch_long_urls( $hints, $method ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -159,7 +159,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_dequeue_style( 'googlefonts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -178,7 +178,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_dequeue_style( 'googlefonts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_dns_prefetch_scripts_does_not_included_registered_only() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -191,7 +191,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_deregister_script( 'jquery-elsewhere' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( $unexpected, $actual );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -205,7 +205,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_deregister_script( 'test-script' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = get_echo( 'wp_resource_hints' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -218,13 +218,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'wp_resource_hints', array( $this, '_add_malformed_url_errant_colon' ), 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = get_echo( 'wp_resource_hints' );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'wp_resource_hints', array( $this, '_add_malformed_url_errant_colon' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Unsupported Scheme.
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'wp_resource_hints', array( $this, '_add_malformed_url_unsupported_scheme' ), 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = get_echo( 'wp_resource_hints' );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'wp_resource_hints', array( $this, '_add_malformed_url_unsupported_scheme' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function _add_malformed_url_errant_colon( $hints, $method ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -259,7 +259,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'wp_resource_hints', array( $this, '_add_url_with_attributes' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function _add_url_with_attributes( $hints, $method ) {
</span></span></pre></div>
<a id="trunktestsphpunittestsgeneraltemplatephp"></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/general/template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/general/template.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/general/template.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,7 +38,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( get_site_icon_url() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_set_site_icon();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->site_icon_url, get_site_icon_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->site_icon_url, get_site_icon_url() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_remove_site_icon();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( get_site_icon_url() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -323,7 +323,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> restore_current_blog();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_custom_logo = '<a href="' . $home_url . '" class="custom-logo-link" rel="home">' . $image . '</a>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_custom_logo, get_custom_logo( $blog_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_custom_logo, get_custom_logo( $blog_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -554,8 +554,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_selected_and_checked_with_equal_values
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_selected_and_checked_with_equal_values( $selected, $current ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( " selected='selected'", selected( $selected, $current, false ) );
- $this->assertEquals( " checked='checked'", checked( $selected, $current, false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( " selected='selected'", selected( $selected, $current, false ) );
+ $this->assertSame( " checked='checked'", checked( $selected, $current, false ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_selected_and_checked_with_equal_values() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -578,8 +578,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_selected_and_checked_with_non_equal_values
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_selected_and_checked_with_non_equal_values( $selected, $current ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', selected( $selected, $current, false ) );
- $this->assertEquals( '', checked( $selected, $current, false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', selected( $selected, $current, false ) );
+ $this->assertSame( '', checked( $selected, $current, false ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_selected_and_checked_with_non_equal_values() {
</span></span></pre></div>
<a id="trunktestsphpunittestsgeneralwpErrorphp"></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/general/wpError.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/general/wpError.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/general/wpError.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,7 +60,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_WP_Error_with_code_and_empty_message_and_empty_data_should_add_error_but_not_associated_data() {
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_error = new WP_Error( 'code' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( null, $wp_error->get_error_data( 'code' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $wp_error->get_error_data( 'code' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_WP_Error_with_code_and_empty_message_and_non_empty_data_should_add_error_with_empty_message_and_that_stored_data() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -272,7 +272,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::get_error_data
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_error_data_with_empty_code_and_no_errors_should_evaluate_as_null() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( null, $this->wp_error->get_error_data() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $this->wp_error->get_error_data() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -281,7 +281,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_error_data_with_empty_code_one_error_no_data_should_evaluate_as_null() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->wp_error->add( 'code', 'message' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( null, $this->wp_error->get_error_data() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $this->wp_error->get_error_data() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -291,7 +291,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->wp_error->add( 'code', 'message' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->wp_error->add( 'code2', 'message2' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( null, $this->wp_error->get_error_data() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $this->wp_error->get_error_data() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -330,7 +330,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::get_error_data
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_error_data_with_code_and_no_errors_should_evaluate_as_null() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( null, $this->wp_error->get_error_data( 'code' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $this->wp_error->get_error_data( 'code' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -339,7 +339,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_error_data_with_code_and_one_error_with_no_data_should_evaluate_as_null() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->wp_error->add( 'code', 'message' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( null, $this->wp_error->get_error_data( 'code' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $this->wp_error->get_error_data( 'code' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -450,7 +450,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_add_with_code_empty_message_empty_data_should_not_add_error_data() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->wp_error->add( 'code', '' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( null, $this->wp_error->get_error_data( 'code' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $this->wp_error->get_error_data( 'code' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -468,7 +468,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_add_with_code_and_message_and_empty_data_should_not_alter_stored_data() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->wp_error->add( 'code', 'message' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( null, $this->wp_error->get_error_data( 'code' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $this->wp_error->get_error_data( 'code' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestshooksaddFilterphp"></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/hooks/addFilter.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/hooks/addFilter.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/hooks/addFilter.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,8 +20,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $hook->add_filter( $tag, $callback, $priority, $accepted_args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $function_index = _wp_filter_build_unique_id( $tag, $callback, $priority );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $callback, $hook->callbacks[ $priority ][ $function_index ]['function'] );
- $this->assertEquals( $accepted_args, $hook->callbacks[ $priority ][ $function_index ]['accepted_args'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $callback, $hook->callbacks[ $priority ][ $function_index ]['function'] );
+ $this->assertSame( $accepted_args, $hook->callbacks[ $priority ][ $function_index ]['accepted_args'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_add_filter_with_object() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -35,8 +35,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $hook->add_filter( $tag, $callback, $priority, $accepted_args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $function_index = _wp_filter_build_unique_id( $tag, $callback, $priority );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $callback, $hook->callbacks[ $priority ][ $function_index ]['function'] );
- $this->assertEquals( $accepted_args, $hook->callbacks[ $priority ][ $function_index ]['accepted_args'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $callback, $hook->callbacks[ $priority ][ $function_index ]['function'] );
+ $this->assertSame( $accepted_args, $hook->callbacks[ $priority ][ $function_index ]['accepted_args'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_add_filter_with_static_method() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,8 +49,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $hook->add_filter( $tag, $callback, $priority, $accepted_args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $function_index = _wp_filter_build_unique_id( $tag, $callback, $priority );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $callback, $hook->callbacks[ $priority ][ $function_index ]['function'] );
- $this->assertEquals( $accepted_args, $hook->callbacks[ $priority ][ $function_index ]['accepted_args'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $callback, $hook->callbacks[ $priority ][ $function_index ]['function'] );
+ $this->assertSame( $accepted_args, $hook->callbacks[ $priority ][ $function_index ]['accepted_args'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_add_two_filters_with_same_priority() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -124,7 +124,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $hook->add_filter( $tag, array( $b, 'action' ), 5, 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $hook->add_filter( $tag, array( $c, 'action' ), 8, 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 5, 8, 10 ), array_keys( $hook->callbacks ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 5, 8, 10 ), array_keys( $hook->callbacks ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_remove_and_add() {
</span></span></pre></div>
<a id="trunktestsphpunittestshooksapplyFiltersphp"></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/hooks/applyFilters.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/hooks/applyFilters.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/hooks/applyFilters.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,8 +20,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $returned = $hook->apply_filters( $arg, array( $arg ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $returned, $arg );
- $this->assertEquals( 1, $a->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $returned, $arg );
+ $this->assertSame( 1, $a->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_apply_filters_with_multiple_calls() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,8 +38,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $returned_one = $hook->apply_filters( $arg, array( $arg ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $returned_two = $hook->apply_filters( $returned_one, array( $returned_one ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $returned_two, $arg );
- $this->assertEquals( 2, $a->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $returned_two, $arg );
+ $this->assertSame( 2, $a->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestshooksdoActionphp"></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/hooks/doAction.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/hooks/doAction.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/hooks/doAction.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $hook->add_filter( $tag, $callback, $priority, $accepted_args );
</span><span class="cx" style="display: block; padding: 0 10px"> $hook->do_action( array( $arg ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_do_action_with_multiple_calls() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,7 +43,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $hook->do_action( array( $arg ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $hook->do_action( array( $arg ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $a->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $a->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_do_action_with_multiple_callbacks_on_same_priority() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -61,8 +61,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $hook->add_filter( $tag, $callback_two, $priority, $accepted_args );
</span><span class="cx" style="display: block; padding: 0 10px"> $hook->do_action( array( $arg ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a->get_call_count() );
- $this->assertEquals( 1, $a->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a->get_call_count() );
+ $this->assertSame( 1, $a->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_do_action_with_multiple_callbacks_on_different_priorities() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -80,8 +80,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $hook->add_filter( $tag, $callback_two, $priority + 1, $accepted_args );
</span><span class="cx" style="display: block; padding: 0 10px"> $hook->do_action( array( $arg ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a->get_call_count() );
- $this->assertEquals( 1, $a->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a->get_call_count() );
+ $this->assertSame( 1, $a->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_do_action_with_no_accepted_args() {
</span></span></pre></div>
<a id="trunktestsphpunittestshooksdoAllHookphp"></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/hooks/doAllHook.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/hooks/doAllHook.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/hooks/doAllHook.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,6 +21,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $hook->do_all_hook( $args );
</span><span class="cx" style="display: block; padding: 0 10px"> $hook->do_all_hook( $args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $a->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $a->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestshookshasFilterphp"></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/hooks/hasFilter.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/hooks/hasFilter.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/hooks/hasFilter.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,7 +16,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $hook->add_filter( $tag, $callback, $priority, $accepted_args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $priority, $hook->has_filter( $tag, $callback ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $priority, $hook->has_filter( $tag, $callback ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_has_filter_with_object() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,7 +29,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $hook->add_filter( $tag, $callback, $priority, $accepted_args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $priority, $hook->has_filter( $tag, $callback ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $priority, $hook->has_filter( $tag, $callback ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_has_filter_with_static_method() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,7 +41,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $hook->add_filter( $tag, $callback, $priority, $accepted_args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $priority, $hook->has_filter( $tag, $callback ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $priority, $hook->has_filter( $tag, $callback ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_has_filter_without_callback() {
</span></span></pre></div>
<a id="trunktestsphpunittestshookspreinitHooksphp"></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/hooks/preinitHooks.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/hooks/preinitHooks.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/hooks/preinitHooks.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $hooks = WP_Hook::build_preinitialized_hooks( $filters );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $priority1, $hooks[ $tag1 ]->has_filter( $tag1, '__return_false' ) );
- $this->assertEquals( $priority2, $hooks[ $tag2 ]->has_filter( $tag2, '__return_null' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $priority1, $hooks[ $tag1 ]->has_filter( $tag1, '__return_false' ) );
+ $this->assertSame( $priority2, $hooks[ $tag2 ]->has_filter( $tag2, '__return_null' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestshooksremoveAllFiltersphp"></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/hooks/removeAllFilters.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/hooks/removeAllFilters.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/hooks/removeAllFilters.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,6 +36,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $hook->has_filter( $tag, $callback_one ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $hook->has_filters() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $priority + 1, $hook->has_filter( $tag, $callback_two ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $priority + 1, $hook->has_filter( $tag, $callback_two ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestshttpbasephp"></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/http/base.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/http/base.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/http/base.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -57,7 +57,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $res );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $res );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, (int) $res['response']['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, (int) $res['response']['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_redirect_on_302() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -66,7 +66,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $res );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $res );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, (int) $res['response']['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, (int) $res['response']['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,7 +78,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $res );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $res );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 301, (int) $res['response']['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 301, (int) $res['response']['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,7 +90,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $res );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $res );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 302, (int) $res['response']['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 302, (int) $res['response']['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_redirections_equal() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -99,7 +99,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $res );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $res );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, (int) $res['response']['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, (int) $res['response']['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_no_head_redirections() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -108,7 +108,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $res );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $res );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 302, (int) $res['response']['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 302, (int) $res['response']['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -126,7 +126,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $res );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $res );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, (int) $res['response']['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, (int) $res['response']['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_redirections_greater() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -162,7 +162,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $res );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $res );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 302, (int) $res['response']['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 302, (int) $res['response']['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -176,7 +176,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $res );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $res );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'PASS', $res['body'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'PASS', $res['body'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -197,7 +197,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $res );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'PASS', wp_remote_retrieve_body( $res ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'PASS', wp_remote_retrieve_body( $res ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( ! empty( $res['headers']['location'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -252,9 +252,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $res );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $res );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $res['body'] ); // The body should be empty.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $res['body'] ); // The body should be empty.
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $size, $res['headers']['content-length'] ); // Check the headers are returned (and the size is the same).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $size, $filesize ); // Check that the file is written to disk correctly without any extra characters.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $size, $filesize ); // Check that the file is written to disk correctly without any extra characters.
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringStartsWith( get_temp_dir(), $res['filename'] ); // Check it's saving within the temp directory.
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -281,7 +281,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $res );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $res );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $size, $filesize ); // Check that the file is written to disk correctly without any extra characters.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $size, $filesize ); // Check that the file is written to disk correctly without any extra characters.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -304,7 +304,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $res );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $res );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $size, strlen( $res['body'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $size, strlen( $res['body'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -320,7 +320,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $res = wp_remote_post( add_query_arg( 'response_code', $response_code, $url ), array( 'timeout' => 30 ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $res );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $method, wp_remote_retrieve_body( $res ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $method, wp_remote_retrieve_body( $res ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_post_redirect_to_method_300() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -367,7 +367,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $res = wp_remote_get( $url, $args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $res );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'PASS', wp_remote_retrieve_body( $res ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'PASS', wp_remote_retrieve_body( $res ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -409,7 +409,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $res = wp_remote_get( $url, array( 'timeout' => 30 ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $res );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'PASS', wp_remote_retrieve_body( $res ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'PASS', wp_remote_retrieve_body( $res ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -424,7 +424,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $res = wp_remote_get( $url );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $res );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'PASS', wp_remote_retrieve_body( $res ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'PASS', wp_remote_retrieve_body( $res ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestshttpfunctionsphp"></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/http/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/http/functions.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/http/functions.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,9 +25,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $response );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'image/jpeg', $headers['content-type'] );
- $this->assertEquals( '40148', $headers['content-length'] );
- $this->assertEquals( '200', wp_remote_retrieve_response_code( $response ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'image/jpeg', $headers['content-type'] );
+ $this->assertSame( '40148', $headers['content-length'] );
+ $this->assertSame( 200, wp_remote_retrieve_response_code( $response ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_head_redirect() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = wp_remote_head( $url );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $response );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '301', wp_remote_retrieve_response_code( $response ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 301, wp_remote_retrieve_response_code( $response ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_head_404() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,7 +44,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = wp_remote_head( $url );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->skipTestOnTimeout( $response );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '404', wp_remote_retrieve_response_code( $response ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, wp_remote_retrieve_response_code( $response ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_request() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,9 +59,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $response );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Should return the same headers as a HEAD request.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'image/jpeg', $headers['content-type'] );
- $this->assertEquals( '40148', $headers['content-length'] );
- $this->assertEquals( '200', wp_remote_retrieve_response_code( $response ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'image/jpeg', $headers['content-type'] );
+ $this->assertSame( '40148', $headers['content-length'] );
+ $this->assertSame( 200, wp_remote_retrieve_response_code( $response ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_redirect() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,9 +75,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = wp_remote_retrieve_headers( $response );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Should return the same headers as a HEAD request.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'image/jpeg', $headers['content-type'] );
- $this->assertEquals( '40148', $headers['content-length'] );
- $this->assertEquals( '200', wp_remote_retrieve_response_code( $response ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'image/jpeg', $headers['content-type'] );
+ $this->assertSame( '40148', $headers['content-length'] );
+ $this->assertSame( 200, wp_remote_retrieve_response_code( $response ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_redirect_limit_exceeded() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -196,7 +196,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the host_only flag in the resulting WP_Http_Cookie.
</span><span class="cx" style="display: block; padding: 0 10px"> $cookie = wp_remote_retrieve_cookie( $response, 'test' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $cookie->domain, 'wordpress.org' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $cookie->domain, 'wordpress.org' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $cookie->host_only, 'host-only flag not set' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Regurgitate (Requests_Cookie -> WP_Http_Cookie -> Requests_Cookie).
</span></span></pre></div>
<a id="trunktestsphpunittestshttphttpphp"></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/http/http.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/http/http.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/http/http.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,7 +13,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_make_absolute_url( $relative_url, $absolute_url, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = WP_Http::make_absolute_url( $relative_url, $absolute_url );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function make_absolute_url_testcases() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,7 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_parse_url( $url, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = wp_parse_url( $url );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function parse_url_testcases() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -183,7 +183,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_parse_url_with_default_component() {
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = wp_parse_url( self::FULL_TEST_URL, -1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'scheme' => 'http',
</span><span class="cx" style="display: block; padding: 0 10px"> 'host' => 'host.name',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -271,7 +271,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // This primes the `$wp_header_to_desc` global:
</span><span class="cx" style="display: block; padding: 0 10px"> get_status_header_desc( 200 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array_keys( $wp_header_to_desc ), array_values( $constants ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array_keys( $wp_header_to_desc ), array_values( $constants ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestshttpremoteRetrieveHeadersphp"></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/http/remoteRetrieveHeaders.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/http/remoteRetrieveHeaders.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/http/remoteRetrieveHeaders.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,7 +13,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = array( 'headers' => $headers );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = wp_remote_retrieve_headers( $response );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $headers, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $headers, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,7 +23,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = new WP_Error( 'Some error' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = wp_remote_retrieve_headers( $response );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,6 +33,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = array( 'no_headers' => 'set' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = wp_remote_retrieve_headers( $response );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsimagebasephp"></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/image/base.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/base.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/image/base.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,7 +48,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $colors = imagecolorsforindex( $im, $rgb );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $alpha, $colors['alpha'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $alpha, $colors['alpha'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,7 +62,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $im = new Imagick( $image_path );
</span><span class="cx" style="display: block; padding: 0 10px"> $pixel = $im->getImagePixelColor( $point[0], $point[1] );
</span><span class="cx" style="display: block; padding: 0 10px"> $color = $pixel->getColorValue( imagick::COLOR_ALPHA );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $color );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $color );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -85,7 +85,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $detected_height = $image_size[1];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $width, $detected_width );
- $this->assertEquals( $height, $detected_height );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $width, $detected_width );
+ $this->assertSame( $height, $detected_height );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsimagedimensionsphp"></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/image/dimensions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/dimensions.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/image/dimensions.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,12 +10,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Landscape: resize 640x480 to fit 400x400: 400x300.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 640, 480, 400, 400, false );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 0, 0, 400, 300, 640, 480 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 0, 0, 400, 300, 640, 480 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Portrait: resize 480x640 to fit 400x400: 300x400.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 480, 640, 400, 400, false );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 0, 0, 300, 400, 480, 640 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 0, 0, 300, 400, 480, 640 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_400x0_no_crop() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,12 +22,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Landscape: resize 640x480 to fit 400w: 400x300.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 640, 480, 400, 0, false );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 0, 0, 400, 300, 640, 480 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 0, 0, 400, 300, 640, 480 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Portrait: resize 480x640 to fit 400w: 400x533.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 480, 640, 400, 0, false );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 0, 0, 400, 533, 480, 640 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 0, 0, 400, 533, 480, 640 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_0x400_no_crop() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,12 +34,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Landscape: resize 640x480 to fit 400h: 533x400.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 640, 480, 0, 400, false );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 0, 0, 533, 400, 640, 480 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 0, 0, 533, 400, 640, 480 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Portrait: resize 480x640 to fit 400h: 300x400.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 480, 640, 0, 400, false );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 0, 0, 300, 400, 480, 640 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 0, 0, 300, 400, 480, 640 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_800x800_no_crop() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,12 +46,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Landscape: resize 640x480 to fit 800x800.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 640, 480, 800, 800, false );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Portrait: resize 480x640 to fit 800x800.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 480, 640, 800, 800, false );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_800x0_no_crop() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -58,12 +58,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Landscape: resize 640x480 to fit 800w.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 640, 480, 800, 0, false );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Portrait: resize 480x640 to fit 800w.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 480, 640, 800, 0, false );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_0x800_no_crop() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,12 +70,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Landscape: resize 640x480 to fit 800h.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 640, 480, 0, 800, false );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Portrait: resize 480x640 to fit 800h.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 480, 640, 0, 800, false );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Cropped versions.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -84,12 +84,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Landscape: crop 640x480 to fit 400x400: 400x400 taken from a 480x480 crop at (80. 0).
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 640, 480, 400, 400, true );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 80, 0, 400, 400, 480, 480 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 80, 0, 400, 400, 480, 480 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Portrait: resize 480x640 to fit 400x400: 400x400 taken from a 480x480 crop at (0. 80).
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 480, 640, 400, 400, true );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 0, 80, 400, 400, 480, 480 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 0, 80, 400, 400, 480, 480 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_400x0_crop() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -96,12 +96,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Landscape: resize 640x480 to fit 400w: 400x300.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 640, 480, 400, 0, true );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 0, 0, 400, 300, 640, 480 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 0, 0, 400, 300, 640, 480 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Portrait: resize 480x640 to fit 400w: 400x533.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 480, 640, 400, 0, true );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 0, 0, 400, 533, 480, 640 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 0, 0, 400, 533, 480, 640 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_0x400_crop() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -108,12 +108,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Landscape: resize 640x480 to fit 400h: 533x400.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 640, 480, 0, 400, true );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 0, 0, 533, 400, 640, 480 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 0, 0, 533, 400, 640, 480 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Portrait: resize 480x640 to fit 400h: 300x400.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 480, 640, 0, 400, true );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 0, 0, 300, 400, 480, 640 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 0, 0, 300, 400, 480, 640 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_400x500_crop() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -120,12 +120,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Landscape: crop 640x480 to fit 400x500: 400x400 taken from a 480x480 crop at (80. 0).
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 640, 480, 400, 500, true );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 120, 0, 400, 480, 400, 480 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 120, 0, 400, 480, 400, 480 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Portrait: resize 480x640 to fit 400x400: 400x400 taken from a 480x480 crop at (0. 80).
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 480, 640, 400, 500, true );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 0, 20, 400, 500, 480, 600 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 0, 20, 400, 500, 480, 600 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_640x480() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -143,12 +143,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Crop 640x480 to fit 640x480 (no change).
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 640, 480, 640, 480, true );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 0, 0, 640, 480, 640, 480 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 0, 0, 640, 480, 640, 480 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Resize 640x480 to fit 640x480 (no change).
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 640, 480, 640, 480, false );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 0, 0, 640, 480, 640, 480 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 0, 0, 640, 480, 640, 480 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'wp_image_resize_identical_dimensions', '__return_true' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -161,25 +161,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // src_x = 0 (left), src_y = 0 (top).
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 640, 480, 400, 500, array( 'left', 'top' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 0, 0, 400, 480, 400, 480 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 0, 0, 400, 480, 400, 480 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Portrait: resize 480x640 to fit 400x400: 400x400 taken from a 480x480 crop.
</span><span class="cx" style="display: block; padding: 0 10px"> // src_x = 0 (left), src_y = 0 (top).
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 480, 640, 400, 500, array( 'left', 'top' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 0, 0, 400, 500, 480, 600 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 0, 0, 400, 500, 480, 600 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Landscape: crop 640x480 to fit 400x500: 400x400 taken from a 480x480 crop.
</span><span class="cx" style="display: block; padding: 0 10px"> // src_x = 240 (left), src_y = 0 (due to landscape crop).
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 640, 480, 400, 500, array( 'right', 'bottom' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 240, 0, 400, 480, 400, 480 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 240, 0, 400, 480, 400, 480 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Portrait: resize 480x640 to fit 400x400: 400x400 taken from a 480x480 crop.
</span><span class="cx" style="display: block; padding: 0 10px"> // src_x = 0 (due to portrait crop), src_y = 40 (bottom).
</span><span class="cx" style="display: block; padding: 0 10px"> $out = image_resize_dimensions( 480, 640, 400, 500, array( 'right', 'bottom' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 0, 0, 0, 40, 400, 500, 480, 600 ), $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 0, 0, 0, 40, 400, 500, 480, 600 ), $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsimageeditorphp"></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/image/editor.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/editor.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/image/editor.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,20 +74,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $editor->set_mime_type( 'image/jpeg' ); // Ensure mime-specific filters act properly.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check default value.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 82, $editor->get_quality() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 82, $editor->get_quality() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure the quality filters do not have precedence if created after editor instantiation.
</span><span class="cx" style="display: block; padding: 0 10px"> $func_100_percent = array( $this, 'return_integer_100' );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'wp_editor_set_quality', $func_100_percent );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 82, $editor->get_quality() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 82, $editor->get_quality() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $func_95_percent = array( $this, 'return_integer_95' );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'jpeg_quality', $func_95_percent );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 82, $editor->get_quality() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 82, $editor->get_quality() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure set_quality() works and overrides the filters.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $editor->set_quality( 75 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 75, $editor->get_quality() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 75, $editor->get_quality() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Get a new editor to clear default quality state.
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $editor );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -95,7 +95,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $editor->set_mime_type( 'image/jpeg' ); // Ensure mime-specific filters act properly.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure jpeg_quality filter applies if it exists before editor instantiation.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 95, $editor->get_quality() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 95, $editor->get_quality() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Get a new editor to clear jpeg_quality state.
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'jpeg_quality', $func_95_percent );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -103,7 +103,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $editor = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure wp_editor_set_quality filter applies if it exists before editor instantiation.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 100, $editor->get_quality() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 100, $editor->get_quality() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Clean up.
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'wp_editor_set_quality', $func_100_percent );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,19 +130,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test with no parameters.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'canola-100x50.jpg', wp_basename( $editor->generate_filename() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'canola-100x50.jpg', wp_basename( $editor->generate_filename() ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test with a suffix only.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'canola-new.jpg', wp_basename( $editor->generate_filename( 'new' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'canola-new.jpg', wp_basename( $editor->generate_filename( 'new' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test with a destination dir only.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( trailingslashit( realpath( get_temp_dir() ) ), trailingslashit( realpath( dirname( $editor->generate_filename( null, get_temp_dir() ) ) ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( trailingslashit( realpath( get_temp_dir() ) ), trailingslashit( realpath( dirname( $editor->generate_filename( null, get_temp_dir() ) ) ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test with a suffix only.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'canola-100x50.png', wp_basename( $editor->generate_filename( null, null, 'png' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'canola-100x50.png', wp_basename( $editor->generate_filename( null, null, 'png' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Combo!
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( trailingslashit( realpath( get_temp_dir() ) ) . 'canola-new.png', $editor->generate_filename( 'new', realpath( get_temp_dir() ), 'png' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( trailingslashit( realpath( get_temp_dir() ) ) . 'canola-new.png', $editor->generate_filename( 'new', realpath( get_temp_dir() ), 'png' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -166,7 +166,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $property->setAccessible( true );
</span><span class="cx" style="display: block; padding: 0 10px"> $property->setValue( $editor, $size );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $size, $editor->get_size() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $size, $editor->get_size() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -189,6 +189,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $property->setAccessible( true );
</span><span class="cx" style="display: block; padding: 0 10px"> $property->setValue( $editor, $size );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '100x50', $editor->get_suffix() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '100x50', $editor->get_suffix() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsimageeditorGdphp"></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/image/editorGd.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/editorGd.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/image/editorGd.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,20 +34,20 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_supports_mime_type_jpeg() {
</span><span class="cx" style="display: block; padding: 0 10px"> $gd_image_editor = new WP_Image_Editor_GD( null );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $expected = imagetypes() & IMG_JPG;
- $this->assertEquals( $expected, $gd_image_editor->supports_mime_type( 'image/jpeg' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $expected = (bool) ( imagetypes() & IMG_JPG );
+ $this->assertSame( $expected, $gd_image_editor->supports_mime_type( 'image/jpeg' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_supports_mime_type_png() {
</span><span class="cx" style="display: block; padding: 0 10px"> $gd_image_editor = new WP_Image_Editor_GD( null );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $expected = imagetypes() & IMG_PNG;
- $this->assertEquals( $expected, $gd_image_editor->supports_mime_type( 'image/png' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $expected = (bool) ( imagetypes() & IMG_PNG );
+ $this->assertSame( $expected, $gd_image_editor->supports_mime_type( 'image/png' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_supports_mime_type_gif() {
</span><span class="cx" style="display: block; padding: 0 10px"> $gd_image_editor = new WP_Image_Editor_GD( null );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $expected = imagetypes() & IMG_GIF;
- $this->assertEquals( $expected, $gd_image_editor->supports_mime_type( 'image/gif' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $expected = (bool) ( imagetypes() & IMG_GIF );
+ $this->assertSame( $expected, $gd_image_editor->supports_mime_type( 'image/gif' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -61,7 +61,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $gd_image_editor->resize( 100, 50 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'width' => 75,
</span><span class="cx" style="display: block; padding: 0 10px"> 'height' => 50,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -98,7 +98,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_array, $resized );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_array, $resized );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Now, verify real dimensions are as expected.
</span><span class="cx" style="display: block; padding: 0 10px"> $image_path = DIR_TESTDATA . '/images/' . $resized[0]['file'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -370,7 +370,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotNull( $resized );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_array, $resized );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_array, $resized );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $resized as $key => $image_data ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $image_path = DIR_TESTDATA . '/images/' . $image_data['file'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -395,7 +395,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $gd_image_editor->resize( 100, 50, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'width' => 100,
</span><span class="cx" style="display: block; padding: 0 10px"> 'height' => 50,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -415,7 +415,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $gd_image_editor->crop( 0, 0, 50, 50 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'width' => 50,
</span><span class="cx" style="display: block; padding: 0 10px"> 'height' => 50,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -440,7 +440,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $gd_image_editor->rotate( 180 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $color_top_left, imagecolorat( $property->getValue( $gd_image_editor ), 99, 99 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $color_top_left, imagecolorat( $property->getValue( $gd_image_editor ), 99, 99 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -459,7 +459,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $gd_image_editor->flip( true, false );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $color_top_left, imagecolorat( $property->getValue( $gd_image_editor ), 0, 99 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $color_top_left, imagecolorat( $property->getValue( $gd_image_editor ), 0, 99 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsimageeditorImagickphp"></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/image/editorImagick.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/editorImagick.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/image/editorImagick.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,7 +54,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $imagick_image_editor->resize( 100, 50 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'width' => 75,
</span><span class="cx" style="display: block; padding: 0 10px"> 'height' => 50,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -91,7 +91,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_array, $resized );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_array, $resized );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Now, verify real dimensions are as expected.
</span><span class="cx" style="display: block; padding: 0 10px"> $image_path = DIR_TESTDATA . '/images/' . $resized[0]['file'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -363,7 +363,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotNull( $resized );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_array, $resized );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_array, $resized );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $resized as $key => $image_data ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $image_path = DIR_TESTDATA . '/images/' . $image_data['file'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -388,7 +388,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $imagick_image_editor->resize( 100, 50, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'width' => 100,
</span><span class="cx" style="display: block; padding: 0 10px"> 'height' => 50,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -408,7 +408,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $imagick_image_editor->crop( 0, 0, 50, 50 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'width' => 50,
</span><span class="cx" style="display: block; padding: 0 10px"> 'height' => 50,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -433,7 +433,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $imagick_image_editor->rotate( 180 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 99, 99 )->getColor() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 99, 99 )->getColor() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -452,7 +452,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $imagick_image_editor->flip( true, false );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 0, 99 )->getColor() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 0, 99 )->getColor() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -558,7 +558,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = wp_read_image_metadata( $file );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The orientation value 3 is equivalent to rotated upside down (180 degrees).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, intval( $data['orientation'] ), 'Orientation value read from does not match image file Exif data: ' . $file );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, intval( $data['orientation'] ), 'Orientation value read from does not match image file Exif data: ' . $file );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $temp_file = wp_tempnam( $file );
</span><span class="cx" style="display: block; padding: 0 10px"> $image = wp_get_image_editor( $file );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -570,7 +570,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = wp_read_image_metadata( $ret['path'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the image is no longer in The Upside Down Exif orientation.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, intval( $data['orientation'] ), 'Orientation Exif data was not updated after rotating image: ' . $file );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, intval( $data['orientation'] ), 'Orientation Exif data was not updated after rotating image: ' . $file );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Remove both the generated file ending in .tmp and tmp.jpg due to wp_tempnam().
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $temp_file );
</span></span></pre></div>
<a id="trunktestsphpunittestsimagefunctionsphp"></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/image/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/functions.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/image/functions.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,7 +186,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = wp_save_image_file( $file, $img, $mime_type, 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $ret );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $ret );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $mime_type, $this->get_mime_type( $ret['path'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $mime_type, $this->get_mime_type( $ret['path'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Clean up.
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $file );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -228,7 +228,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Make assertions.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $ret );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $ret );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $mime_type, $this->get_mime_type( $ret['path'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $mime_type, $this->get_mime_type( $ret['path'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Clean up.
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $file );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -283,7 +283,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = $img->save( trailingslashit( $temp ) . $file );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $ret );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $ret );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $mime_type, $this->get_mime_type( $ret['path'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $mime_type, $this->get_mime_type( $ret['path'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> unlink( $ret['path'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -319,7 +319,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $loaded = $editor->load();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $loaded );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'error_loading_image', $loaded->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'error_loading_image', $loaded->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -341,8 +341,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFileExists( $file );
</span><span class="cx" style="display: block; padding: 0 10px"> $image = wp_get_image_editor( $file );
</span><span class="cx" style="display: block; padding: 0 10px"> $size = $image->get_size();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 100, $size['height'] );
- $this->assertEquals( 100, $size['width'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 100, $size['height'] );
+ $this->assertSame( 100, $size['width'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $file );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -376,8 +376,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFileExists( $file );
</span><span class="cx" style="display: block; padding: 0 10px"> $image = wp_get_image_editor( $file );
</span><span class="cx" style="display: block; padding: 0 10px"> $size = $image->get_size();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 100, $size['height'] );
- $this->assertEquals( 100, $size['width'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 100, $size['height'] );
+ $this->assertSame( 100, $size['width'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $file );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsimageheaderphp"></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/image/header.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/header.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/image/header.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,8 +28,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'height' => 1200,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1200, $dimensions['dst_width'] );
- $this->assertEquals( 230, $dimensions['dst_height'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1200, $dimensions['dst_width'] );
+ $this->assertSame( 230, $dimensions['dst_height'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,8 +48,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'height' => 1200,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1200, $dimensions['dst_width'] );
- $this->assertEquals( 230, $dimensions['dst_height'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1200, $dimensions['dst_width'] );
+ $this->assertSame( 230, $dimensions['dst_height'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,8 +68,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'height' => 1200,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1200, $dimensions['dst_width'] );
- $this->assertEquals( 900, $dimensions['dst_height'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1200, $dimensions['dst_width'] );
+ $this->assertSame( 900, $dimensions['dst_height'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -88,8 +88,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'height' => 1200,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1500, $dimensions['dst_width'] ); // Max width.
- $this->assertEquals( 230, $dimensions['dst_height'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1500, $dimensions['dst_width'] ); // Max width.
+ $this->assertSame( 230, $dimensions['dst_height'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -108,8 +108,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'height' => 1200,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1600, $dimensions['dst_width'] );
- $this->assertEquals( 1200, $dimensions['dst_height'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1600, $dimensions['dst_width'] );
+ $this->assertSame( 1200, $dimensions['dst_height'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -126,10 +126,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $cropped = 'foo-cropped.png';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $object = $this->custom_image_header->create_attachment_object( $cropped, $id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo-cropped.png', $object['post_title'] );
- $this->assertEquals( 'http://localhost/' . $cropped, $object['guid'] );
- $this->assertEquals( 'custom-header', $object['context'] );
- $this->assertEquals( 'image/jpeg', $object['post_mime_type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo-cropped.png', $object['post_title'] );
+ $this->assertSame( 'http://localhost/' . $cropped, $object['guid'] );
+ $this->assertSame( 'custom-header', $object['context'] );
+ $this->assertSame( 'image/jpeg', $object['post_mime_type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_insert_cropped_attachment() {
</span></span></pre></div>
<a id="trunktestsphpunittestsimageintermediateSizephp"></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/image/intermediateSize.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/intermediateSize.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/image/intermediateSize.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,9 +56,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 100, 75, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $image );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 100, $image['width'] );
- $this->assertEquals( 75, $image['height'] );
- $this->assertEquals( 'image/jpeg', $image['mime-type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 100, $image['width'] );
+ $this->assertSame( 75, $image['height'] );
+ $this->assertSame( 'image/jpeg', $image['mime-type'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( isset( $image['path'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsimagemetaphp"></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/image/meta.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/meta.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/image/meta.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,15 +22,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $out = wp_read_image_metadata( DIR_TESTDATA . '/images/2004-07-22-DSC_0008.jpg' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 6.3, $out['aperture'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out['credit'] );
- $this->assertEquals( 'NIKON D70', $out['camera'] );
- $this->assertEquals( '', $out['caption'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out['credit'] );
+ $this->assertSame( 'NIKON D70', $out['camera'] );
+ $this->assertSame( '', $out['caption'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( strtotime( '2004-07-22 17:14:59' ), $out['created_timestamp'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out['copyright'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out['copyright'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 27, $out['focal_length'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 400, $out['iso'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1 / 40, $out['shutter_speed'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out['title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out['title'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_exif_d70_mf() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,17 +37,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Exif from a Nikon D70 - manual focus lens, so some data is unavailable.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = wp_read_image_metadata( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $out['aperture'] );
- $this->assertEquals( '', $out['credit'] );
- $this->assertEquals( 'NIKON D70', $out['camera'] );
- $this->assertEquals( '', $out['caption'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0', $out['aperture'] );
+ $this->assertSame( '', $out['credit'] );
+ $this->assertSame( 'NIKON D70', $out['camera'] );
+ $this->assertSame( '', $out['caption'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( strtotime( '2007-06-17 21:18:00' ), $out['created_timestamp'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out['copyright'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out['copyright'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, $out['focal_length'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, $out['iso'] ); // Interesting - a Nikon bug?
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1 / 500, $out['shutter_speed'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out['title'] );
- // $this->assertEquals( array( 'Flowers' ), $out['keywords'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out['title'] );
+ // $this->assertSame( array( 'Flowers' ), $out['keywords'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_exif_d70_iptc() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,15 +55,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $out = wp_read_image_metadata( DIR_TESTDATA . '/images/2004-07-22-DSC_0007.jpg' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 6.3, $out['aperture'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'IPTC Creator', $out['credit'] );
- $this->assertEquals( 'NIKON D70', $out['camera'] );
- $this->assertEquals( 'IPTC Caption', $out['caption'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'IPTC Creator', $out['credit'] );
+ $this->assertSame( 'NIKON D70', $out['camera'] );
+ $this->assertSame( 'IPTC Caption', $out['caption'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( strtotime( '2004-07-22 17:14:35' ), $out['created_timestamp'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'IPTC Copyright', $out['copyright'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'IPTC Copyright', $out['copyright'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 18, $out['focal_length'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 200, $out['iso'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1 / 25, $out['shutter_speed'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'IPTC Headline', $out['title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'IPTC Headline', $out['title'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_exif_fuji() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,15 +71,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $out = wp_read_image_metadata( DIR_TESTDATA . '/images/a2-small.jpg' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 4.5, $out['aperture'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out['credit'] );
- $this->assertEquals( 'FinePix S5600', $out['camera'] );
- $this->assertEquals( '', $out['caption'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out['credit'] );
+ $this->assertSame( 'FinePix S5600', $out['camera'] );
+ $this->assertSame( '', $out['caption'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( strtotime( '2007-09-03 10:17:03' ), $out['created_timestamp'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out['copyright'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out['copyright'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 6.3, $out['focal_length'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 64, $out['iso'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1 / 320, $out['shutter_speed'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out['title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out['title'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,15 +92,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $out = wp_read_image_metadata( DIR_TESTDATA . '/images/waffles.jpg' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, $out['aperture'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out['credit'] );
- $this->assertEquals( '', $out['camera'] );
- $this->assertEquals( '', $out['caption'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out['credit'] );
+ $this->assertSame( '', $out['camera'] );
+ $this->assertSame( '', $out['caption'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, $out['created_timestamp'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out['copyright'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out['copyright'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, $out['focal_length'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, $out['iso'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, $out['shutter_speed'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out['title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out['title'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_exif_no_data() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -108,15 +108,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $out = wp_read_image_metadata( DIR_TESTDATA . '/images/canola.jpg' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, $out['aperture'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out['credit'] );
- $this->assertEquals( '', $out['camera'] );
- $this->assertEquals( '', $out['caption'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out['credit'] );
+ $this->assertSame( '', $out['camera'] );
+ $this->assertSame( '', $out['caption'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, $out['created_timestamp'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out['copyright'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out['copyright'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, $out['focal_length'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, $out['iso'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, $out['shutter_speed'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out['title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out['title'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -126,7 +126,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Trilingual UTF-8 text in the ITPC caption-abstract field.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = wp_read_image_metadata( DIR_TESTDATA . '/images/test-image-iptc.jpg' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'This is a comment. / Это комментарий. / Βλέπετε ένα σχόλιο.', $out['caption'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'This is a comment. / Это комментарий. / Βλέπετε ένα σχόλιο.', $out['caption'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -144,18 +144,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_exif_keywords() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = wp_read_image_metadata( DIR_TESTDATA . '/images/33772.jpg' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '8', $out['aperture'] );
- $this->assertEquals( 'Photoshop Author', $out['credit'] );
- $this->assertEquals( 'DMC-LX2', $out['camera'] );
- $this->assertEquals( 'Photoshop Description', $out['caption'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '8', $out['aperture'] );
+ $this->assertSame( 'Photoshop Author', $out['credit'] );
+ $this->assertSame( 'DMC-LX2', $out['camera'] );
+ $this->assertSame( 'Photoshop Description', $out['caption'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1306315327, $out['created_timestamp'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Photoshop Copyrright Notice', $out['copyright'] );
- $this->assertEquals( '6.3', $out['focal_length'] );
- $this->assertEquals( '100', $out['iso'] );
- $this->assertEquals( '0.0025', $out['shutter_speed'] );
- $this->assertEquals( 'Photoshop Document Ttitle', $out['title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Photoshop Copyrright Notice', $out['copyright'] );
+ $this->assertSame( '6.3', $out['focal_length'] );
+ $this->assertSame( '100', $out['iso'] );
+ $this->assertSame( '0.0025', $out['shutter_speed'] );
+ $this->assertSame( 'Photoshop Document Ttitle', $out['title'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1, $out['orientation'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'beach', 'baywatch', 'LA', 'sunset' ), $out['keywords'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'beach', 'baywatch', 'LA', 'sunset' ), $out['keywords'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsimageresizephp"></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/image/resize.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/resize.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/image/resize.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,11 +29,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_resize_jpg() {
</span><span class="cx" style="display: block; padding: 0 10px"> $image = $this->resize_helper( DIR_TESTDATA . '/images/test-image.jpg', 25, 25 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test-image-25x25.jpg', wp_basename( $image ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test-image-25x25.jpg', wp_basename( $image ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> list($w, $h, $type) = getimagesize( $image );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 25, $w );
- $this->assertEquals( 25, $h );
- $this->assertEquals( IMAGETYPE_JPEG, $type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 25, $w );
+ $this->assertSame( 25, $h );
+ $this->assertSame( IMAGETYPE_JPEG, $type );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $image );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,11 +45,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->fail( sprintf( 'No PNG support in the editor engine %s on this system', $this->editor_engine ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test-image-25x25.png', wp_basename( $image ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test-image-25x25.png', wp_basename( $image ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> list($w, $h, $type) = getimagesize( $image );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 25, $w );
- $this->assertEquals( 25, $h );
- $this->assertEquals( IMAGETYPE_PNG, $type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 25, $w );
+ $this->assertSame( 25, $h );
+ $this->assertSame( IMAGETYPE_PNG, $type );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $image );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -61,11 +61,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->fail( sprintf( 'No GIF support in the editor engine %s on this system', $this->editor_engine ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test-image-25x25.gif', wp_basename( $image ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test-image-25x25.gif', wp_basename( $image ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> list($w, $h, $type) = getimagesize( $image );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 25, $w );
- $this->assertEquals( 25, $h );
- $this->assertEquals( IMAGETYPE_GIF, $type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 25, $w );
+ $this->assertSame( 25, $h );
+ $this->assertSame( IMAGETYPE_GIF, $type );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $image );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,17 +75,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $image = $this->resize_helper( DIR_TESTDATA . '/images/test-image.jpg', 100, 100 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $image );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'error_getting_dimensions', $image->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'error_getting_dimensions', $image->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_resize_thumb_128x96() {
</span><span class="cx" style="display: block; padding: 0 10px"> $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 128, 96 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-64x96.jpg', wp_basename( $image ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2007-06-17DSC_4173-64x96.jpg', wp_basename( $image ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> list($w, $h, $type) = getimagesize( $image );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 64, $w );
- $this->assertEquals( 96, $h );
- $this->assertEquals( IMAGETYPE_JPEG, $type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 64, $w );
+ $this->assertSame( 96, $h );
+ $this->assertSame( IMAGETYPE_JPEG, $type );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $image );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -93,11 +93,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_resize_thumb_128x0() {
</span><span class="cx" style="display: block; padding: 0 10px"> $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 128, 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-128x193.jpg', wp_basename( $image ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2007-06-17DSC_4173-128x193.jpg', wp_basename( $image ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> list($w, $h, $type) = getimagesize( $image );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 128, $w );
- $this->assertEquals( 193, $h );
- $this->assertEquals( IMAGETYPE_JPEG, $type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 128, $w );
+ $this->assertSame( 193, $h );
+ $this->assertSame( IMAGETYPE_JPEG, $type );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $image );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -105,11 +105,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_resize_thumb_0x96() {
</span><span class="cx" style="display: block; padding: 0 10px"> $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 0, 96 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-64x96.jpg', wp_basename( $image ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2007-06-17DSC_4173-64x96.jpg', wp_basename( $image ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> list($w, $h, $type) = getimagesize( $image );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 64, $w );
- $this->assertEquals( 96, $h );
- $this->assertEquals( IMAGETYPE_JPEG, $type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 64, $w );
+ $this->assertSame( 96, $h );
+ $this->assertSame( IMAGETYPE_JPEG, $type );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $image );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,11 +117,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_resize_thumb_150x150_crop() {
</span><span class="cx" style="display: block; padding: 0 10px"> $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 150, 150, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-150x150.jpg', wp_basename( $image ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2007-06-17DSC_4173-150x150.jpg', wp_basename( $image ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> list($w, $h, $type) = getimagesize( $image );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 150, $w );
- $this->assertEquals( 150, $h );
- $this->assertEquals( IMAGETYPE_JPEG, $type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 150, $w );
+ $this->assertSame( 150, $h );
+ $this->assertSame( IMAGETYPE_JPEG, $type );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $image );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -129,11 +129,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_resize_thumb_150x100_crop() {
</span><span class="cx" style="display: block; padding: 0 10px"> $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 150, 100, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-150x100.jpg', wp_basename( $image ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2007-06-17DSC_4173-150x100.jpg', wp_basename( $image ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> list($w, $h, $type) = getimagesize( $image );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 150, $w );
- $this->assertEquals( 100, $h );
- $this->assertEquals( IMAGETYPE_JPEG, $type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 150, $w );
+ $this->assertSame( 100, $h );
+ $this->assertSame( IMAGETYPE_JPEG, $type );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $image );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -141,11 +141,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_resize_thumb_50x150_crop() {
</span><span class="cx" style="display: block; padding: 0 10px"> $image = $this->resize_helper( DIR_TESTDATA . '/images/2007-06-17DSC_4173.JPG', 50, 150, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-50x150.jpg', wp_basename( $image ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2007-06-17DSC_4173-50x150.jpg', wp_basename( $image ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> list($w, $h, $type) = getimagesize( $image );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 50, $w );
- $this->assertEquals( 150, $h );
- $this->assertEquals( IMAGETYPE_JPEG, $type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 50, $w );
+ $this->assertSame( 150, $h );
+ $this->assertSame( IMAGETYPE_JPEG, $type );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unlink( $image );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -159,7 +159,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $image = $this->resize_helper( DIR_TESTDATA . '/images/test-non-existent-image.jpg', 25, 25 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $image );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'error_loading_image', $image->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'error_loading_image', $image->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsimageresizeGdphp"></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/image/resizeGd.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/resizeGd.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/image/resizeGd.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $image = $this->resize_helper( DIR_TESTDATA . '/export/crazy-cdata.xml', 25, 25 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $image );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_image', $image->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_image', $image->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsimagesiteIconphp"></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/image/siteIcon.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/siteIcon.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/image/siteIcon.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $sizes[] = 'site_icon-' . $size;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $sizes, $image_sizes );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $sizes, $image_sizes );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_intermediate_image_sizes_with_filter() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,7 +52,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'site_icon-321', $image_sizes );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // All icon sizes should be part of the array, including sizes added through the filter.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $sizes, $image_sizes );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $sizes, $image_sizes );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Remove custom size.
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $this->wp_site_icon->site_icon_sizes[ array_search( 321, $this->wp_site_icon->site_icon_sizes, true ) ] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,7 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $sizes, $image_sizes );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $sizes, $image_sizes );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_additional_sizes_with_filter() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,7 +92,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'site_icon-321', $image_sizes );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // All icon sizes should be part of the array, including sizes added through the filter.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $sizes, $image_sizes );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $sizes, $image_sizes );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Remove custom size.
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $this->wp_site_icon->site_icon_sizes[ array_search( 321, $this->wp_site_icon->site_icon_sizes, true ) ] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -105,11 +105,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $object = $this->wp_site_icon->create_attachment_object( $cropped, $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $object['post_title'], 'cropped-test-image.jpg' );
- $this->assertEquals( $object['context'], 'site-icon' );
- $this->assertEquals( $object['post_mime_type'], 'image/jpeg' );
- $this->assertEquals( $object['post_content'], $cropped );
- $this->assertEquals( $object['guid'], $cropped );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $object['post_title'], 'cropped-test-image.jpg' );
+ $this->assertSame( $object['context'], 'site-icon' );
+ $this->assertSame( $object['post_mime_type'], 'image/jpeg' );
+ $this->assertSame( $object['post_content'], $cropped );
+ $this->assertSame( $object['guid'], $cropped );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_insert_cropped_attachment() {
</span></span></pre></div>
<a id="trunktestsphpunittestsimportimportphp"></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/import/import.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/import/import.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/import/import.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,27 +51,27 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure that authors were imported correctly.
</span><span class="cx" style="display: block; padding: 0 10px"> $user_count = count_users();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, $user_count['total_users'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, $user_count['total_users'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $admin = get_user_by( 'login', 'admin' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'admin', $admin->user_login );
- $this->assertEquals( 'local@host.null', $admin->user_email );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'admin', $admin->user_login );
+ $this->assertSame( 'local@host.null', $admin->user_email );
</ins><span class="cx" style="display: block; padding: 0 10px"> $editor = get_user_by( 'login', 'editor' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'editor', $editor->user_login );
- $this->assertEquals( 'editor@example.org', $editor->user_email );
- $this->assertEquals( 'FirstName', $editor->user_firstname );
- $this->assertEquals( 'LastName', $editor->user_lastname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'editor', $editor->user_login );
+ $this->assertSame( 'editor@example.org', $editor->user_email );
+ $this->assertSame( 'FirstName', $editor->user_firstname );
+ $this->assertSame( 'LastName', $editor->user_lastname );
</ins><span class="cx" style="display: block; padding: 0 10px"> $author = get_user_by( 'login', 'author' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'author', $author->user_login );
- $this->assertEquals( 'author@example.org', $author->user_email );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'author', $author->user_login );
+ $this->assertSame( 'author@example.org', $author->user_email );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that terms were imported correctly.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 30, wp_count_terms( array( 'taxonomy' => 'category' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 3, wp_count_terms( array( 'taxonomy' => 'post_tag' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $foo = get_term_by( 'slug', 'foo', 'category' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $foo->parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $foo->parent );
</ins><span class="cx" style="display: block; padding: 0 10px"> $bar = get_term_by( 'slug', 'bar', 'category' );
</span><span class="cx" style="display: block; padding: 0 10px"> $foo_bar = get_term_by( 'slug', 'foo-bar', 'category' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $bar->term_id, $foo_bar->parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $bar->term_id, $foo_bar->parent );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that posts/pages were imported correctly.
</span><span class="cx" style="display: block; padding: 0 10px"> $post_count = wp_count_posts( 'post' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -91,120 +91,120 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'orderby' => 'ID',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 11, count( $posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 11, count( $posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = $posts[0];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Many Categories', $post->post_title );
- $this->assertEquals( 'many-categories', $post->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Many Categories', $post->post_title );
+ $this->assertSame( 'many-categories', $post->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $admin->ID, $post->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'post', $post->post_type );
- $this->assertEquals( 'publish', $post->post_status );
- $this->assertEquals( 0, $post->post_parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'post', $post->post_type );
+ $this->assertSame( 'publish', $post->post_status );
+ $this->assertSame( 0, $post->post_parent );
</ins><span class="cx" style="display: block; padding: 0 10px"> $cats = wp_get_post_categories( $post->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 27, count( $cats ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 27, count( $cats ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = $posts[1];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Non-standard post format', $post->post_title );
- $this->assertEquals( 'non-standard-post-format', $post->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Non-standard post format', $post->post_title );
+ $this->assertSame( 'non-standard-post-format', $post->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $admin->ID, $post->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'post', $post->post_type );
- $this->assertEquals( 'publish', $post->post_status );
- $this->assertEquals( 0, $post->post_parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'post', $post->post_type );
+ $this->assertSame( 'publish', $post->post_status );
+ $this->assertSame( 0, $post->post_parent );
</ins><span class="cx" style="display: block; padding: 0 10px"> $cats = wp_get_post_categories( $post->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $cats ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $cats ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( has_post_format( 'aside', $post->ID ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = $posts[2];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Top-level Foo', $post->post_title );
- $this->assertEquals( 'top-level-foo', $post->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Top-level Foo', $post->post_title );
+ $this->assertSame( 'top-level-foo', $post->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $admin->ID, $post->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'post', $post->post_type );
- $this->assertEquals( 'publish', $post->post_status );
- $this->assertEquals( 0, $post->post_parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'post', $post->post_type );
+ $this->assertSame( 'publish', $post->post_status );
+ $this->assertSame( 0, $post->post_parent );
</ins><span class="cx" style="display: block; padding: 0 10px"> $cats = wp_get_post_categories( $post->ID, array( 'fields' => 'all' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $cats ) );
- $this->assertEquals( 'foo', $cats[0]->slug );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $cats ) );
+ $this->assertSame( 'foo', $cats[0]->slug );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = $posts[3];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Foo-child', $post->post_title );
- $this->assertEquals( 'foo-child', $post->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Foo-child', $post->post_title );
+ $this->assertSame( 'foo-child', $post->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $editor->ID, $post->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'post', $post->post_type );
- $this->assertEquals( 'publish', $post->post_status );
- $this->assertEquals( 0, $post->post_parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'post', $post->post_type );
+ $this->assertSame( 'publish', $post->post_status );
+ $this->assertSame( 0, $post->post_parent );
</ins><span class="cx" style="display: block; padding: 0 10px"> $cats = wp_get_post_categories( $post->ID, array( 'fields' => 'all' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $cats ) );
- $this->assertEquals( 'foo-bar', $cats[0]->slug );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $cats ) );
+ $this->assertSame( 'foo-bar', $cats[0]->slug );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = $posts[4];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Private Post', $post->post_title );
- $this->assertEquals( 'private-post', $post->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Private Post', $post->post_title );
+ $this->assertSame( 'private-post', $post->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $admin->ID, $post->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'post', $post->post_type );
- $this->assertEquals( 'private', $post->post_status );
- $this->assertEquals( 0, $post->post_parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'post', $post->post_type );
+ $this->assertSame( 'private', $post->post_status );
+ $this->assertSame( 0, $post->post_parent );
</ins><span class="cx" style="display: block; padding: 0 10px"> $cats = wp_get_post_categories( $post->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $cats ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $cats ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $tags = wp_get_post_tags( $post->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $tags ) );
- $this->assertEquals( 'tag1', $tags[0]->slug );
- $this->assertEquals( 'tag2', $tags[1]->slug );
- $this->assertEquals( 'tag3', $tags[2]->slug );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $tags ) );
+ $this->assertSame( 'tag1', $tags[0]->slug );
+ $this->assertSame( 'tag2', $tags[1]->slug );
+ $this->assertSame( 'tag3', $tags[2]->slug );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = $posts[5];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1-col page', $post->post_title );
- $this->assertEquals( '1-col-page', $post->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1-col page', $post->post_title );
+ $this->assertSame( '1-col-page', $post->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $admin->ID, $post->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'page', $post->post_type );
- $this->assertEquals( 'publish', $post->post_status );
- $this->assertEquals( 0, $post->post_parent );
- $this->assertEquals( 'onecolumn-page.php', get_post_meta( $post->ID, '_wp_page_template', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'page', $post->post_type );
+ $this->assertSame( 'publish', $post->post_status );
+ $this->assertSame( 0, $post->post_parent );
+ $this->assertSame( 'onecolumn-page.php', get_post_meta( $post->ID, '_wp_page_template', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = $posts[6];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Draft Page', $post->post_title );
- $this->assertEquals( '', $post->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Draft Page', $post->post_title );
+ $this->assertSame( '', $post->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $admin->ID, $post->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'page', $post->post_type );
- $this->assertEquals( 'draft', $post->post_status );
- $this->assertEquals( 0, $post->post_parent );
- $this->assertEquals( 'default', get_post_meta( $post->ID, '_wp_page_template', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'page', $post->post_type );
+ $this->assertSame( 'draft', $post->post_status );
+ $this->assertSame( 0, $post->post_parent );
+ $this->assertSame( 'default', get_post_meta( $post->ID, '_wp_page_template', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = $posts[7];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Parent Page', $post->post_title );
- $this->assertEquals( 'parent-page', $post->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Parent Page', $post->post_title );
+ $this->assertSame( 'parent-page', $post->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $admin->ID, $post->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'page', $post->post_type );
- $this->assertEquals( 'publish', $post->post_status );
- $this->assertEquals( 0, $post->post_parent );
- $this->assertEquals( 'default', get_post_meta( $post->ID, '_wp_page_template', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'page', $post->post_type );
+ $this->assertSame( 'publish', $post->post_status );
+ $this->assertSame( 0, $post->post_parent );
+ $this->assertSame( 'default', get_post_meta( $post->ID, '_wp_page_template', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = $posts[8];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Child Page', $post->post_title );
- $this->assertEquals( 'child-page', $post->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Child Page', $post->post_title );
+ $this->assertSame( 'child-page', $post->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $admin->ID, $post->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'page', $post->post_type );
- $this->assertEquals( 'publish', $post->post_status );
- $this->assertEquals( $posts[7]->ID, $post->post_parent );
- $this->assertEquals( 'default', get_post_meta( $post->ID, '_wp_page_template', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'page', $post->post_type );
+ $this->assertSame( 'publish', $post->post_status );
+ $this->assertSame( $posts[7]->ID, $post->post_parent );
+ $this->assertSame( 'default', get_post_meta( $post->ID, '_wp_page_template', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = $posts[9];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Sample Page', $post->post_title );
- $this->assertEquals( 'sample-page', $post->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Sample Page', $post->post_title );
+ $this->assertSame( 'sample-page', $post->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $admin->ID, $post->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'page', $post->post_type );
- $this->assertEquals( 'publish', $post->post_status );
- $this->assertEquals( 0, $post->post_parent );
- $this->assertEquals( 'default', get_post_meta( $post->ID, '_wp_page_template', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'page', $post->post_type );
+ $this->assertSame( 'publish', $post->post_status );
+ $this->assertSame( 0, $post->post_parent );
+ $this->assertSame( 'default', get_post_meta( $post->ID, '_wp_page_template', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = $posts[10];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Hello world!', $post->post_title );
- $this->assertEquals( 'hello-world', $post->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Hello world!', $post->post_title );
+ $this->assertSame( 'hello-world', $post->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $author->ID, $post->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'post', $post->post_type );
- $this->assertEquals( 'publish', $post->post_status );
- $this->assertEquals( 0, $post->post_parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'post', $post->post_type );
+ $this->assertSame( 'publish', $post->post_status );
+ $this->assertSame( 0, $post->post_parent );
</ins><span class="cx" style="display: block; padding: 0 10px"> $cats = wp_get_post_categories( $post->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $cats ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $cats ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_double_import() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -217,26 +217,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_import_wp( DIR_TESTDATA . '/export/small-export.xml', $authors );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user_count = count_users();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, $user_count['total_users'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, $user_count['total_users'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $admin = get_user_by( 'login', 'admin' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'admin', $admin->user_login );
- $this->assertEquals( 'local@host.null', $admin->user_email );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'admin', $admin->user_login );
+ $this->assertSame( 'local@host.null', $admin->user_email );
</ins><span class="cx" style="display: block; padding: 0 10px"> $editor = get_user_by( 'login', 'editor' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'editor', $editor->user_login );
- $this->assertEquals( 'editor@example.org', $editor->user_email );
- $this->assertEquals( 'FirstName', $editor->user_firstname );
- $this->assertEquals( 'LastName', $editor->user_lastname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'editor', $editor->user_login );
+ $this->assertSame( 'editor@example.org', $editor->user_email );
+ $this->assertSame( 'FirstName', $editor->user_firstname );
+ $this->assertSame( 'LastName', $editor->user_lastname );
</ins><span class="cx" style="display: block; padding: 0 10px"> $author = get_user_by( 'login', 'author' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'author', $author->user_login );
- $this->assertEquals( 'author@example.org', $author->user_email );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'author', $author->user_login );
+ $this->assertSame( 'author@example.org', $author->user_email );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 30, wp_count_terms( array( 'taxonomy' => 'category' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 3, wp_count_terms( array( 'taxonomy' => 'post_tag' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $foo = get_term_by( 'slug', 'foo', 'category' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $foo->parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $foo->parent );
</ins><span class="cx" style="display: block; padding: 0 10px"> $bar = get_term_by( 'slug', 'bar', 'category' );
</span><span class="cx" style="display: block; padding: 0 10px"> $foo_bar = get_term_by( 'slug', 'foo-bar', 'category' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $bar->term_id, $foo_bar->parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $bar->term_id, $foo_bar->parent );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_count = wp_count_posts( 'post' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 5, $post_count->publish );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -258,7 +258,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'ABC1' => array( 'ABC1' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'def1' => array( 'def1' ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'ABC1' => array( 'ABC1' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'abc2' => array( 'abc2' ),
</span></span></pre></div>
<a id="trunktestsphpunittestsimportparserphp"></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/import/parser.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/import/parser.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/import/parser.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,7 +32,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $parser = new $p;
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $parser->parse( $file );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'There was an error when reading this WXR file', $result->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'There was an error when reading this WXR file', $result->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,7 +45,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $parser = new $p;
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $parser->parse( $file );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'This does not appear to be a WXR file, missing/invalid WXR version number', $result->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'This does not appear to be a WXR file, missing/invalid WXR version number', $result->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,7 +59,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $parser->parse( $file );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_array( $result ), $message );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://localhost/', $result['base_url'], $message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://localhost/', $result['base_url'], $message );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'author_id' => 2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -106,9 +106,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $message
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $result['posts'] ), $message );
- $this->assertEquals( 19, count( $result['posts'][0] ), $message );
- $this->assertEquals( 18, count( $result['posts'][1] ), $message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $result['posts'] ), $message );
+ $this->assertSame( 19, count( $result['posts'][0] ), $message );
+ $this->assertSame( 18, count( $result['posts'][1] ), $message );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,7 +130,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result['posts'][0]['terms'],
</span><span class="cx" style="display: block; padding: 0 10px"> $message
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => '_wp_page_template',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -152,17 +152,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $parser->parse( $file );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_array( $result ), $message );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://localhost/', $result['base_url'], $message );
- $this->assertEquals( $result['categories'][0]['category_nicename'], 'alpha', $message );
- $this->assertEquals( $result['categories'][0]['cat_name'], 'alpha', $message );
- $this->assertEquals( $result['categories'][0]['category_parent'], '', $message );
- $this->assertEquals( $result['categories'][0]['category_description'], 'The alpha category', $message );
- $this->assertEquals( $result['tags'][0]['tag_slug'], 'chicken', $message );
- $this->assertEquals( $result['tags'][0]['tag_name'], 'chicken', $message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://localhost/', $result['base_url'], $message );
+ $this->assertSame( $result['categories'][0]['category_nicename'], 'alpha', $message );
+ $this->assertSame( $result['categories'][0]['cat_name'], 'alpha', $message );
+ $this->assertSame( $result['categories'][0]['category_parent'], '', $message );
+ $this->assertSame( $result['categories'][0]['category_description'], 'The alpha category', $message );
+ $this->assertSame( $result['tags'][0]['tag_slug'], 'chicken', $message );
+ $this->assertSame( $result['tags'][0]['tag_name'], 'chicken', $message );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 6, count( $result['posts'] ), $message );
- $this->assertEquals( 19, count( $result['posts'][0] ), $message );
- $this->assertEquals( 18, count( $result['posts'][1] ), $message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 6, count( $result['posts'] ), $message );
+ $this->assertSame( 19, count( $result['posts'][0] ), $message );
+ $this->assertSame( 18, count( $result['posts'][1] ), $message );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -218,7 +218,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $message
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => '_wp_page_template',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -246,7 +246,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $parser->parse( $file );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = $result['posts'][0];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Content with nested <![CDATA[ tags ]]> :)', $post['post_content'], $message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Content with nested <![CDATA[ tags ]]> :)', $post['post_content'], $message );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $post['postmeta'] as $meta ) {
</span><span class="cx" style="display: block; padding: 0 10px"> switch ( $meta['key'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> case 'Plain string':
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -261,7 +261,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> default:
</span><span class="cx" style="display: block; padding: 0 10px"> $this->fail( 'Unknown postmeta (' . $meta['key'] . ') was parsed out by' . $p );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, $meta['value'], $message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, $meta['value'], $message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -277,7 +277,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $parser->parse( $file );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = $result['posts'][0];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Content with nested <![CDATA[ tags ]]> :)', $post['post_content'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Content with nested <![CDATA[ tags ]]> :)', $post['post_content'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $post['postmeta'] as $meta ) {
</span><span class="cx" style="display: block; padding: 0 10px"> switch ( $meta['key'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> case 'Plain string':
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -292,7 +292,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> default:
</span><span class="cx" style="display: block; padding: 0 10px"> $this->fail( 'Unknown postmeta (' . $meta['key'] . ') was parsed out by' . $p );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, $meta['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, $meta['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsimportpostmetaphp"></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/import/postmeta.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/import/postmeta.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/import/postmeta.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,7 +28,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-no-cdata.xml', array( 'johncoswell' => 'john' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected['special_post_title'] = 'A special title';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected['is_calendar'] = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_post_meta( 122, 'post-options', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_post_meta( 122, 'post-options', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_utw_postmeta() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -84,11 +84,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-with-cdata.xml', array( 'johncoswell' => 'johncoswell' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // HTML in the CDATA should work with old WordPress version.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<pre>some html</pre>', get_post_meta( 10, 'contains-html', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<pre>some html</pre>', get_post_meta( 10, 'contains-html', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Serialised will only work with 3.0 onwards.
</span><span class="cx" style="display: block; padding: 0 10px"> $expected['special_post_title'] = 'A special title';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected['is_calendar'] = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_post_meta( 10, 'post-options', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_post_meta( 10, 'post-options', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -97,6 +97,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_serialized_postmeta_with_evil_stuff_in_cdata() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-with-cdata.xml', array( 'johncoswell' => 'johncoswell' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> // Evil content in the CDATA.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<wp:meta_value>evil</wp:meta_value>', get_post_meta( 10, 'evil', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<wp:meta_value>evil</wp:meta_value>', get_post_meta( 10, 'evil', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsincludesfactoryphp"></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/includes/factory.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/includes/factory.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/includes/factory.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -19,7 +19,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_object_by_id_gets_an_object_with_the_same_name() {
</span><span class="cx" style="display: block; padding: 0 10px"> $id = $this->category_factory->create( array( 'name' => 'Boo' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $object = $this->category_factory->get_object_by_id( $id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Boo', $object->name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Boo', $object->name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_the_taxonomy_argument_overrules_the_factory_taxonomy() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,7 +26,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $term_factory = new WP_UnitTest_Factory_For_term( null, 'category' );
</span><span class="cx" style="display: block; padding: 0 10px"> $id = $term_factory->create( array( 'taxonomy' => 'post_tag' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term( $id, 'post_tag' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, $term->term_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, $term->term_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsksesphp"></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/kses.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/kses.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/kses.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,7 +29,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $values as $value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $string = "<address $name='$value'>1 WordPress Avenue, The Internet.</address>";
</span><span class="cx" style="display: block; padding: 0 10px"> $expect_string = "<address $name='" . str_replace( '; ', ';', trim( $value, ';' ) ) . "'>1 WordPress Avenue, The Internet.</address>";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expect_string, wp_kses( $string, $allowedposttags ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expect_string, wp_kses( $string, $allowedposttags ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,7 +63,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $string = "<a $attr>I link this</a>";
</span><span class="cx" style="display: block; padding: 0 10px"> $expect_string = "<a $expected_attr>I link this</a>";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expect_string, wp_kses( $string, $allowedposttags ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expect_string, wp_kses( $string, $allowedposttags ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,7 +137,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $attributes as $name => $value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $string = "<abbr $name='$value'>WP</abbr>";
</span><span class="cx" style="display: block; padding: 0 10px"> $expect_string = "<abbr $name='" . trim( $value, ';' ) . "'>WP</abbr>";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expect_string, wp_kses( $string, $allowedposttags ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expect_string, wp_kses( $string, $allowedposttags ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -172,7 +172,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <a href="">CLICK ME</a>
</span><span class="cx" style="display: block; padding: 0 10px"> EOF;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_kses( $content, $allowedposttags ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_kses( $content, $allowedposttags ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_kses_bad_protocol() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -211,25 +211,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $result ) && 'alert(1);' !== $result && 'alert(1)' !== $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> switch ( $k ) {
</span><span class="cx" style="display: block; padding: 0 10px"> case 6:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'javascript&#0000058alert(1);', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'javascript&#0000058alert(1);', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 12:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( str_replace( '&', '&', $x ), $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( str_replace( '&', '&', $x ), $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 22:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'javascript&#0000058alert(1);', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'javascript&#0000058alert(1);', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 23:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'javascript&#0000058alert(1)//?:', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'javascript&#0000058alert(1)//?:', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 24:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'feed:alert(1)', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'feed:alert(1)', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 26:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'javascript&#58alert(1)', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'javascript&#58alert(1)', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 27:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'javascript&#x3ax=1;alert(1)', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'javascript&#x3ax=1;alert(1)', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> default:
</span><span class="cx" style="display: block; padding: 0 10px"> $this->fail( "wp_kses_bad_protocol failed on $k, $x. Result: $result" );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -304,106 +304,106 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> switch ( $attack->name ) {
</span><span class="cx" style="display: block; padding: 0 10px"> case 'XSS Locator':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '\';alert(String.fromCharCode(88,83,83))//\\\';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//\\";alert(String.fromCharCode(88,83,83))//-->">\'>alert(String.fromCharCode(88,83,83))=&{}', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '\';alert(String.fromCharCode(88,83,83))//\\\';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//\\";alert(String.fromCharCode(88,83,83))//-->">\'>alert(String.fromCharCode(88,83,83))=&{}', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'XSS Quick Test':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '\'\';!--"=&{()}', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '\'\';!--"=&{()}', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'SCRIPT w/Alert()':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "alert('XSS')", $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "alert('XSS')", $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'SCRIPT w/Char Code':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'alert(String.fromCharCode(88,83,83))', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'alert(String.fromCharCode(88,83,83))', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'IMG STYLE w/expression':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'exp/*', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'exp/*', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'List-style-image':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'li {list-style-image: url("javascript:alert(\'XSS\')");}XSS', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'li {list-style-image: url("javascript:alert(\'XSS\')");}XSS', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'STYLE':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "alert('XSS');", $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "alert('XSS');", $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'STYLE w/background-image':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '.XSS{background-image:url("javascript:alert(\'XSS\')");}<A></A>', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '.XSS{background-image:url("javascript:alert(\'XSS\')");}<A></A>', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'STYLE w/background':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'BODY{background:url("javascript:alert(\'XSS\')")}', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'BODY{background:url("javascript:alert(\'XSS\')")}', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'Remote Stylesheet 2':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "@import'http://ha.ckers.org/xss.css';", $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "@import'http://ha.ckers.org/xss.css';", $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'Remote Stylesheet 3':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<META HTTP-EQUIV="Link" Content="; REL=stylesheet">', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<META HTTP-EQUIV="Link" Content="; REL=stylesheet">', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'Remote Stylesheet 4':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'BODY{-moz-binding:url("http://ha.ckers.org/xssmoz.xml#xss")}', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'BODY{-moz-binding:url("http://ha.ckers.org/xssmoz.xml#xss")}', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'XML data island w/CDATA':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<![CDATA[]]>', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<![CDATA[]]>', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'XML data island w/comment':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "<I><B><IMG SRC="javas<!-- -->cript:alert('XSS')\"></B></I>", $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "<I><B><IMG SRC="javas<!-- -->cript:alert('XSS')\"></B></I>", $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'XML HTML+TIME':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<t:set attributeName="innerHTML" to="XSSalert(\'XSS\')">', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<t:set attributeName="innerHTML" to="XSSalert(\'XSS\')">', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'Commented-out Block':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "<!--[if gte IE 4]>-->\nalert('XSS');", $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "<!--[if gte IE 4]>-->\nalert('XSS');", $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'Cookie Manipulation':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<META HTTP-EQUIV="Set-Cookie" Content="USERID=alert(\'XSS\')">', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<META HTTP-EQUIV="Set-Cookie" Content="USERID=alert(\'XSS\')">', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'SSI':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<!--#exec cmd="/bin/echo '<!--#exec cmd="/bin/echo \'=http://ha.ckers.org/xss.js>\'"-->', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<!--#exec cmd="/bin/echo '<!--#exec cmd="/bin/echo \'=http://ha.ckers.org/xss.js>\'"-->', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'PHP':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<? echo('alert("XSS")\'); ?>', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<? echo('alert("XSS")\'); ?>', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'UTF-7 Encoding':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '+ADw-SCRIPT+AD4-alert(\'XSS\');+ADw-/SCRIPT+AD4-', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '+ADw-SCRIPT+AD4-alert(\'XSS\');+ADw-/SCRIPT+AD4-', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'Escaping JavaScript escapes':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '\";alert(\'XSS\');//', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '\";alert(\'XSS\');//', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'STYLE w/broken up JavaScript':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '@im\port\'\ja\vasc\ript:alert("XSS")\';', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '@im\port\'\ja\vasc\ript:alert("XSS")\';', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'Null Chars 2':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '&alert("XSS")', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '&alert("XSS")', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'No Closing Script Tag':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<SCRIPT SRC=http://ha.ckers.org/xss.js', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<SCRIPT SRC=http://ha.ckers.org/xss.js', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'Half-Open HTML/JavaScript':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<IMG SRC="javascript:alert('XSS')"', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<IMG SRC="javascript:alert('XSS')"', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'Double open angle brackets':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<IFRAME SRC=http://ha.ckers.org/scriptlet.html <', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<IFRAME SRC=http://ha.ckers.org/scriptlet.html <', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'Extraneous Open Brackets':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<alert("XSS");//<', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<alert("XSS");//<', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'Malformed IMG Tags':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'alert("XSS")">', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'alert("XSS")">', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'No Quotes/Semicolons':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "a=/XSS/\nalert(a.source)", $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "a=/XSS/\nalert(a.source)", $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'Evade Regex Filter 1':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '" SRC="http://ha.ckers.org/xss.js">', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '" SRC="http://ha.ckers.org/xss.js">', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'Evade Regex Filter 4':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '\'" SRC="http://ha.ckers.org/xss.js">', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '\'" SRC="http://ha.ckers.org/xss.js">', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'Evade Regex Filter 5':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '` SRC="http://ha.ckers.org/xss.js">', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '` SRC="http://ha.ckers.org/xss.js">', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'Filter Evasion 1':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'document.write("<SCRI");PT SRC="http://ha.ckers.org/xss.js">', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'document.write("<SCRI");PT SRC="http://ha.ckers.org/xss.js">', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'Filter Evasion 2':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '\'>" SRC="http://ha.ckers.org/xss.js">', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '\'>" SRC="http://ha.ckers.org/xss.js">', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> default:
</span><span class="cx" style="display: block; padding: 0 10px"> $this->fail( 'KSES failed on ' . $attack->name . ': ' . $result );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -425,7 +425,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_kses_allowed_html() {
</span><span class="cx" style="display: block; padding: 0 10px"> global $allowedposttags, $allowedtags, $allowedentitynames;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $allowedposttags, wp_kses_allowed_html( 'post' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $allowedposttags, wp_kses_allowed_html( 'post' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $tags = wp_kses_allowed_html( 'post' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -436,9 +436,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $tag['title'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $allowedtags, wp_kses_allowed_html( 'data' ) );
- $this->assertEquals( $allowedtags, wp_kses_allowed_html( '' ) );
- $this->assertEquals( $allowedtags, wp_kses_allowed_html() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $allowedtags, wp_kses_allowed_html( 'data' ) );
+ $this->assertSame( $allowedtags, wp_kses_allowed_html( '' ) );
+ $this->assertSame( $allowedtags, wp_kses_allowed_html() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $tags = wp_kses_allowed_html( 'user_description' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $tags['a']['rel'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -446,7 +446,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $tags = wp_kses_allowed_html();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( isset( $tags['a']['rel'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), wp_kses_allowed_html( 'strip' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), wp_kses_allowed_html( 'strip' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $custom_tags = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'a' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -458,16 +458,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $custom_tags, wp_kses_allowed_html( $custom_tags ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $custom_tags, wp_kses_allowed_html( $custom_tags ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'wp_kses_allowed_html', array( $this, '_wp_kses_allowed_html_filter' ), 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'a' => array( 'href' => true ) ), wp_kses_allowed_html( 'post' ) );
- $this->assertEquals( array( 'a' => array( 'href' => false ) ), wp_kses_allowed_html( 'data' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'a' => array( 'href' => true ) ), wp_kses_allowed_html( 'post' ) );
+ $this->assertSame( array( 'a' => array( 'href' => false ) ), wp_kses_allowed_html( 'data' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'wp_kses_allowed_html', array( $this, '_wp_kses_allowed_html_filter' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $allowedposttags, wp_kses_allowed_html( 'post' ) );
- $this->assertEquals( $allowedtags, wp_kses_allowed_html( 'data' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $allowedposttags, wp_kses_allowed_html( 'post' ) );
+ $this->assertSame( $allowedtags, wp_kses_allowed_html( 'data' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_hyphenated_tag() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -480,8 +480,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expect_stripped_string = 'Alot of hyphens.';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expect_valid_string = '<hyphenated-tag attribute="value">Alot of hyphens.</hyphenated-tag>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expect_stripped_string, wp_kses_post( $string ) );
- $this->assertEquals( $expect_valid_string, wp_kses( $string, $custom_tags ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expect_stripped_string, wp_kses_post( $string ) );
+ $this->assertSame( $expect_valid_string, wp_kses( $string, $custom_tags ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -488,15 +488,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 26290
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_kses_normalize_entities() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '♠', wp_kses_normalize_entities( '♠' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '♠', wp_kses_normalize_entities( '♠' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '¹', wp_kses_normalize_entities( '¹' ) );
- $this->assertEquals( '²', wp_kses_normalize_entities( '²' ) );
- $this->assertEquals( '³', wp_kses_normalize_entities( '³' ) );
- $this->assertEquals( '¼', wp_kses_normalize_entities( '¼' ) );
- $this->assertEquals( '½', wp_kses_normalize_entities( '½' ) );
- $this->assertEquals( '¾', wp_kses_normalize_entities( '¾' ) );
- $this->assertEquals( '∴', wp_kses_normalize_entities( '∴' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '¹', wp_kses_normalize_entities( '¹' ) );
+ $this->assertSame( '²', wp_kses_normalize_entities( '²' ) );
+ $this->assertSame( '³', wp_kses_normalize_entities( '³' ) );
+ $this->assertSame( '¼', wp_kses_normalize_entities( '¼' ) );
+ $this->assertSame( '½', wp_kses_normalize_entities( '½' ) );
+ $this->assertSame( '¾', wp_kses_normalize_entities( '¾' ) );
+ $this->assertSame( '∴', wp_kses_normalize_entities( '∴' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -508,7 +508,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_ctrl_removal( $input, $output ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $allowedposttags;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wp_kses( $input, $allowedposttags ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wp_kses( $input, $allowedposttags ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_ctrl_removal() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -545,7 +545,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_slash_zero_removal( $input, $output ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $allowedposttags;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wp_kses( $input, $allowedposttags ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wp_kses( $input, $allowedposttags ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_slash_zero_removal() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -595,7 +595,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_hair_parse
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_hair_parse( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wp_kses_hair_parse( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wp_kses_hair_parse( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_hair_parse() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -661,7 +661,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_attr_parse
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_attr_parse( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wp_kses_attr_parse( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wp_kses_attr_parse( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_attr_parse() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -719,7 +719,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_one_attr
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_one_attr( $element, $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, wp_kses_one_attr( $input, $element ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, wp_kses_one_attr( $input, $element ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_one_attr() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -800,7 +800,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $input = '<p>This is <bdo dir="rtl">a BDO tag</bdo>. Weird, <bdo dir="ltr">right?</bdo></p>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $input, wp_kses( $input, $allowedposttags ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $input, wp_kses( $input, $allowedposttags ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -811,7 +811,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $input = '<ol reversed="reversed"><li>Item 1</li><li>Item 2</li><li>Item 3</li></ol>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $input, wp_kses( $input, $allowedposttags ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $input, wp_kses( $input, $allowedposttags ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -821,7 +821,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $element = 'foo';
</span><span class="cx" style="display: block; padding: 0 10px"> $attribute = 'title="foo" class="bar"';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "<{$element}>", wp_kses_attr( $element, $attribute, array( 'foo' => array() ), array() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "<{$element}>", wp_kses_attr( $element, $attribute, array( 'foo' => array() ), array() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -831,7 +831,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $element = 'foo';
</span><span class="cx" style="display: block; padding: 0 10px"> $attribute = 'title="foo" class="bar"';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "<{$element}>", wp_kses_attr( $element, $attribute, array( 'foo' => true ), array() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "<{$element}>", wp_kses_attr( $element, $attribute, array( 'foo' => true ), array() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -841,7 +841,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $element = 'foo';
</span><span class="cx" style="display: block; padding: 0 10px"> $attribute = 'title="foo" class="bar"';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "<{$element} title=\"foo\">", wp_kses_attr( $element, $attribute, array( 'foo' => array( 'title' => true ) ), array() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "<{$element} title=\"foo\">", wp_kses_attr( $element, $attribute, array( 'foo' => array( 'title' => true ) ), array() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -851,7 +851,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $element = 'foo';
</span><span class="cx" style="display: block; padding: 0 10px"> $attribute = 'title="foo" class="bar"';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "<{$element}>", wp_kses_attr( $element, $attribute, array( 'foo' => false ), array() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "<{$element}>", wp_kses_attr( $element, $attribute, array( 'foo' => false ), array() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1057,7 +1057,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $test = '<div data-foo="foo" data-bar="bar" datainvalid="gone" data--invaild="gone" data-also-invaild-="gone" data-two-hyphens="remains">Pens and pencils</div>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<div data-foo="foo" data-bar="bar" data-two-hyphens="remains">Pens and pencils</div>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_kses_post( $test ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_kses_post( $test ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsl10nloadScriptTextdomainphp"></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/l10n/loadScriptTextdomain.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/l10n/loadScriptTextdomain.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/l10n/loadScriptTextdomain.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,18 +32,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $json_translations = file_get_contents( DIR_TESTDATA . '/languages/en_US-813e104eb47e13dd4cc5af844c618754.json' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'test-example-root', '/wp-includes/js/script.js', array(), null );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $json_translations, load_script_textdomain( 'test-example-root', 'default', DIR_TESTDATA . '/languages' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $json_translations, load_script_textdomain( 'test-example-root', 'default', DIR_TESTDATA . '/languages' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Assets on a CDN.
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'load_script_textdomain_relative_path', array( $this, 'relative_path_from_cdn' ), 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'test-example-cdn', 'https://my-cdn.com/wordpress/wp-includes/js/script.js', array(), null );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $json_translations, load_script_textdomain( 'test-example-cdn', 'default', DIR_TESTDATA . '/languages' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $json_translations, load_script_textdomain( 'test-example-cdn', 'default', DIR_TESTDATA . '/languages' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'load_script_textdomain_relative_path', array( $this, 'relative_path_from_cdn' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test for WordPress installs in a subdirectory.
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'site_url', array( $this, 'site_url_subdirectory' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'test-example-subdir', '/wp/wp-includes/js/script.js', array(), null );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $json_translations, load_script_textdomain( 'test-example-subdir', 'default', DIR_TESTDATA . '/languages' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $json_translations, load_script_textdomain( 'test-example-subdir', 'default', DIR_TESTDATA . '/languages' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'site_url', array( $this, 'site_url_subdirectory' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,7 +55,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'plugins_url', array( $this, 'plugins_url_custom_domain' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'plugin-example-1', 'https://plugins.example.com/my-plugin/js/script.js', array(), null );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $json_translations, load_script_textdomain( 'plugin-example-1', 'internationalized-plugin', DIR_TESTDATA . '/languages' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $json_translations, load_script_textdomain( 'plugin-example-1', 'internationalized-plugin', DIR_TESTDATA . '/languages' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'plugins_url', array( $this, 'plugins_url_custom_domain' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,7 +67,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'content_url', array( $this, 'content_url_custom_domain_with_no_path' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'plugin-example-2', 'https://content.example.com/plugins/my-plugin/js/script.js', array(), null );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $json_translations, load_script_textdomain( 'plugin-example-2', 'internationalized-plugin', DIR_TESTDATA . '/languages' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $json_translations, load_script_textdomain( 'plugin-example-2', 'internationalized-plugin', DIR_TESTDATA . '/languages' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'content_url', array( $this, 'content_url_custom_domain_with_no_path' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsl10nphp"></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/l10n.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/l10n.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/l10n.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,9 +23,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $nooped_plural = _n_noop( '%s post', '%s posts', $text_domain );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $nooped_plural['domain'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '%s posts', translate_nooped_plural( $nooped_plural, 0, $text_domain ) );
- $this->assertEquals( '%s post', translate_nooped_plural( $nooped_plural, 1, $text_domain ) );
- $this->assertEquals( '%s posts', translate_nooped_plural( $nooped_plural, 2, $text_domain ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '%s posts', translate_nooped_plural( $nooped_plural, 0, $text_domain ) );
+ $this->assertSame( '%s post', translate_nooped_plural( $nooped_plural, 1, $text_domain ) );
+ $this->assertSame( '%s posts', translate_nooped_plural( $nooped_plural, 2, $text_domain ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,9 +37,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $nooped_plural['domain'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $nooped_plural['context'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '%s posts', translate_nooped_plural( $nooped_plural, 0, $text_domain ) );
- $this->assertEquals( '%s post', translate_nooped_plural( $nooped_plural, 1, $text_domain ) );
- $this->assertEquals( '%s posts', translate_nooped_plural( $nooped_plural, 2, $text_domain ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '%s posts', translate_nooped_plural( $nooped_plural, 0, $text_domain ) );
+ $this->assertSame( '%s post', translate_nooped_plural( $nooped_plural, 1, $text_domain ) );
+ $this->assertSame( '%s posts', translate_nooped_plural( $nooped_plural, 2, $text_domain ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,9 +46,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 35073
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_before_last_bar() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'no-bar-at-all', before_last_bar( 'no-bar-at-all' ) );
- $this->assertEquals( 'before-last-bar', before_last_bar( 'before-last-bar|after-bar' ) );
- $this->assertEquals( 'first-before-bar|second-before-bar', before_last_bar( 'first-before-bar|second-before-bar|after-last-bar' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'no-bar-at-all', before_last_bar( 'no-bar-at-all' ) );
+ $this->assertSame( 'before-last-bar', before_last_bar( 'before-last-bar|after-bar' ) );
+ $this->assertSame( 'first-before-bar|second-before-bar', before_last_bar( 'first-before-bar|second-before-bar|after-last-bar' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,7 +62,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $array );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $array = get_available_languages( DIR_TESTDATA . '/languages/' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'de_DE', 'en_GB', 'es_ES', 'ja_JP' ), $array );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'de_DE', 'en_GB', 'es_ES', 'ja_JP' ), $array );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,15 +76,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $installed_translations['default']['en_GB'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $data_en_gb = $installed_translations['default']['en_GB'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2016-10-26 00:01+0200', $data_en_gb['PO-Revision-Date'] );
- $this->assertEquals( 'Development (4.4.x)', $data_en_gb['Project-Id-Version'] );
- $this->assertEquals( 'Poedit 1.8.10', $data_en_gb['X-Generator'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2016-10-26 00:01+0200', $data_en_gb['PO-Revision-Date'] );
+ $this->assertSame( 'Development (4.4.x)', $data_en_gb['Project-Id-Version'] );
+ $this->assertSame( 'Poedit 1.8.10', $data_en_gb['X-Generator'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $installed_translations['admin']['es_ES'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $data_es_es = $installed_translations['admin']['es_ES'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2016-10-25 18:29+0200', $data_es_es['PO-Revision-Date'] );
- $this->assertEquals( 'Administration', $data_es_es['Project-Id-Version'] );
- $this->assertEquals( 'Poedit 1.8.10', $data_es_es['X-Generator'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2016-10-25 18:29+0200', $data_es_es['PO-Revision-Date'] );
+ $this->assertSame( 'Administration', $data_es_es['Project-Id-Version'] );
+ $this->assertSame( 'Poedit 1.8.10', $data_es_es['X-Generator'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestslinkgetAdjacentPostphp"></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/link/getAdjacentPost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/link/getAdjacentPost.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/link/getAdjacentPost.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -58,13 +58,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Test category adjacency.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( get_permalink( $post_one->ID ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_adjacent_post( true, '', true, 'category' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_adjacent_post( true, '', true, 'category' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $post_three, get_adjacent_post( true, '', false, 'category' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test tag adjacency.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( get_permalink( $post_two->ID ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_adjacent_post( true, '', true, 'post_tag' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_adjacent_post( true, '', true, 'post_tag' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $post_four, get_adjacent_post( true, '', false, 'post_tag' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test normal boundary post.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -204,7 +204,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Should skip $p2, which belongs to $t.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $p3, $found->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $p3, $found->ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -241,7 +241,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Should skip $p2, which belongs to $t.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $p3, $found->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $p3, $found->ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestslinkgetDashboardUrlphp"></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/link/getDashboardUrl.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/link/getDashboardUrl.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/link/getDashboardUrl.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,7 +22,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 39065
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_dashboard_url_for_current_site_user() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( admin_url(), get_dashboard_url( self::$user_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( admin_url(), get_dashboard_url( self::$user_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = is_multisite() ? user_admin_url() : admin_url();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_dashboard_url( self::$user_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_dashboard_url( self::$user_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -50,7 +50,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> revoke_super_admin( self::$user_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,6 +70,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_site( $site_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestslinkgetPostCommentsFeedLinkphp"></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/link/getPostCommentsFeedLink.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/link/getPostCommentsFeedLink.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/link/getPostCommentsFeedLink.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,7 +16,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> home_url( '/' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_post_pretty_link() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $link = get_post_comments_feed_link( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = get_permalink( $post_id ) . 'feed/';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_attachment_link() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -50,7 +50,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> home_url( '/' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_attachment_pretty_link() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,7 +76,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $link = get_post_comments_feed_link( $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = get_permalink( $post_id ) . 'burrito/feed/';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_attachment_no_name_pretty_link() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -95,7 +95,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $link = get_post_comments_feed_link( $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = get_permalink( $post_id ) . 'attachment/' . $attachment_id . '/feed/';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_unattached_link() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,7 +117,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> home_url( '/' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_unattached_pretty_link() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -135,6 +135,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $link = get_post_comments_feed_link( $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = add_query_arg( 'attachment_id', $attachment_id, home_url( '/feed/' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestslinkgetPreviewPostLinkphp"></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/link/getPreviewPostLink.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/link/getPreviewPostLink.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/link/getPreviewPostLink.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_preview_post_link() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( add_query_arg( 'preview', 'true', get_permalink( $post ) ), get_preview_post_link( $post ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( add_query_arg( 'preview', 'true', get_permalink( $post ) ), get_preview_post_link( $post ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_preview_post_link_should_add_additional_query_vars() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,7 +23,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> get_permalink( $post )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $expected,
</span><span class="cx" style="display: block; padding: 0 10px"> get_preview_post_link(
</span><span class="cx" style="display: block; padding: 0 10px"> $post,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,7 +40,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = 'https://google.com/?foo=bar&bar=baz&preview=true';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $expected,
</span><span class="cx" style="display: block; padding: 0 10px"> get_preview_post_link(
</span><span class="cx" style="display: block; padding: 0 10px"> $post,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,7 +64,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['post'] = $post;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( add_query_arg( 'preview', 'true', get_permalink( $post ) ), get_preview_post_link() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( add_query_arg( 'preview', 'true', get_permalink( $post ) ), get_preview_post_link() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_preview_post_link_should_return_empty_string_for_non_viewable_post_type() {
</span></span></pre></div>
<a id="trunktestsphpunittestslinkgetPreviousCommentsLinkphp"></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/link/getPreviousCommentsLink.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/link/getPreviousCommentsLink.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/link/getPreviousCommentsLink.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,10 +28,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $cpage = get_query_var( 'cpage' );
</span><span class="cx" style="display: block; padding: 0 10px"> set_query_var( 'cpage', '' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $link = get_previous_comments_link( 'Next', 5 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $link = get_previous_comments_link( 'Next' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Technically, it returns null here.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $link );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> set_query_var( 'cpage', $cpage );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestslinkwpGetCanonicalURLphp"></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/link/wpGetCanonicalURL.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/link/wpGetCanonicalURL.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/link/wpGetCanonicalURL.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,7 +41,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Test for a page that is not the queried object.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_non_current_page() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_permalink( self::$post_id ), wp_get_canonical_url( self::$post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_permalink( self::$post_id ), wp_get_canonical_url( self::$post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,7 +65,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> get_permalink( self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_get_canonical_url( self::$post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_get_canonical_url( self::$post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -87,7 +87,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = trailingslashit( get_permalink( self::$post_id ) ) . user_trailingslashit( $page, 'single_paged' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_get_canonical_url( self::$post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_get_canonical_url( self::$post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,7 +113,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> get_permalink( self::$post_id ) . '#comments'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_get_canonical_url( self::$post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_get_canonical_url( self::$post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,7 +137,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = user_trailingslashit( trailingslashit( get_permalink( self::$post_id ) ) . $wp_rewrite->comments_pagination_base . '-' . $cpage, 'commentpaged' ) . '#comments';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_get_canonical_url( self::$post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_get_canonical_url( self::$post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -148,7 +148,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $canonical_url = wp_get_canonical_url( self::$post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'get_canonical_url', array( $this, 'canonical_url_filter' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->canonical_url_filter(), $canonical_url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->canonical_url_filter(), $canonical_url );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestslinkphp"></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/link.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/link.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/link.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,7 +21,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $paged = get_pagenum_link( 2 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'home_url', array( $this, '_get_pagenum_link_cb' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $paged, home_url( '/WooHoo/page/2/' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $paged, home_url( '/WooHoo/page/2/' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['REQUEST_URI'] = $old_req_uri;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,43 +31,43 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id2 = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Basic case.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_permalink( $post_id ), wp_get_shortlink( $post_id, 'post' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_permalink( $post_id ), wp_get_shortlink( $post_id, 'post' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $GLOBALS['post'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Global post is not set.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', wp_get_shortlink( 0, 'post' ) );
- $this->assertEquals( '', wp_get_shortlink( 0 ) );
- $this->assertEquals( '', wp_get_shortlink() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', wp_get_shortlink( 0, 'post' ) );
+ $this->assertSame( '', wp_get_shortlink( 0 ) );
+ $this->assertSame( '', wp_get_shortlink() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['post'] = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Global post is set.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_permalink( $post_id ), wp_get_shortlink( 0, 'post' ) );
- $this->assertEquals( get_permalink( $post_id ), wp_get_shortlink( 0 ) );
- $this->assertEquals( get_permalink( $post_id ), wp_get_shortlink() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_permalink( $post_id ), wp_get_shortlink( 0, 'post' ) );
+ $this->assertSame( get_permalink( $post_id ), wp_get_shortlink( 0 ) );
+ $this->assertSame( get_permalink( $post_id ), wp_get_shortlink() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Not the global post.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_permalink( $post_id2 ), wp_get_shortlink( $post_id2, 'post' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_permalink( $post_id2 ), wp_get_shortlink( $post_id2, 'post' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $GLOBALS['post'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Global post is not set, once again.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', wp_get_shortlink( 0, 'post' ) );
- $this->assertEquals( '', wp_get_shortlink( 0 ) );
- $this->assertEquals( '', wp_get_shortlink() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', wp_get_shortlink( 0, 'post' ) );
+ $this->assertSame( '', wp_get_shortlink( 0 ) );
+ $this->assertSame( '', wp_get_shortlink() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // With a permalink structure set, get_permalink() will no longer match.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( get_permalink( $post_id ), wp_get_shortlink( $post_id, 'post' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink( $post_id, 'post' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( home_url( '?p=' . $post_id ), wp_get_shortlink( $post_id, 'post' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Global post and permalink structure are set.
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['post'] = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink( 0, 'post' ) );
- $this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink( 0 ) );
- $this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( home_url( '?p=' . $post_id ), wp_get_shortlink( 0, 'post' ) );
+ $this->assertSame( home_url( '?p=' . $post_id ), wp_get_shortlink( 0 ) );
+ $this->assertSame( home_url( '?p=' . $post_id ), wp_get_shortlink() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_get_shortlink_with_page() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,11 +75,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Basic case.
</span><span class="cx" style="display: block; padding: 0 10px"> // Don't test against get_permalink() since it uses ?page_id= for pages.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink( $post_id, 'post' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( home_url( '?p=' . $post_id ), wp_get_shortlink( $post_id, 'post' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink( $post_id, 'post' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( home_url( '?p=' . $post_id ), wp_get_shortlink( $post_id, 'post' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,11 +90,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'show_on_front', 'page' );
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'page_on_front', $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( home_url( '/' ), wp_get_shortlink( $post_id, 'post' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( home_url( '/' ), wp_get_shortlink( $post_id, 'post' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( home_url( '/' ), wp_get_shortlink( $post_id, 'post' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( home_url( '/' ), wp_get_shortlink( $post_id, 'post' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -114,7 +114,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $non_pretty_permalink = add_query_arg( 'p', $p, trailingslashit( home_url() ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $non_pretty_permalink, get_permalink( $p ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $non_pretty_permalink, get_permalink( $p ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -143,7 +143,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> trailingslashit( home_url() )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $non_pretty_permalink, get_permalink( $p ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $non_pretty_permalink, get_permalink( $p ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestslocalephp"></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/locale.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/locale.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/locale.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,13 +16,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_weekday() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( __( 'Sunday' ), $this->locale->get_weekday( 0 ) );
- $this->assertEquals( __( 'Monday' ), $this->locale->get_weekday( 1 ) );
- $this->assertEquals( __( 'Tuesday' ), $this->locale->get_weekday( 2 ) );
- $this->assertEquals( __( 'Wednesday' ), $this->locale->get_weekday( 3 ) );
- $this->assertEquals( __( 'Thursday' ), $this->locale->get_weekday( 4 ) );
- $this->assertEquals( __( 'Friday' ), $this->locale->get_weekday( 5 ) );
- $this->assertEquals( __( 'Saturday' ), $this->locale->get_weekday( 6 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( __( 'Sunday' ), $this->locale->get_weekday( 0 ) );
+ $this->assertSame( __( 'Monday' ), $this->locale->get_weekday( 1 ) );
+ $this->assertSame( __( 'Tuesday' ), $this->locale->get_weekday( 2 ) );
+ $this->assertSame( __( 'Wednesday' ), $this->locale->get_weekday( 3 ) );
+ $this->assertSame( __( 'Thursday' ), $this->locale->get_weekday( 4 ) );
+ $this->assertSame( __( 'Friday' ), $this->locale->get_weekday( 5 ) );
+ $this->assertSame( __( 'Saturday' ), $this->locale->get_weekday( 6 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,72 +33,72 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_weekday_initial() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( __( 'S' ), $this->locale->get_weekday_initial( __( 'Sunday' ) ) );
- $this->assertEquals( __( 'M' ), $this->locale->get_weekday_initial( __( 'Monday' ) ) );
- $this->assertEquals( __( 'T' ), $this->locale->get_weekday_initial( __( 'Tuesday' ) ) );
- $this->assertEquals( __( 'W' ), $this->locale->get_weekday_initial( __( 'Wednesday' ) ) );
- $this->assertEquals( __( 'T' ), $this->locale->get_weekday_initial( __( 'Thursday' ) ) );
- $this->assertEquals( __( 'F' ), $this->locale->get_weekday_initial( __( 'Friday' ) ) );
- $this->assertEquals( __( 'S' ), $this->locale->get_weekday_initial( __( 'Saturday' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( __( 'S' ), $this->locale->get_weekday_initial( __( 'Sunday' ) ) );
+ $this->assertSame( __( 'M' ), $this->locale->get_weekday_initial( __( 'Monday' ) ) );
+ $this->assertSame( __( 'T' ), $this->locale->get_weekday_initial( __( 'Tuesday' ) ) );
+ $this->assertSame( __( 'W' ), $this->locale->get_weekday_initial( __( 'Wednesday' ) ) );
+ $this->assertSame( __( 'T' ), $this->locale->get_weekday_initial( __( 'Thursday' ) ) );
+ $this->assertSame( __( 'F' ), $this->locale->get_weekday_initial( __( 'Friday' ) ) );
+ $this->assertSame( __( 'S' ), $this->locale->get_weekday_initial( __( 'Saturday' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_weekday_abbrev() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( __( 'Sun' ), $this->locale->get_weekday_abbrev( __( 'Sunday' ) ) );
- $this->assertEquals( __( 'Mon' ), $this->locale->get_weekday_abbrev( __( 'Monday' ) ) );
- $this->assertEquals( __( 'Tue' ), $this->locale->get_weekday_abbrev( __( 'Tuesday' ) ) );
- $this->assertEquals( __( 'Wed' ), $this->locale->get_weekday_abbrev( __( 'Wednesday' ) ) );
- $this->assertEquals( __( 'Thu' ), $this->locale->get_weekday_abbrev( __( 'Thursday' ) ) );
- $this->assertEquals( __( 'Fri' ), $this->locale->get_weekday_abbrev( __( 'Friday' ) ) );
- $this->assertEquals( __( 'Sat' ), $this->locale->get_weekday_abbrev( __( 'Saturday' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( __( 'Sun' ), $this->locale->get_weekday_abbrev( __( 'Sunday' ) ) );
+ $this->assertSame( __( 'Mon' ), $this->locale->get_weekday_abbrev( __( 'Monday' ) ) );
+ $this->assertSame( __( 'Tue' ), $this->locale->get_weekday_abbrev( __( 'Tuesday' ) ) );
+ $this->assertSame( __( 'Wed' ), $this->locale->get_weekday_abbrev( __( 'Wednesday' ) ) );
+ $this->assertSame( __( 'Thu' ), $this->locale->get_weekday_abbrev( __( 'Thursday' ) ) );
+ $this->assertSame( __( 'Fri' ), $this->locale->get_weekday_abbrev( __( 'Friday' ) ) );
+ $this->assertSame( __( 'Sat' ), $this->locale->get_weekday_abbrev( __( 'Saturday' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_month() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( __( 'January' ), $this->locale->get_month( 1 ) );
- $this->assertEquals( __( 'February' ), $this->locale->get_month( 2 ) );
- $this->assertEquals( __( 'March' ), $this->locale->get_month( 3 ) );
- $this->assertEquals( __( 'April' ), $this->locale->get_month( 4 ) );
- $this->assertEquals( __( 'May' ), $this->locale->get_month( 5 ) );
- $this->assertEquals( __( 'June' ), $this->locale->get_month( 6 ) );
- $this->assertEquals( __( 'July' ), $this->locale->get_month( 7 ) );
- $this->assertEquals( __( 'August' ), $this->locale->get_month( 8 ) );
- $this->assertEquals( __( 'September' ), $this->locale->get_month( 9 ) );
- $this->assertEquals( __( 'October' ), $this->locale->get_month( 10 ) );
- $this->assertEquals( __( 'November' ), $this->locale->get_month( 11 ) );
- $this->assertEquals( __( 'December' ), $this->locale->get_month( 12 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( __( 'January' ), $this->locale->get_month( 1 ) );
+ $this->assertSame( __( 'February' ), $this->locale->get_month( 2 ) );
+ $this->assertSame( __( 'March' ), $this->locale->get_month( 3 ) );
+ $this->assertSame( __( 'April' ), $this->locale->get_month( 4 ) );
+ $this->assertSame( __( 'May' ), $this->locale->get_month( 5 ) );
+ $this->assertSame( __( 'June' ), $this->locale->get_month( 6 ) );
+ $this->assertSame( __( 'July' ), $this->locale->get_month( 7 ) );
+ $this->assertSame( __( 'August' ), $this->locale->get_month( 8 ) );
+ $this->assertSame( __( 'September' ), $this->locale->get_month( 9 ) );
+ $this->assertSame( __( 'October' ), $this->locale->get_month( 10 ) );
+ $this->assertSame( __( 'November' ), $this->locale->get_month( 11 ) );
+ $this->assertSame( __( 'December' ), $this->locale->get_month( 12 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_month_leading_zero() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( __( 'January' ), $this->locale->get_month( '01' ) );
- $this->assertEquals( __( 'February' ), $this->locale->get_month( '02' ) );
- $this->assertEquals( __( 'March' ), $this->locale->get_month( '03' ) );
- $this->assertEquals( __( 'April' ), $this->locale->get_month( '04' ) );
- $this->assertEquals( __( 'May' ), $this->locale->get_month( '05' ) );
- $this->assertEquals( __( 'June' ), $this->locale->get_month( '06' ) );
- $this->assertEquals( __( 'July' ), $this->locale->get_month( '07' ) );
- $this->assertEquals( __( 'August' ), $this->locale->get_month( '08' ) );
- $this->assertEquals( __( 'September' ), $this->locale->get_month( '09' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( __( 'January' ), $this->locale->get_month( '01' ) );
+ $this->assertSame( __( 'February' ), $this->locale->get_month( '02' ) );
+ $this->assertSame( __( 'March' ), $this->locale->get_month( '03' ) );
+ $this->assertSame( __( 'April' ), $this->locale->get_month( '04' ) );
+ $this->assertSame( __( 'May' ), $this->locale->get_month( '05' ) );
+ $this->assertSame( __( 'June' ), $this->locale->get_month( '06' ) );
+ $this->assertSame( __( 'July' ), $this->locale->get_month( '07' ) );
+ $this->assertSame( __( 'August' ), $this->locale->get_month( '08' ) );
+ $this->assertSame( __( 'September' ), $this->locale->get_month( '09' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_month_abbrev() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( __( 'Jan' ), $this->locale->get_month_abbrev( __( 'January' ) ) );
- $this->assertEquals( __( 'Feb' ), $this->locale->get_month_abbrev( __( 'February' ) ) );
- $this->assertEquals( __( 'Mar' ), $this->locale->get_month_abbrev( __( 'March' ) ) );
- $this->assertEquals( __( 'Apr' ), $this->locale->get_month_abbrev( __( 'April' ) ) );
- $this->assertEquals( __( 'May' ), $this->locale->get_month_abbrev( __( 'May' ) ) );
- $this->assertEquals( __( 'Jun' ), $this->locale->get_month_abbrev( __( 'June' ) ) );
- $this->assertEquals( __( 'Jul' ), $this->locale->get_month_abbrev( __( 'July' ) ) );
- $this->assertEquals( __( 'Aug' ), $this->locale->get_month_abbrev( __( 'August' ) ) );
- $this->assertEquals( __( 'Sep' ), $this->locale->get_month_abbrev( __( 'September' ) ) );
- $this->assertEquals( __( 'Oct' ), $this->locale->get_month_abbrev( __( 'October' ) ) );
- $this->assertEquals( __( 'Nov' ), $this->locale->get_month_abbrev( __( 'November' ) ) );
- $this->assertEquals( __( 'Dec' ), $this->locale->get_month_abbrev( __( 'December' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( __( 'Jan' ), $this->locale->get_month_abbrev( __( 'January' ) ) );
+ $this->assertSame( __( 'Feb' ), $this->locale->get_month_abbrev( __( 'February' ) ) );
+ $this->assertSame( __( 'Mar' ), $this->locale->get_month_abbrev( __( 'March' ) ) );
+ $this->assertSame( __( 'Apr' ), $this->locale->get_month_abbrev( __( 'April' ) ) );
+ $this->assertSame( __( 'May' ), $this->locale->get_month_abbrev( __( 'May' ) ) );
+ $this->assertSame( __( 'Jun' ), $this->locale->get_month_abbrev( __( 'June' ) ) );
+ $this->assertSame( __( 'Jul' ), $this->locale->get_month_abbrev( __( 'July' ) ) );
+ $this->assertSame( __( 'Aug' ), $this->locale->get_month_abbrev( __( 'August' ) ) );
+ $this->assertSame( __( 'Sep' ), $this->locale->get_month_abbrev( __( 'September' ) ) );
+ $this->assertSame( __( 'Oct' ), $this->locale->get_month_abbrev( __( 'October' ) ) );
+ $this->assertSame( __( 'Nov' ), $this->locale->get_month_abbrev( __( 'November' ) ) );
+ $this->assertSame( __( 'Dec' ), $this->locale->get_month_abbrev( __( 'December' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_meridiem() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( __( 'am' ), $this->locale->get_meridiem( 'am' ) );
- $this->assertEquals( __( 'AM' ), $this->locale->get_meridiem( 'AM' ) );
- $this->assertEquals( __( 'pm' ), $this->locale->get_meridiem( 'pm' ) );
- $this->assertEquals( __( 'PM' ), $this->locale->get_meridiem( 'PM' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( __( 'am' ), $this->locale->get_meridiem( 'am' ) );
+ $this->assertSame( __( 'AM' ), $this->locale->get_meridiem( 'AM' ) );
+ $this->assertSame( __( 'pm' ), $this->locale->get_meridiem( 'pm' ) );
+ $this->assertSame( __( 'PM' ), $this->locale->get_meridiem( 'PM' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_is_rtl() {
</span></span></pre></div>
<a id="trunktestsphpunittestsmailphp"></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/mail.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/mail.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/mail.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -80,7 +80,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $mailer = tests_retrieve_phpmailer_instance();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // We need some better assertions here but these catch the failure for now.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $body, $mailer->get_sent()->body );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $body, $mailer->get_sent()->body );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( strpos( iconv_mime_decode_headers( ( $mailer->get_sent()->header ) )['Content-Type'][0], 'boundary="----=_Part_4892_25692638.1192452070893"' ) > 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( strpos( $mailer->get_sent()->header, 'charset=' ) > 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -106,13 +106,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Retrieve the mailer instance.
</span><span class="cx" style="display: block; padding: 0 10px"> $mailer = tests_retrieve_phpmailer_instance();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'address@tld.com', $mailer->get_recipient( 'to' )->address );
- $this->assertEquals( 'Name', $mailer->get_recipient( 'to' )->name );
- $this->assertEquals( 'cc@cc.com', $mailer->get_recipient( 'cc' )->address );
- $this->assertEquals( 'The Carbon Guy', $mailer->get_recipient( 'cc' )->name );
- $this->assertEquals( 'bcc@bcc.com', $mailer->get_recipient( 'bcc' )->address );
- $this->assertEquals( 'The Blind Carbon Guy', $mailer->get_recipient( 'bcc' )->name );
- $this->assertEqualsIgnoreEOL( $message . "\n", $mailer->get_sent()->body );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'address@tld.com', $mailer->get_recipient( 'to' )->address );
+ $this->assertSame( 'Name', $mailer->get_recipient( 'to' )->name );
+ $this->assertSame( 'cc@cc.com', $mailer->get_recipient( 'cc' )->address );
+ $this->assertSame( 'The Carbon Guy', $mailer->get_recipient( 'cc' )->name );
+ $this->assertSame( 'bcc@bcc.com', $mailer->get_recipient( 'bcc' )->address );
+ $this->assertSame( 'The Blind Carbon Guy', $mailer->get_recipient( 'bcc' )->name );
+ $this->assertSameIgnoreEOL( $message . "\n", $mailer->get_sent()->body );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -128,11 +128,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // WordPress 3.2 and later correctly split the address into the two parts and send them separately to PHPMailer.
</span><span class="cx" style="display: block; padding: 0 10px"> // Earlier versions of PHPMailer were not touchy about the formatting of these arguments.
</span><span class="cx" style="display: block; padding: 0 10px"> $mailer = tests_retrieve_phpmailer_instance();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'address@tld.com', $mailer->get_recipient( 'to' )->address );
- $this->assertEquals( 'Name', $mailer->get_recipient( 'to' )->name );
- $this->assertEquals( 'another_address@different-tld.com', $mailer->get_recipient( 'to', 0, 1 )->address );
- $this->assertEquals( 'Another Name', $mailer->get_recipient( 'to', 0, 1 )->name );
- $this->assertEqualsIgnoreEOL( $message . "\n", $mailer->get_sent()->body );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'address@tld.com', $mailer->get_recipient( 'to' )->address );
+ $this->assertSame( 'Name', $mailer->get_recipient( 'to' )->name );
+ $this->assertSame( 'another_address@different-tld.com', $mailer->get_recipient( 'to', 0, 1 )->address );
+ $this->assertSame( 'Another Name', $mailer->get_recipient( 'to', 0, 1 )->name );
+ $this->assertSameIgnoreEOL( $message . "\n", $mailer->get_sent()->body );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_mail_multiple_to_addresses() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -143,9 +143,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_mail( $to, $subject, $message );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $mailer = tests_retrieve_phpmailer_instance();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'address@tld.com', $mailer->get_recipient( 'to' )->address );
- $this->assertEquals( 'another_address@different-tld.com', $mailer->get_recipient( 'to', 0, 1 )->address );
- $this->assertEqualsIgnoreEOL( $message . "\n", $mailer->get_sent()->body );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'address@tld.com', $mailer->get_recipient( 'to' )->address );
+ $this->assertSame( 'another_address@different-tld.com', $mailer->get_recipient( 'to', 0, 1 )->address );
+ $this->assertSameIgnoreEOL( $message . "\n", $mailer->get_sent()->body );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -159,8 +159,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_mail( $to, $subject, $message );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $mailer = tests_retrieve_phpmailer_instance();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'address@tld.com', $mailer->get_recipient( 'to' )->address );
- $this->assertEqualsIgnoreEOL( $message . "\n", $mailer->get_sent()->body );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'address@tld.com', $mailer->get_recipient( 'to' )->address );
+ $this->assertSameIgnoreEOL( $message . "\n", $mailer->get_sent()->body );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -286,7 +286,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_mail( $to, $subject, $message, $headers );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $mailer = tests_retrieve_phpmailer_instance();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, substr_count( $mailer->get_sent()->header, $expected ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, substr_count( $mailer->get_sent()->header, $expected ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_mail_quoted_printable( $mailer ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -354,7 +354,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $headers as $header => $value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $target_headers = preg_grep( "/^$header:/", $sent_headers );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected[ $header ], array_pop( $target_headers ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected[ $header ], array_pop( $target_headers ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -373,7 +373,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $mailer = tests_retrieve_phpmailer_instance();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $mailer->Sender );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $mailer->Sender );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -389,7 +389,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_mail( $to, $subject, $message );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $ma->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $ma->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_error_data = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'to' => array( 'an_invalid_address' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -404,8 +404,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $all_args = $ma->get_args();
</span><span class="cx" style="display: block; padding: 0 10px"> $call_args = array_pop( $all_args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'wp_mail_failed', $call_args[0]->get_error_code() );
- $this->assertEquals( $expected_error_data, $call_args[0]->get_error_data() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'wp_mail_failed', $call_args[0]->get_error_code() );
+ $this->assertSame( $expected_error_data, $call_args[0]->get_error_data() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsmediaphp"></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/media.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/media.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/media.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,8 +48,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_img_caption_shortcode_added() {
</span><span class="cx" style="display: block; padding: 0 10px"> global $shortcode_tags;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'img_caption_shortcode', $shortcode_tags['caption'] );
- $this->assertEquals( 'img_caption_shortcode', $shortcode_tags['wp_caption'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'img_caption_shortcode', $shortcode_tags['caption'] );
+ $this->assertSame( 'img_caption_shortcode', $shortcode_tags['wp_caption'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_img_caption_shortcode_with_empty_params() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,7 +62,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_img_caption_shortcode_with_empty_params_but_content() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = img_caption_shortcode( array(), $this->caption );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->caption, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->caption, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,7 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'img_caption_shortcode', array( $this, '_return_alt_caption' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = img_caption_shortcode( array(), $this->caption );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->alternate_caption, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->alternate_caption, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,7 +92,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $this->caption
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->caption, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->caption, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,7 +117,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $this->caption
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->caption, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->caption, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_img_caption_shortcode_with_old_format() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -128,14 +128,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, preg_match_all( '/wp-caption/', $result, $_r ) );
- $this->assertEquals( 1, preg_match_all( '/alignnone/', $result, $_r ) );
- $this->assertEquals( 1, preg_match_all( "/{$this->caption}/", $result, $_r ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, preg_match_all( '/wp-caption/', $result, $_r ) );
+ $this->assertSame( 1, preg_match_all( '/alignnone/', $result, $_r ) );
+ $this->assertSame( 1, preg_match_all( "/{$this->caption}/", $result, $_r ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( current_theme_supports( 'html5', 'caption' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, preg_match_all( '/width: 20/', $result, $_r ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, preg_match_all( '/width: 20/', $result, $_r ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, preg_match_all( '/width: 30/', $result, $_r ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, preg_match_all( '/width: 30/', $result, $_r ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -148,9 +148,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'align' => '&myAlignment',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, preg_match_all( '/wp-caption &myAlignment/', $result, $_r ) );
- $this->assertEquals( 1, preg_match_all( '/id="myId"/', $result, $_r ) );
- $this->assertEquals( 1, preg_match_all( "/{$this->caption}/", $result, $_r ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, preg_match_all( '/wp-caption &myAlignment/', $result, $_r ) );
+ $this->assertSame( 1, preg_match_all( '/id="myId"/', $result, $_r ) );
+ $this->assertSame( 1, preg_match_all( "/{$this->caption}/", $result, $_r ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_img_caption_shortcode_with_old_format_and_class() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -161,7 +161,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'caption' => $this->caption,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, preg_match_all( '/wp-caption alignnone some-class another-class/', $result, $_r ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, preg_match_all( '/wp-caption alignnone some-class another-class/', $result, $_r ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -174,7 +174,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $our_preg = preg_quote( $this->html_content );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, preg_match_all( "~{$our_preg}~", $result, $_r ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, preg_match_all( "~{$our_preg}~", $result, $_r ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_new_img_caption_shortcode_new_format() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -185,8 +185,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $img_preg = preg_quote( $this->img_content );
</span><span class="cx" style="display: block; padding: 0 10px"> $content_preg = preg_quote( $this->html_content );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, preg_match_all( "~{$img_preg}.*wp-caption-text~", $result, $_r ) );
- $this->assertEquals( 1, preg_match_all( "~wp-caption-text.*{$content_preg}~", $result, $_r ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, preg_match_all( "~{$img_preg}.*wp-caption-text~", $result, $_r ) );
+ $this->assertSame( 1, preg_match_all( "~wp-caption-text.*{$content_preg}~", $result, $_r ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_new_img_caption_shortcode_new_format_and_linked_image() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -198,8 +198,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $img_preg = preg_quote( $linked_image );
</span><span class="cx" style="display: block; padding: 0 10px"> $content_preg = preg_quote( $this->html_content );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, preg_match_all( "~{$img_preg}.*wp-caption-text~", $result, $_r ) );
- $this->assertEquals( 1, preg_match_all( "~wp-caption-text.*{$content_preg}~", $result, $_r ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, preg_match_all( "~{$img_preg}.*wp-caption-text~", $result, $_r ) );
+ $this->assertSame( 1, preg_match_all( "~wp-caption-text.*{$content_preg}~", $result, $_r ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_new_img_caption_shortcode_new_format_and_linked_image_with_newline() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -211,8 +211,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $img_preg = preg_quote( $linked_image );
</span><span class="cx" style="display: block; padding: 0 10px"> $content_preg = preg_quote( $this->html_content );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, preg_match_all( "~{$img_preg}.*wp-caption-text~", $result, $_r ) );
- $this->assertEquals( 1, preg_match_all( "~wp-caption-text.*{$content_preg}~", $result, $_r ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, preg_match_all( "~{$img_preg}.*wp-caption-text~", $result, $_r ) );
+ $this->assertSame( 1, preg_match_all( "~wp-caption-text.*{$content_preg}~", $result, $_r ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -227,7 +227,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->img_content . $this->html_content
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, preg_match_all( '/aria-describedby="caption-myId"/', $result, $_r ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, preg_match_all( '/aria-describedby="caption-myId"/', $result, $_r ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_add_remove_oembed_provider() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -245,7 +245,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $content = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $wp_embed->autoembed( $content );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $content, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $content, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -267,7 +267,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> EOF;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $wp_embed->autoembed( $content );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $content, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $content, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_autoembed() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -333,7 +333,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_autoembed( $content, $result = null ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_embed = new Test_Autoembed;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $wp_embed->autoembed( $content ), $result ? $result : $content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $wp_embed->autoembed( $content ), $result ? $result : $content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_prepare_attachment_for_js() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -350,31 +350,31 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $prepped = wp_prepare_attachment_for_js( $post );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $prepped );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $prepped['uploadedTo'] );
- $this->assertEquals( '', $prepped['mime'] );
- $this->assertEquals( '', $prepped['type'] );
- $this->assertEquals( '', $prepped['subtype'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $prepped['uploadedTo'] );
+ $this->assertSame( '', $prepped['mime'] );
+ $this->assertSame( '', $prepped['type'] );
+ $this->assertSame( '', $prepped['subtype'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> // #21963, there will be a GUID always, so there will be a URL.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( '', $prepped['url'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( site_url( 'wp-includes/images/media/default.png' ), $prepped['icon'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( site_url( 'wp-includes/images/media/default.png' ), $prepped['icon'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fake a mime.
</span><span class="cx" style="display: block; padding: 0 10px"> $post->post_mime_type = 'image/jpeg';
</span><span class="cx" style="display: block; padding: 0 10px"> $prepped = wp_prepare_attachment_for_js( $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'image/jpeg', $prepped['mime'] );
- $this->assertEquals( 'image', $prepped['type'] );
- $this->assertEquals( 'jpeg', $prepped['subtype'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'image/jpeg', $prepped['mime'] );
+ $this->assertSame( 'image', $prepped['type'] );
+ $this->assertSame( 'jpeg', $prepped['subtype'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fake a mime without a slash. See #WP22532.
</span><span class="cx" style="display: block; padding: 0 10px"> $post->post_mime_type = 'image';
</span><span class="cx" style="display: block; padding: 0 10px"> $prepped = wp_prepare_attachment_for_js( $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'image', $prepped['mime'] );
- $this->assertEquals( 'image', $prepped['type'] );
- $this->assertEquals( '', $prepped['subtype'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'image', $prepped['mime'] );
+ $this->assertSame( 'image', $prepped['type'] );
+ $this->assertSame( '', $prepped['subtype'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test that if author is not found, we return "(no author)" as `display_name`.
</span><span class="cx" style="display: block; padding: 0 10px"> // The previously used test post contains no author, so we can reuse it.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '(no author)', $prepped['authorName'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '(no author)', $prepped['authorName'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test that if author has HTML entities in display_name, they're decoded correctly.
</span><span class="cx" style="display: block; padding: 0 10px"> $html_entity_author = self::factory()->user->create(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -384,7 +384,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post->post_author = $html_entity_author;
</span><span class="cx" style="display: block; padding: 0 10px"> $prepped = wp_prepare_attachment_for_js( $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'You & Me', $prepped['authorName'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'You & Me', $prepped['authorName'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -428,15 +428,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $tb = $gb * 1024;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test if boundaries are correct.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1TB', wp_convert_bytes_to_hr( $tb ) );
- $this->assertEquals( '1GB', wp_convert_bytes_to_hr( $gb ) );
- $this->assertEquals( '1MB', wp_convert_bytes_to_hr( $mb ) );
- $this->assertEquals( '1KB', wp_convert_bytes_to_hr( $kb ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1TB', wp_convert_bytes_to_hr( $tb ) );
+ $this->assertSame( '1GB', wp_convert_bytes_to_hr( $gb ) );
+ $this->assertSame( '1MB', wp_convert_bytes_to_hr( $mb ) );
+ $this->assertSame( '1KB', wp_convert_bytes_to_hr( $kb ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1 TB', size_format( $tb ) );
- $this->assertEquals( '1 GB', size_format( $gb ) );
- $this->assertEquals( '1 MB', size_format( $mb ) );
- $this->assertEquals( '1 KB', size_format( $kb ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1 TB', size_format( $tb ) );
+ $this->assertSame( '1 GB', size_format( $gb ) );
+ $this->assertSame( '1 MB', size_format( $mb ) );
+ $this->assertSame( '1 KB', size_format( $kb ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Now some values around.
</span><span class="cx" style="display: block; padding: 0 10px"> $hr = wp_convert_bytes_to_hr( $tb + $tb / 2 + $mb );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -452,8 +452,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1022.99902344, (float) str_replace( ',', '.', $hr ), 'The values should be equal', 0.0001 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Edge.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '-1B', wp_convert_bytes_to_hr( -1 ) );
- $this->assertEquals( '0B', wp_convert_bytes_to_hr( 0 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '-1B', wp_convert_bytes_to_hr( -1 ) );
+ $this->assertSame( '0B', wp_convert_bytes_to_hr( 0 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -522,7 +522,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> BLOB;
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_content' => $blob ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $srcs = get_post_galleries_images( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $srcs, array( $ids1_srcs, $ids2_srcs ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $srcs, array( $ids1_srcs, $ids2_srcs ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -672,7 +672,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> BLOB;
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_content' => $blob ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $srcs = get_post_gallery_images( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $srcs, $ids1_srcs );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $srcs, $ids1_srcs );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_media_embedded_in_content() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -721,22 +721,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $contents = array_values( compact( $types ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $matches = get_media_embedded_in_content( $content, 'audio' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $audio ), $matches );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $audio ), $matches );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $matches = get_media_embedded_in_content( $content, 'video' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $video ), $matches );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $video ), $matches );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $matches = get_media_embedded_in_content( $content, 'object' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $object ), $matches );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $object ), $matches );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $matches = get_media_embedded_in_content( $content, 'embed' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $embed ), $matches );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $embed ), $matches );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $matches = get_media_embedded_in_content( $content, 'iframe' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $iframe ), $matches );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $iframe ), $matches );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $matches = get_media_embedded_in_content( $content, $types );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $contents, $matches );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $contents, $matches );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_media_embedded_in_content_order() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -753,11 +753,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $content = $audio . $video;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $matches1 = get_media_embedded_in_content( $content, array( 'audio', 'video' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $audio, $video ), $matches1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $audio, $video ), $matches1 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $reversed = $video . $audio;
</span><span class="cx" style="display: block; padding: 0 10px"> $matches2 = get_media_embedded_in_content( $reversed, array( 'audio', 'video' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $video, $audio ), $matches2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $video, $audio ), $matches2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -859,7 +859,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '<a href="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4">' .
</span><span class="cx" style="display: block; padding: 0 10px"> "http://domain.tld/wp-content/uploads/2013/12/xyz.mp4</a></video></div>\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1016,8 +1016,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_image_size( 'test-size' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'test-size', $sizes );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $sizes['test-size']['width'] );
- $this->assertEquals( 600, $sizes['test-size']['height'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $sizes['test-size']['width'] );
+ $this->assertSame( 600, $sizes['test-size']['height'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1056,7 +1056,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $image_url = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . $image_path;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $attachment_id, attachment_url_to_postid( $image_url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $attachment_id, attachment_url_to_postid( $image_url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1074,7 +1074,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $image_url = 'https://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . $image_path;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $attachment_id, attachment_url_to_postid( $image_url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $attachment_id, attachment_url_to_postid( $image_url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1102,7 +1102,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $image_url = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . $image_path_upper_case;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $attachment_id_upper_case, attachment_url_to_postid( $image_url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $attachment_id_upper_case, attachment_url_to_postid( $image_url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_attachment_url_to_postid_filtered() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1118,7 +1118,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'upload_dir', array( $this, '_upload_dir' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $image_url = 'http://192.168.1.20.com/wp-content/uploads/' . $image_path;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $attachment_id, attachment_url_to_postid( $image_url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $attachment_id, attachment_url_to_postid( $image_url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'upload_dir', array( $this, '_upload_dir' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1133,7 +1133,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_attachment_url_to_postid_with_empty_url() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = attachment_url_to_postid( '' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'int', $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1172,7 +1172,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Clean up.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_attachment( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'This is a comment. / Это комментарий. / Βλέπετε ένα σχόλιο.', $post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'This is a comment. / Это комментарий. / Βλέπετε ένα σχόλιο.', $post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1211,7 +1211,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Clean up.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_attachment( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'This is a test', $post->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'This is a test', $post->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1228,7 +1228,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> EOF;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $wp_embed->autoembed( $content );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $content, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $content, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1244,7 +1244,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> EOF;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $wp_embed->autoembed( $content );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $content, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $content, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1278,7 +1278,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> EOF;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = apply_filters( 'the_content', $content );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1307,7 +1307,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> EOF;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $wp_embed->autoembed( $content );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $content = <<<EOF
</span><span class="cx" style="display: block; padding: 0 10px"> <a href="https://www.example.com/?video=1">https://www.example.com/?video=1</a>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1321,7 +1321,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> EOF;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $wp_embed->autoembed( $content );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $content, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $content, $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'embed_maybe_make_link', array( $this, 'filter_wp_embed_shortcode_custom' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1340,7 +1340,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $image[0]
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_get_attachment_image( self::$large_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_get_attachment_image( self::$large_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1360,7 +1360,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $image[0]
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_get_attachment_image( self::$large_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_get_attachment_image( self::$large_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Cleanup.
</span><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( self::$large_id, '_wp_attachment_image_alt', '', true );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1384,7 +1384,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $image = wp_get_attachment_image_src( $attachment_id, 'thumbnail', false );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $image[0], wp_get_attachment_image_url( $attachment_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $image[0], wp_get_attachment_image_url( $attachment_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1408,7 +1408,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wp_get_attachment_caption( $post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $caption, wp_get_attachment_caption( $attachment_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $caption, wp_get_attachment_caption( $attachment_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1426,7 +1426,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', wp_get_attachment_caption( $attachment_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', wp_get_attachment_caption( $attachment_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2387,7 +2387,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment_id = wp_insert_attachment( $data, '', 0, true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $attachment_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_date', $attachment_id->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_date', $attachment_id->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment_id = wp_insert_attachment( $data, '', 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 0, $attachment_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2406,7 +2406,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 123, wp_get_media_creation_timestamp( $metadata ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 123, wp_get_media_creation_timestamp( $metadata ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2424,7 +2424,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1450978809, wp_get_media_creation_timestamp( $metadata ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1450978809, wp_get_media_creation_timestamp( $metadata ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2444,7 +2444,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1450978805, wp_get_media_creation_timestamp( $metadata ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1450978805, wp_get_media_creation_timestamp( $metadata ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2462,7 +2462,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1265680539, wp_get_media_creation_timestamp( $metadata ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1265680539, wp_get_media_creation_timestamp( $metadata ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2477,7 +2477,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $video = DIR_TESTDATA . '/uploads/small-video.mp4';
</span><span class="cx" style="display: block; padding: 0 10px"> $metadata = wp_read_audio_metadata( $video );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1269120551, $metadata['created_timestamp'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1269120551, $metadata['created_timestamp'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2487,7 +2487,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $video = DIR_TESTDATA . '/uploads/small-video.mov';
</span><span class="cx" style="display: block; padding: 0 10px"> $metadata = wp_read_video_metadata( $video );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1269120551, $metadata['created_timestamp'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1269120551, $metadata['created_timestamp'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2497,7 +2497,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $video = DIR_TESTDATA . '/uploads/small-video.mp4';
</span><span class="cx" style="display: block; padding: 0 10px"> $metadata = wp_read_video_metadata( $video );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1269120551, $metadata['created_timestamp'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1269120551, $metadata['created_timestamp'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2507,7 +2507,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $video = DIR_TESTDATA . '/uploads/small-video.mkv';
</span><span class="cx" style="display: block; padding: 0 10px"> $metadata = wp_read_video_metadata( $video );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1269120551, $metadata['created_timestamp'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1269120551, $metadata['created_timestamp'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2517,7 +2517,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $video = DIR_TESTDATA . '/uploads/small-video.webm';
</span><span class="cx" style="display: block; padding: 0 10px"> $metadata = wp_read_video_metadata( $video );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1269120551, $metadata['created_timestamp'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1269120551, $metadata['created_timestamp'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2969,7 +2969,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'link' => 'file',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, substr_count( $actual, '.jpg' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, substr_count( $actual, '.jpg' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // None: Does not link.
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = gallery_shortcode(
</span></span></pre></div>
<a id="trunktestsphpunittestsmenunavmenuphp"></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/menu/nav-menu.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/menu/nav-menu.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/menu/nav-menu.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,7 +44,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_nav_menu_locations = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'primary' => 1,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_nav_menu_locations, $new_next_theme_nav_menu_locations );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_nav_menu_locations, $new_next_theme_nav_menu_locations );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -66,7 +66,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'primary' => 1,
</span><span class="cx" style="display: block; padding: 0 10px"> 'secondary' => 2,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_nav_menu_locations, $new_next_theme_nav_menu_locations );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_nav_menu_locations, $new_next_theme_nav_menu_locations );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -85,7 +85,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_next_theme_nav_menu_locations = wp_map_nav_menu_locations( $old_next_theme_nav_menu_locations, $prev_theme_nav_menu_locations );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_nav_menu_locations = $prev_theme_nav_menu_locations;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_nav_menu_locations, $new_next_theme_nav_menu_locations );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_nav_menu_locations, $new_next_theme_nav_menu_locations );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -109,7 +109,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_next_theme_nav_menu_locations = wp_map_nav_menu_locations( $old_next_theme_nav_menu_locations, $prev_theme_nav_menu_locations );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_nav_menu_locations = wp_array_slice_assoc( $prev_theme_nav_menu_locations, array_keys( get_registered_nav_menus() ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_nav_menu_locations, $new_next_theme_nav_menu_locations );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_nav_menu_locations, $new_next_theme_nav_menu_locations );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -132,7 +132,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'primary' => 1,
</span><span class="cx" style="display: block; padding: 0 10px"> 'secondary' => 2,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_nav_menu_locations, $new_next_theme_nav_menu_locations );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_nav_menu_locations, $new_next_theme_nav_menu_locations );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -176,7 +176,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'primary' => 1,
</span><span class="cx" style="display: block; padding: 0 10px"> 'main' => 2,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_nav_menu_locations, $new_next_theme_nav_menu_locations );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_nav_menu_locations, $new_next_theme_nav_menu_locations );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsmenuwpExpandNavMenuPostDataphp"></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/menu/wpExpandNavMenuPostData.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/menu/wpExpandNavMenuPostData.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/menu/wpExpandNavMenuPostData.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,7 +25,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'yesorno' => 'yes',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $_POST );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $_POST );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_multidimensional_nested_array_should_expand() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,7 +55,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $_POST );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $_POST );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_multidimensional_nested_array_should_expand_and_merge() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -100,6 +100,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $_POST );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $_POST );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsmetadeleteMetadataphp"></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/meta/deleteMetadata.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/meta/deleteMetadata.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/meta/deleteMetadata.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -156,7 +156,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function action_check_object_id_is_int( $meta_type, $object_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'integer',
</span><span class="cx" style="display: block; padding: 0 10px"> gettype( $object_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span></span></pre></div>
<a id="trunktestsphpunittestsmetaqueryphp"></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/meta/query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/meta/query.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/meta/query.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,12 +10,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_empty_meta_query_param() {
</span><span class="cx" style="display: block; padding: 0 10px"> $query = new WP_Meta_Query();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( null, $query->relation );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $query->relation );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_default_relation() {
</span><span class="cx" style="display: block; padding: 0 10px"> $query = new WP_Meta_Query( array( array( 'key' => 'abc' ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'AND', $query->relation );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'AND', $query->relation );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_set_relation() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'AND', $query->relation );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'AND', $query->relation );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $query = new WP_Meta_Query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'OR', $query->relation );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'OR', $query->relation );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,7 +74,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $sql = $query->get_sql( 'post', $wpdb->posts, 'ID' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, substr_count( $sql['join'], 'INNER JOIN' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, substr_count( $sql['join'], 'INNER JOIN' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Also check mixing key and key => value.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,7 +92,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $sql = $query->get_sql( 'post', $wpdb->posts, 'ID' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, substr_count( $sql['join'], 'INNER JOIN' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, substr_count( $sql['join'], 'INNER JOIN' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -120,17 +120,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'compare' => 'bar',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'baz',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected0, $query->queries[0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected0, $query->queries[0] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected1 = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'OR',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo1',
</span><span class="cx" style="display: block; padding: 0 10px"> 'compare' => 'baz1',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar1',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'OR',
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected1, $query->queries[1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected1, $query->queries[1] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -176,10 +176,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Just meta_value.
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'OR',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'abc',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'OR',
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $query->parse_query_vars(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,15 +186,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta_key' => 'abc',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $query->queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $query->queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // meta_key & meta_value.
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'OR',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'abc',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'def',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'OR',
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $query->parse_query_vars(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -202,15 +202,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta_value' => 'def',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $query->queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $query->queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // meta_compare.
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'OR',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'abc',
</span><span class="cx" style="display: block; padding: 0 10px"> 'compare' => '=>',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'OR',
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $query->parse_query_vars(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -218,7 +218,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta_compare' => '=>',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $query->queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $query->queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -226,42 +226,42 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_cast_for_type() {
</span><span class="cx" style="display: block; padding: 0 10px"> $query = new WP_Meta_Query();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'BINARY', $query->get_cast_for_type( 'BINARY' ) );
- $this->assertEquals( 'CHAR', $query->get_cast_for_type( 'CHAR' ) );
- $this->assertEquals( 'DATE', $query->get_cast_for_type( 'DATE' ) );
- $this->assertEquals( 'DATETIME', $query->get_cast_for_type( 'DATETIME' ) );
- $this->assertEquals( 'SIGNED', $query->get_cast_for_type( 'SIGNED' ) );
- $this->assertEquals( 'UNSIGNED', $query->get_cast_for_type( 'UNSIGNED' ) );
- $this->assertEquals( 'TIME', $query->get_cast_for_type( 'TIME' ) );
- $this->assertEquals( 'SIGNED', $query->get_cast_for_type( 'NUMERIC' ) );
- $this->assertEquals( 'NUMERIC(10)', $query->get_cast_for_type( 'NUMERIC(10)' ) );
- $this->assertEquals( 'CHAR', $query->get_cast_for_type( 'NUMERIC( 10)' ) );
- $this->assertEquals( 'CHAR', $query->get_cast_for_type( 'NUMERIC( 10 )' ) );
- $this->assertEquals( 'NUMERIC(10, 5)', $query->get_cast_for_type( 'NUMERIC(10, 5)' ) );
- $this->assertEquals( 'CHAR', $query->get_cast_for_type( 'NUMERIC(10, 5)' ) );
- $this->assertEquals( 'NUMERIC(10,5)', $query->get_cast_for_type( 'NUMERIC(10,5)' ) );
- $this->assertEquals( 'CHAR', $query->get_cast_for_type( 'NUMERIC( 10, 5 )' ) );
- $this->assertEquals( 'CHAR', $query->get_cast_for_type( 'NUMERIC(10, 5 )' ) );
- $this->assertEquals( 'DECIMAL', $query->get_cast_for_type( 'DECIMAL' ) );
- $this->assertEquals( 'DECIMAL(10)', $query->get_cast_for_type( 'DECIMAL(10)' ) );
- $this->assertEquals( 'CHAR', $query->get_cast_for_type( 'DECIMAL( 10 )' ) );
- $this->assertEquals( 'CHAR', $query->get_cast_for_type( 'DECIMAL( 10)' ) );
- $this->assertEquals( 'CHAR', $query->get_cast_for_type( 'DECIMAL(10 )' ) );
- $this->assertEquals( 'DECIMAL(10, 5)', $query->get_cast_for_type( 'DECIMAL(10, 5)' ) );
- $this->assertEquals( 'DECIMAL(10,5)', $query->get_cast_for_type( 'DECIMAL(10,5)' ) );
- $this->assertEquals( 'CHAR', $query->get_cast_for_type( 'DECIMAL(10, 5)' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'BINARY', $query->get_cast_for_type( 'BINARY' ) );
+ $this->assertSame( 'CHAR', $query->get_cast_for_type( 'CHAR' ) );
+ $this->assertSame( 'DATE', $query->get_cast_for_type( 'DATE' ) );
+ $this->assertSame( 'DATETIME', $query->get_cast_for_type( 'DATETIME' ) );
+ $this->assertSame( 'SIGNED', $query->get_cast_for_type( 'SIGNED' ) );
+ $this->assertSame( 'UNSIGNED', $query->get_cast_for_type( 'UNSIGNED' ) );
+ $this->assertSame( 'TIME', $query->get_cast_for_type( 'TIME' ) );
+ $this->assertSame( 'SIGNED', $query->get_cast_for_type( 'NUMERIC' ) );
+ $this->assertSame( 'NUMERIC(10)', $query->get_cast_for_type( 'NUMERIC(10)' ) );
+ $this->assertSame( 'CHAR', $query->get_cast_for_type( 'NUMERIC( 10)' ) );
+ $this->assertSame( 'CHAR', $query->get_cast_for_type( 'NUMERIC( 10 )' ) );
+ $this->assertSame( 'NUMERIC(10, 5)', $query->get_cast_for_type( 'NUMERIC(10, 5)' ) );
+ $this->assertSame( 'CHAR', $query->get_cast_for_type( 'NUMERIC(10, 5)' ) );
+ $this->assertSame( 'NUMERIC(10,5)', $query->get_cast_for_type( 'NUMERIC(10,5)' ) );
+ $this->assertSame( 'CHAR', $query->get_cast_for_type( 'NUMERIC( 10, 5 )' ) );
+ $this->assertSame( 'CHAR', $query->get_cast_for_type( 'NUMERIC(10, 5 )' ) );
+ $this->assertSame( 'DECIMAL', $query->get_cast_for_type( 'DECIMAL' ) );
+ $this->assertSame( 'DECIMAL(10)', $query->get_cast_for_type( 'DECIMAL(10)' ) );
+ $this->assertSame( 'CHAR', $query->get_cast_for_type( 'DECIMAL( 10 )' ) );
+ $this->assertSame( 'CHAR', $query->get_cast_for_type( 'DECIMAL( 10)' ) );
+ $this->assertSame( 'CHAR', $query->get_cast_for_type( 'DECIMAL(10 )' ) );
+ $this->assertSame( 'DECIMAL(10, 5)', $query->get_cast_for_type( 'DECIMAL(10, 5)' ) );
+ $this->assertSame( 'DECIMAL(10,5)', $query->get_cast_for_type( 'DECIMAL(10,5)' ) );
+ $this->assertSame( 'CHAR', $query->get_cast_for_type( 'DECIMAL(10, 5)' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'CHAR', $query->get_cast_for_type() );
- $this->assertEquals( 'CHAR', $query->get_cast_for_type( 'ANYTHING ELSE' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'CHAR', $query->get_cast_for_type() );
+ $this->assertSame( 'CHAR', $query->get_cast_for_type( 'ANYTHING ELSE' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_sanitize_query_single_query() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'OR',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'OR',
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $q = new WP_Meta_Query();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -274,12 +274,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_sanitize_query_multiple_first_order_queries_relation_default() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'AND',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -288,6 +287,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo2',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar2',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'AND',
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $q = new WP_Meta_Query();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -304,12 +304,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_sanitize_query_multiple_first_order_queries_relation_or() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'OR',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -318,12 +317,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo2',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar2',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'OR',
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $q = new WP_Meta_Query();
</span><span class="cx" style="display: block; padding: 0 10px"> $found = $q->sanitize_query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'OR',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -332,15 +331,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo2',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar2',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'OR',
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_sanitize_query_multiple_first_order_queries_relation_or_lowercase() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'OR',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -349,12 +348,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo2',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar2',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'OR',
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $q = new WP_Meta_Query();
</span><span class="cx" style="display: block; padding: 0 10px"> $found = $q->sanitize_query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'or',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -363,15 +362,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo2',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar2',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'or',
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_sanitize_query_multiple_first_order_queries_invalid_relation() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'AND',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -380,12 +379,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo2',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar2',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'AND',
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $q = new WP_Meta_Query();
</span><span class="cx" style="display: block; padding: 0 10px"> $found = $q->sanitize_query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'FOO',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -394,17 +393,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo2',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar2',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'FOO',
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_sanitize_query_single_query_which_is_a_nested_query() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'OR',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'AND',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -413,7 +411,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo2',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar2',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'AND',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'OR',
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $q = new WP_Meta_Query();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -432,14 +432,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_sanitize_query_multiple_nested_queries() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'OR',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'AND',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -448,9 +446,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo2',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar2',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'AND',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'AND',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo3',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar3',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -459,13 +457,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo4',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar4',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'AND',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'OR',
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $q = new WP_Meta_Query();
</span><span class="cx" style="display: block; padding: 0 10px"> $found = $q->sanitize_query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'OR',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -486,10 +485,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar4',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'OR',
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -528,7 +528,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $sql = $query->get_sql( 'post', $wpdb->posts, 'ID', $this );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, substr_count( $sql['join'], 'JOIN' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, substr_count( $sql['join'], 'JOIN' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -548,7 +548,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $sql = $query->get_sql( 'post', $wpdb->posts, 'ID', $this );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, substr_count( $sql['where'], "$wpdb->postmeta.meta_value = ''" ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, substr_count( $sql['where'], "$wpdb->postmeta.meta_value = ''" ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -560,8 +560,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $query1 = new WP_Meta_Query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'OR',
-
</del><span class="cx" style="display: block; padding: 0 10px"> // Empty 'compare'.
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -589,6 +587,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ 'relation' => 'OR',
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -604,8 +604,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // 'AND' queries don't have key-only queries.
</span><span class="cx" style="display: block; padding: 0 10px"> $query2 = new WP_Meta_Query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'AND',
-
</del><span class="cx" style="display: block; padding: 0 10px"> // Empty 'compare'.
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -616,6 +614,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'bar',
</span><span class="cx" style="display: block; padding: 0 10px"> 'compare' => '<',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ 'relation' => 'AND',
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -887,7 +887,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $query = new WP_Meta_Query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'OR',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'exclude',
</span><span class="cx" style="display: block; padding: 0 10px"> 'compare' => 'NOT EXISTS',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -897,6 +896,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'compare' => '!=',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => '1',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'OR',
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -910,7 +910,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $query = new WP_Meta_Query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'OR',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'exclude',
</span><span class="cx" style="display: block; padding: 0 10px"> 'compare' => '',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -920,6 +919,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'compare' => '!=',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => '1',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'OR',
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -936,7 +936,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_has_or_relation_should_return_false() {
</span><span class="cx" style="display: block; padding: 0 10px"> $q = new WP_Meta_Query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'AND',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -952,6 +951,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'AND',
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -964,7 +964,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_has_or_relation_should_return_true_for_top_level_or() {
</span><span class="cx" style="display: block; padding: 0 10px"> $q = new WP_Meta_Query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'OR',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -980,6 +979,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'OR',
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -992,7 +992,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_has_or_relation_should_return_true_for_nested_or() {
</span><span class="cx" style="display: block; padding: 0 10px"> $q = new WP_Meta_Query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'relation' => 'AND',
</del><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1008,6 +1007,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'value' => 'bar',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'relation' => 'AND',
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsmetaregisterMetaphp"></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/meta/registerMeta.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/meta/registerMeta.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/meta/registerMeta.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,7 +45,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'auth_post_meta_flight_number', array( $this, '_old_auth_meta_cb' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The filter should have been added with a priority of 10.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, $has_filter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, $has_filter );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_register_meta_back_compat_with_sanitize_callback_and_no_auth_callback_has_old_style_sanitize_filter() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -53,7 +53,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $has_filter = has_filter( 'sanitize_post_meta_flight_number', array( $this, '_old_sanitize_meta_cb' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'sanitize_post_meta_flight_number', array( $this, '_old_sanitize_meta_cb' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, $has_filter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, $has_filter );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_register_meta_back_compat_with_auth_and_sanitize_callback_has_old_style_filters() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,7 +64,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'auth_post_meta_flight_number', array( $this, '_old_auth_meta_cb' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'sanitize_post_meta_flight_number', array( $this, '_old_sanitize_meta_cb' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'auth' => 10,
</span><span class="cx" style="display: block; padding: 0 10px"> 'sanitize' => 10,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -102,7 +102,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_register_meta_with_term_object_type_populates_wp_meta_keys() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -126,7 +126,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_register_meta_with_deprecated_sanitize_callback_does_not_populate_wp_meta_keys() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,7 +137,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'sanitize_post_meta_flight_number', array( $this, '_old_sanitize_meta_cb' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'auth_post_meta_flight_number', '__return_true' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_register_meta_with_deprecated_sanitize_callback_param_returns_false() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -156,7 +156,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'sanitize_post_meta_flight_number', array( $this, '_old_sanitize_meta_cb' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'auth_post_meta_flight_number', '__return_true' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'old_sanitized_key old sanitized', $meta );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'old_sanitized_key old sanitized', $meta );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_register_meta_with_current_sanitize_callback_populates_wp_meta_keys() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -179,7 +179,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $actual, $expected );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $actual, $expected );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_register_meta_with_current_sanitize_callback_returns_true() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -195,7 +195,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unregister_meta_key( 'post', 'new_sanitized_key' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'new_sanitized_key new sanitized', $meta );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'new_sanitized_key new sanitized', $meta );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_register_meta_unregistered_meta_key_removes_sanitize_filter() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -221,7 +221,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> register_meta( 'post', 'registered_key', array() );
</span><span class="cx" style="display: block; padding: 0 10px"> unregister_meta_key( 'post', 'registered_key' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $wp_meta_keys );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $wp_meta_keys );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_unregister_meta_key_with_invalid_key_returns_false() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -260,7 +260,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unregister_meta_key( 'post', 'registered_key1' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'I\'m just a field, take a good look at me', $meta_keys['registered_key1']['description'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'I\'m just a field, take a good look at me', $meta_keys['registered_key1']['description'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_registered_meta_keys_invalid_arg() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -281,7 +281,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unregister_meta_key( 'post', 'flight_number' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Oceanic 815', $meta['flight_number'][0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Oceanic 815', $meta['flight_number'][0] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_registered_metadata_by_key() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -292,7 +292,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unregister_meta_key( 'post', 'flight_number' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Oceanic 815', $meta[0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Oceanic 815', $meta[0] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_registered_metadata_by_key_single() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -303,7 +303,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unregister_meta_key( 'post', 'flight_number' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Oceanic 815', $meta );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Oceanic 815', $meta );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_registered_metadata_by_invalid_key() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -352,7 +352,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Reset global so subsequent data tests do not get polluted.
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_meta_keys = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -405,7 +405,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Reset global so subsequent data tests do not get polluted.
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_meta_keys = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsmetaslashesphp"></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/meta/slashes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/meta/slashes.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/meta/slashes.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,10 +71,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> edit_post();
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->slash_6, get_post_meta( $id, 'slash_test_0', true ) );
- $this->assertEquals( $this->slash_1, get_post_meta( $id, 'slash_test_1', true ) );
- $this->assertEquals( $this->slash_3, get_post_meta( $id, 'slash_test_2', true ) );
- $this->assertEquals( $this->slash_4, get_post_meta( $id, 'slash_test_3', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->slash_6, get_post_meta( $id, 'slash_test_0', true ) );
+ $this->assertSame( $this->slash_1, get_post_meta( $id, 'slash_test_1', true ) );
+ $this->assertSame( $this->slash_3, get_post_meta( $id, 'slash_test_2', true ) );
+ $this->assertSame( $this->slash_4, get_post_meta( $id, 'slash_test_3', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['post_ID'] = $id;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -101,9 +101,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> edit_post();
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->slash_2, get_post_meta( $id, 'slash_test_1', true ) );
- $this->assertEquals( $this->slash_4, get_post_meta( $id, 'slash_test_2', true ) );
- $this->assertEquals( $this->slash_5, get_post_meta( $id, 'slash_test_3', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->slash_2, get_post_meta( $id, 'slash_test_1', true ) );
+ $this->assertSame( $this->slash_4, get_post_meta( $id, 'slash_test_2', true ) );
+ $this->assertSame( $this->slash_5, get_post_meta( $id, 'slash_test_3', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -115,9 +115,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_post_meta( $id, 'slash_test_2', addslashes( $this->slash_3 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> add_post_meta( $id, 'slash_test_3', addslashes( $this->slash_4 ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->slash_1, get_post_meta( $id, 'slash_test_1', true ) );
- $this->assertEquals( $this->slash_3, get_post_meta( $id, 'slash_test_2', true ) );
- $this->assertEquals( $this->slash_4, get_post_meta( $id, 'slash_test_3', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->slash_1, get_post_meta( $id, 'slash_test_1', true ) );
+ $this->assertSame( $this->slash_3, get_post_meta( $id, 'slash_test_2', true ) );
+ $this->assertSame( $this->slash_4, get_post_meta( $id, 'slash_test_3', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -129,9 +129,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( $id, 'slash_test_2', addslashes( $this->slash_3 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( $id, 'slash_test_3', addslashes( $this->slash_4 ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->slash_1, get_post_meta( $id, 'slash_test_1', true ) );
- $this->assertEquals( $this->slash_3, get_post_meta( $id, 'slash_test_2', true ) );
- $this->assertEquals( $this->slash_4, get_post_meta( $id, 'slash_test_3', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->slash_1, get_post_meta( $id, 'slash_test_1', true ) );
+ $this->assertSame( $this->slash_3, get_post_meta( $id, 'slash_test_2', true ) );
+ $this->assertSame( $this->slash_4, get_post_meta( $id, 'slash_test_3', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -144,17 +144,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_comment_meta( $id, 'slash_test_2', $this->slash_3 );
</span><span class="cx" style="display: block; padding: 0 10px"> add_comment_meta( $id, 'slash_test_3', $this->slash_5 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_1 ), get_comment_meta( $id, 'slash_test_1', true ) );
- $this->assertEquals( wp_unslash( $this->slash_3 ), get_comment_meta( $id, 'slash_test_2', true ) );
- $this->assertEquals( wp_unslash( $this->slash_5 ), get_comment_meta( $id, 'slash_test_3', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_1 ), get_comment_meta( $id, 'slash_test_1', true ) );
+ $this->assertSame( wp_unslash( $this->slash_3 ), get_comment_meta( $id, 'slash_test_2', true ) );
+ $this->assertSame( wp_unslash( $this->slash_5 ), get_comment_meta( $id, 'slash_test_3', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_comment_meta( $id, 'slash_test_4', $this->slash_2 );
</span><span class="cx" style="display: block; padding: 0 10px"> add_comment_meta( $id, 'slash_test_5', $this->slash_4 );
</span><span class="cx" style="display: block; padding: 0 10px"> add_comment_meta( $id, 'slash_test_6', $this->slash_6 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_2 ), get_comment_meta( $id, 'slash_test_4', true ) );
- $this->assertEquals( wp_unslash( $this->slash_4 ), get_comment_meta( $id, 'slash_test_5', true ) );
- $this->assertEquals( wp_unslash( $this->slash_6 ), get_comment_meta( $id, 'slash_test_6', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_2 ), get_comment_meta( $id, 'slash_test_4', true ) );
+ $this->assertSame( wp_unslash( $this->slash_4 ), get_comment_meta( $id, 'slash_test_5', true ) );
+ $this->assertSame( wp_unslash( $this->slash_6 ), get_comment_meta( $id, 'slash_test_6', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -171,17 +171,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_comment_meta( $id, 'slash_test_2', $this->slash_3 );
</span><span class="cx" style="display: block; padding: 0 10px"> update_comment_meta( $id, 'slash_test_3', $this->slash_5 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_1 ), get_comment_meta( $id, 'slash_test_1', true ) );
- $this->assertEquals( wp_unslash( $this->slash_3 ), get_comment_meta( $id, 'slash_test_2', true ) );
- $this->assertEquals( wp_unslash( $this->slash_5 ), get_comment_meta( $id, 'slash_test_3', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_1 ), get_comment_meta( $id, 'slash_test_1', true ) );
+ $this->assertSame( wp_unslash( $this->slash_3 ), get_comment_meta( $id, 'slash_test_2', true ) );
+ $this->assertSame( wp_unslash( $this->slash_5 ), get_comment_meta( $id, 'slash_test_3', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_comment_meta( $id, 'slash_test_1', $this->slash_2 );
</span><span class="cx" style="display: block; padding: 0 10px"> update_comment_meta( $id, 'slash_test_2', $this->slash_4 );
</span><span class="cx" style="display: block; padding: 0 10px"> update_comment_meta( $id, 'slash_test_3', $this->slash_6 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_2 ), get_comment_meta( $id, 'slash_test_1', true ) );
- $this->assertEquals( wp_unslash( $this->slash_4 ), get_comment_meta( $id, 'slash_test_2', true ) );
- $this->assertEquals( wp_unslash( $this->slash_6 ), get_comment_meta( $id, 'slash_test_3', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_2 ), get_comment_meta( $id, 'slash_test_1', true ) );
+ $this->assertSame( wp_unslash( $this->slash_4 ), get_comment_meta( $id, 'slash_test_2', true ) );
+ $this->assertSame( wp_unslash( $this->slash_6 ), get_comment_meta( $id, 'slash_test_3', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -194,17 +194,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_user_meta( $id, 'slash_test_2', $this->slash_3 );
</span><span class="cx" style="display: block; padding: 0 10px"> add_user_meta( $id, 'slash_test_3', $this->slash_5 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_1 ), get_user_meta( $id, 'slash_test_1', true ) );
- $this->assertEquals( wp_unslash( $this->slash_3 ), get_user_meta( $id, 'slash_test_2', true ) );
- $this->assertEquals( wp_unslash( $this->slash_5 ), get_user_meta( $id, 'slash_test_3', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_1 ), get_user_meta( $id, 'slash_test_1', true ) );
+ $this->assertSame( wp_unslash( $this->slash_3 ), get_user_meta( $id, 'slash_test_2', true ) );
+ $this->assertSame( wp_unslash( $this->slash_5 ), get_user_meta( $id, 'slash_test_3', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_user_meta( $id, 'slash_test_4', $this->slash_2 );
</span><span class="cx" style="display: block; padding: 0 10px"> add_user_meta( $id, 'slash_test_5', $this->slash_4 );
</span><span class="cx" style="display: block; padding: 0 10px"> add_user_meta( $id, 'slash_test_6', $this->slash_6 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_2 ), get_user_meta( $id, 'slash_test_4', true ) );
- $this->assertEquals( wp_unslash( $this->slash_4 ), get_user_meta( $id, 'slash_test_5', true ) );
- $this->assertEquals( wp_unslash( $this->slash_6 ), get_user_meta( $id, 'slash_test_6', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_2 ), get_user_meta( $id, 'slash_test_4', true ) );
+ $this->assertSame( wp_unslash( $this->slash_4 ), get_user_meta( $id, 'slash_test_5', true ) );
+ $this->assertSame( wp_unslash( $this->slash_6 ), get_user_meta( $id, 'slash_test_6', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -221,16 +221,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_user_meta( $id, 'slash_test_2', $this->slash_3 );
</span><span class="cx" style="display: block; padding: 0 10px"> update_user_meta( $id, 'slash_test_3', $this->slash_5 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_1 ), get_user_meta( $id, 'slash_test_1', true ) );
- $this->assertEquals( wp_unslash( $this->slash_3 ), get_user_meta( $id, 'slash_test_2', true ) );
- $this->assertEquals( wp_unslash( $this->slash_5 ), get_user_meta( $id, 'slash_test_3', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_1 ), get_user_meta( $id, 'slash_test_1', true ) );
+ $this->assertSame( wp_unslash( $this->slash_3 ), get_user_meta( $id, 'slash_test_2', true ) );
+ $this->assertSame( wp_unslash( $this->slash_5 ), get_user_meta( $id, 'slash_test_3', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_user_meta( $id, 'slash_test_1', $this->slash_2 );
</span><span class="cx" style="display: block; padding: 0 10px"> update_user_meta( $id, 'slash_test_2', $this->slash_4 );
</span><span class="cx" style="display: block; padding: 0 10px"> update_user_meta( $id, 'slash_test_3', $this->slash_6 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_2 ), get_user_meta( $id, 'slash_test_1', true ) );
- $this->assertEquals( wp_unslash( $this->slash_4 ), get_user_meta( $id, 'slash_test_2', true ) );
- $this->assertEquals( wp_unslash( $this->slash_6 ), get_user_meta( $id, 'slash_test_3', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_2 ), get_user_meta( $id, 'slash_test_1', true ) );
+ $this->assertSame( wp_unslash( $this->slash_4 ), get_user_meta( $id, 'slash_test_2', true ) );
+ $this->assertSame( wp_unslash( $this->slash_6 ), get_user_meta( $id, 'slash_test_3', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsmetaphp"></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/meta.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/meta.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/meta.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -19,11 +19,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_sanitize_meta() {
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = sanitize_meta( 'some_meta', 'unsanitized', 'post' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'unsanitized', $meta );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'unsanitized', $meta );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> register_meta( 'post', 'some_meta', array( $this, '_meta_sanitize_cb' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = sanitize_meta( 'some_meta', 'unsanitized', 'post' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'sanitized', $meta );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'sanitized', $meta );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_delete_metadata_by_mid() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,23 +48,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Update the meta value.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( update_metadata_by_mid( 'user', $this->meta_id, 'meta_new_value' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_metadata_by_mid( 'user', $this->meta_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'meta_new_value', $meta->meta_value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'meta_new_value', $meta->meta_value );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update the meta value.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( update_metadata_by_mid( 'user', $this->meta_id, 'meta_new_value', 'meta_new_key' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_metadata_by_mid( 'user', $this->meta_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'meta_new_key', $meta->meta_key );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'meta_new_key', $meta->meta_key );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update the key and value.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( update_metadata_by_mid( 'user', $this->meta_id, 'meta_value', 'meta_key' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_metadata_by_mid( 'user', $this->meta_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'meta_key', $meta->meta_key );
- $this->assertEquals( 'meta_value', $meta->meta_value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'meta_key', $meta->meta_key );
+ $this->assertSame( 'meta_value', $meta->meta_value );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update the value that has to be serialized.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( update_metadata_by_mid( 'user', $this->meta_id, array( 'first', 'second' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_metadata_by_mid( 'user', $this->meta_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'first', 'second' ), $meta->meta_value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'first', 'second' ), $meta->meta_value );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Let's try some invalid meta data.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( update_metadata_by_mid( 'user', 0, 'meta_value' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,13 +137,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $u ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $u ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // User found is not locally defined author (it's the admin).
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $this->author->user_login, $u[0]->user_login );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test EXISTS and NOT EXISTS together, no users should be found.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> 0,
</span><span class="cx" style="display: block; padding: 0 10px"> count(
</span><span class="cx" style="display: block; padding: 0 10px"> get_users(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -163,7 +163,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> 2,
</span><span class="cx" style="display: block; padding: 0 10px"> count(
</span><span class="cx" style="display: block; padding: 0 10px"> get_users(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -181,7 +181,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> delete_metadata( 'user', $this->author->ID, 'meta_key' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> 2,
</span><span class="cx" style="display: block; padding: 0 10px"> count(
</span><span class="cx" style="display: block; padding: 0 10px"> get_users(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -208,13 +208,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( delete_metadata( 'user', $this->author->ID, $key ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( '', get_metadata( 'user', $this->author->ID, $key, true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'int', add_metadata( 'user', $this->author->ID, $key, $value ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_metadata( 'user', $this->author->ID, $key, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_metadata( 'user', $this->author->ID, $key, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( delete_metadata( 'user', $this->author->ID, $key ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( '', get_metadata( 'user', $this->author->ID, $key, true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'int', update_metadata( 'user', $this->author->ID, $key, $value ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_metadata( 'user', $this->author->ID, $key, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_metadata( 'user', $this->author->ID, $key, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( update_metadata( 'user', $this->author->ID, $key, 'blah' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'blah', get_metadata( 'user', $this->author->ID, $key, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'blah', get_metadata( 'user', $this->author->ID, $key, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( delete_metadata( 'user', $this->author->ID, $key ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( '', get_metadata( 'user', $this->author->ID, $key, true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( metadata_exists( 'user', $this->author->ID, $key ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -221,11 +221,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test overslashing.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'int', add_metadata( 'user', $this->author->ID, $key, $value2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected2, get_metadata( 'user', $this->author->ID, $key, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected2, get_metadata( 'user', $this->author->ID, $key, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( delete_metadata( 'user', $this->author->ID, $key ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( '', get_metadata( 'user', $this->author->ID, $key, true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'int', update_metadata( 'user', $this->author->ID, $key, $value2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected2, get_metadata( 'user', $this->author->ID, $key, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected2, get_metadata( 'user', $this->author->ID, $key, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -252,8 +252,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $post_id2, $post_id1 ), $posts->posts );
- $this->assertEquals( 2, substr_count( $posts->request, 'CAST(' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $post_id2, $post_id1 ), $posts->posts );
+ $this->assertSame( 2, substr_count( $posts->request, 'CAST(' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the newer meta_query syntax behaves in a consistent way.
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = new WP_Query(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -273,8 +273,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $post_id2, $post_id1 ), $posts->posts );
- $this->assertEquals( 2, substr_count( $posts->request, 'CAST(' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $post_id2, $post_id1 ), $posts->posts );
+ $this->assertSame( 2, substr_count( $posts->request, 'CAST(' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The legacy `meta_key` value should take precedence.
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = new WP_Query(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -297,8 +297,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $post_id2, $post_id1 ), $posts->posts );
- $this->assertEquals( 2, substr_count( $posts->request, 'CAST(' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $post_id2, $post_id1 ), $posts->posts );
+ $this->assertSame( 2, substr_count( $posts->request, 'CAST(' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_meta_cache_order_asc() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -310,7 +310,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( range( 1, 10 ) as $i ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( $post_id, 'color' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $meta, $colors );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $meta, $colors );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 0 === $i % 2 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_delete( $post_id, 'post_meta' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -399,7 +399,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_metadata( 'user', $this->author->ID, 'foo', $data );
</span><span class="cx" style="display: block; padding: 0 10px"> $found = get_metadata( 'user', $this->author->ID );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $value ), $found['foo'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $value ), $found['foo'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisitebootstrapphp"></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/multisite/bootstrap.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/bootstrap.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/multisite/bootstrap.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,7 +125,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_network_by_path( $expected_key, $domain, $path, $message ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $network = get_network_by_path( $domain, $path );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$network_ids[ $expected_key ], $network->id, $message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$network_ids[ $expected_key ], $network->id, $message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_get_network_by_path() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -161,7 +161,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'network_by_path_segments_count', '__return_zero' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$network_ids[ $expected_key ], $network->id, $message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$network_ids[ $expected_key ], $network->id, $message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_get_network_by_path_with_zero_path_segments() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,7 +186,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $network = get_network_by_path( 'wordpress.org', '/one/b/' );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'network_by_path_segments_count', array( $this, 'filter_network_path_segments' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$network_ids['wordpress.org/one/'], $network->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$network_ids['wordpress.org/one/'], $network->id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function filter_network_path_segments() {
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisitegetBlogDetailsphp"></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/multisite/getBlogDetails.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/getBlogDetails.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/multisite/getBlogDetails.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,7 +125,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $site = get_blog_details( array( 'domain' => 'wordpress.org' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$site_ids['wordpress.org/'], $site->blog_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$site_ids['wordpress.org/'], $site->blog_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_blog_details_with_only_domain_in_fields_subdirectory() {
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisitegetIdFromBlognamephp"></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/multisite/getIdFromBlogname.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/getIdFromBlogname.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/multisite/getIdFromBlogname.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -101,7 +101,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = get_id_from_blogname( 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px"> $current_site = $original_network;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -122,7 +122,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = get_id_from_blogname( 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px"> $current_site = $original_network;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_id_from_blogname_invalid_slug() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -134,7 +134,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = get_id_from_blogname( 'bar' );
</span><span class="cx" style="display: block; padding: 0 10px"> $current_site = $original_network;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( null, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisitegetSitephp"></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/multisite/getSite.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/getSite.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/multisite/getSite.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,7 +45,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $site = get_site();
</span><span class="cx" style="display: block; padding: 0 10px"> restore_current_blog();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$site_ids['wordpress.org/foo/'], $site->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$site_ids['wordpress.org/foo/'], $site->id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisitegetSpaceAllowedphp"></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/multisite/getSpaceAllowed.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/getSpaceAllowed.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/multisite/getSpaceAllowed.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,7 +48,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> delete_option( 'blog_upload_space' );
</span><span class="cx" style="display: block; padding: 0 10px"> delete_site_option( 'blog_upload_space' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 100, get_space_allowed() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 100, get_space_allowed() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,7 +59,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> delete_site_option( 'blog_upload_space' );
</span><span class="cx" style="display: block; padding: 0 10px"> update_site_option( 'blog_upload_space', 200 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, get_space_allowed() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, get_space_allowed() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -73,7 +73,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blog_upload_space', $site_option );
</span><span class="cx" style="display: block; padding: 0 10px"> update_site_option( 'blog_upload_space', $network_option );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_space_allowed() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_space_allowed() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_blog_upload_space() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -108,7 +108,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $space_allowed = get_space_allowed();
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'get_space_allowed', array( $this, '_filter_space_allowed' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 999, $space_allowed );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 999, $space_allowed );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function _filter_space_allowed() {
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisitegetSpaceUsedphp"></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/multisite/getSpaceUsed.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/getSpaceUsed.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/multisite/getSpaceUsed.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,7 +44,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> delete_transient( 'dirsize_cache' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $size, get_space_used() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $size, get_space_used() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $upload_dir = wp_upload_dir();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->remove_added_uploads();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->delete_folders( $upload_dir['basedir'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -79,7 +79,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> delete_transient( 'dirsize_cache' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $space_used, get_space_used() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $space_used, get_space_used() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Switch back to the new site to remove the uploaded file.
</span><span class="cx" style="display: block; padding: 0 10px"> switch_to_blog( $blog_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,7 +92,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_space_used_pre_get_spaced_used_filter() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'pre_get_space_used', array( $this, '_filter_space_used' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 300, get_space_used() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 300, get_space_used() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_get_space_used', array( $this, '_filter_space_used' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisitemsfilesrewritingphp"></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/multisite/ms-files-rewriting.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/ms-files-rewriting.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/multisite/ms-files-rewriting.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,18 +40,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog_id2 = self::factory()->blog->create( array( 'user_id' => $user_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $info = wp_upload_dir();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://' . $site->domain . '/wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['url'] );
- $this->assertEquals( ABSPATH . 'wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['path'] );
- $this->assertEquals( gmstrftime( '/%Y/%m' ), $info['subdir'] );
- $this->assertEquals( '', $info['error'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://' . $site->domain . '/wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['url'] );
+ $this->assertSame( ABSPATH . 'wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['path'] );
+ $this->assertSame( gmstrftime( '/%Y/%m' ), $info['subdir'] );
+ $this->assertFalse( $info['error'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> switch_to_blog( $blog_id2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $info2 = wp_upload_dir();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $info, $info2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'siteurl' ) . '/wp-content/blogs.dir/' . get_current_blog_id() . '/files/' . gmstrftime( '%Y/%m' ), $info2['url'] );
- $this->assertEquals( ABSPATH . 'wp-content/blogs.dir/' . get_current_blog_id() . '/files/' . gmstrftime( '%Y/%m' ), $info2['path'] );
- $this->assertEquals( gmstrftime( '/%Y/%m' ), $info2['subdir'] );
- $this->assertEquals( '', $info2['error'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'siteurl' ) . '/wp-content/blogs.dir/' . get_current_blog_id() . '/files/' . gmstrftime( '%Y/%m' ), $info2['url'] );
+ $this->assertSame( ABSPATH . 'wp-content/blogs.dir/' . get_current_blog_id() . '/files/' . gmstrftime( '%Y/%m' ), $info2['path'] );
+ $this->assertSame( gmstrftime( '/%Y/%m' ), $info2['subdir'] );
+ $this->assertFalse( $info2['error'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> restore_current_blog();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisitenetworkphp"></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/multisite/network.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/network.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/multisite/network.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,7 +76,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * By default, only one network exists and has a network ID of 1.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_main_network_id_default() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, get_main_network_id() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, get_main_network_id() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -86,7 +86,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_main_network_id_two_networks() {
</span><span class="cx" style="display: block; padding: 0 10px"> self::factory()->network->create();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, get_main_network_id() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, get_main_network_id() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -100,7 +100,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $current_site->id = (int) $id;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, get_main_network_id() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, get_main_network_id() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -120,12 +120,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $main_network_id = get_main_network_id();
</span><span class="cx" style="display: block; padding: 0 10px"> $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->site} SET id=1 WHERE id=%d", $temp_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$different_network_id, $main_network_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$different_network_id, $main_network_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_main_network_id_filtered() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'get_main_network_id', array( $this, '_get_main_network_id' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, get_main_network_id() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, get_main_network_id() );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'get_main_network_id', array( $this, '_get_main_network_id' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -159,7 +159,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_network_counts();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $site_count_start + 1, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $site_count_start + 1, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -246,7 +246,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // No change, cache not refreshed.
</span><span class="cx" style="display: block; padding: 0 10px"> $count = get_user_count();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $start_count, $count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $start_count, $count );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_network_counts();
</span><span class="cx" style="display: block; padding: 0 10px"> $start_count = get_user_count();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -268,7 +268,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Local activate, should be invisible for the network.
</span><span class="cx" style="display: block; padding: 0 10px"> activate_plugin( $path ); // Enable the plugin for the current site.
</span><span class="cx" style="display: block; padding: 0 10px"> $active_plugins = wp_get_active_network_plugins();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $active_plugins );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $active_plugins );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'deactivated_plugin', array( $this, '_helper_deactivate_hook' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -275,19 +275,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Activate the plugin sitewide.
</span><span class="cx" style="display: block; padding: 0 10px"> activate_plugin( $path, '', true ); // Enable the plugin for all sites in the network.
</span><span class="cx" style="display: block; padding: 0 10px"> $active_plugins = wp_get_active_network_plugins();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( WP_PLUGIN_DIR . '/hello.php' ), $active_plugins );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( WP_PLUGIN_DIR . '/hello.php' ), $active_plugins );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Deactivate the plugin.
</span><span class="cx" style="display: block; padding: 0 10px"> deactivate_plugins( $path );
</span><span class="cx" style="display: block; padding: 0 10px"> $active_plugins = wp_get_active_network_plugins();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $active_plugins );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $active_plugins );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->plugin_hook_count ); // Testing actions and silent mode.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->plugin_hook_count ); // Testing actions and silent mode.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> activate_plugin( $path, '', true ); // Enable the plugin for all sites in the network.
</span><span class="cx" style="display: block; padding: 0 10px"> deactivate_plugins( $path, true ); // Silent mode.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->plugin_hook_count ); // Testing actions and silent mode.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->plugin_hook_count ); // Testing actions and silent mode.
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -302,13 +302,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> activate_plugin( $path, '', true ); // Enable the plugin for all sites in the network.
</span><span class="cx" style="display: block; padding: 0 10px"> $active_plugins = wp_get_active_network_plugins();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $active_plugins );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $mock->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $mock->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Should do nothing on the second try.
</span><span class="cx" style="display: block; padding: 0 10px"> activate_plugin( $path, '', true ); // Enable the plugin for all sites in the network.
</span><span class="cx" style="display: block; padding: 0 10px"> $active_plugins = wp_get_active_network_plugins();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $active_plugins );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $mock->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $mock->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'activate_' . $path, array( $mock, 'action' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -337,7 +337,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> self::factory()->user->create( array( 'role' => 'administrator' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $count = get_user_count(); // No change, cache not refreshed.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $start_count, $count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $start_count, $count );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_network_counts(); // Magic happens here.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -392,7 +392,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_network_site_counts();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = get_blog_count();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -404,7 +404,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_network_site_counts( self::$different_network_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = get_blog_count( self::$different_network_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -420,7 +420,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_network_user_counts();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = get_user_count();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -436,7 +436,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_network_user_counts( self::$different_network_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = get_user_count( self::$different_network_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -596,7 +596,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wpmu_delete_blog( $site_id, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $original_count + 1, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $original_count + 1, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -632,12 +632,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_network = $this->factory()->network->create_and_get();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Double-check we got the ID of the new network correct.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_network_id, $new_network->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_network_id, $new_network->id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify that if we fetch the network now, it's no longer false.
</span><span class="cx" style="display: block; padding: 0 10px"> $fetched_network = get_network( $new_network_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Network', $fetched_network );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_network_id, $fetched_network->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_network_id, $fetched_network->id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisitenetworkQueryphp"></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/multisite/networkQuery.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/networkQuery.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/multisite/networkQuery.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,7 +70,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $found ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $found ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_network_query_by_network__in_with_order() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -85,7 +85,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $found );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = $q->query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -95,7 +95,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array_reverse( $expected ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array_reverse( $expected ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_network_query_by_network__in_with_single_id() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -138,7 +138,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_network_query_by_network__not_in_with_single_id() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -435,7 +435,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> self::$network_ids['make.wordpress.org/'],
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -462,7 +462,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $number_of_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $number_of_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -491,7 +491,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'count' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $number_of_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $number_of_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -520,7 +520,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'count' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $number_of_queries + 1, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $number_of_queries + 1, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -546,7 +546,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( array( 555 ), $results );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure manually setting total_users doesn't get overwritten.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $q->found_networks );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $q->found_networks );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public static function filter_networks_pre_query( $networks, $query ) {
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisitesitephp"></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/multisite/site.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/site.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/multisite/site.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -91,13 +91,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_switch_restore_blog() {
</span><span class="cx" style="display: block; padding: 0 10px"> global $_wp_switched_stack, $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $_wp_switched_stack );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $_wp_switched_stack );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( ms_is_switched() );
</span><span class="cx" style="display: block; padding: 0 10px"> $current_blog_id = get_current_blog_id();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'integer', $current_blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_set( 'switch-test', $current_blog_id, 'switch-test' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $current_blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $current_blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $blog_id = self::factory()->blog->create();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,31 +104,31 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $cap_key = wp_get_current_user()->cap_key;
</span><span class="cx" style="display: block; padding: 0 10px"> switch_to_blog( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $cap_key, wp_get_current_user()->cap_key );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $current_blog_id ), $_wp_switched_stack );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $current_blog_id ), $_wp_switched_stack );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( ms_is_switched() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $blog_id, $wpdb->blogid );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $blog_id, $wpdb->blogid );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wp_cache_get( 'switch-test', 'switch-test' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_set( 'switch-test', $blog_id, 'switch-test' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> switch_to_blog( $blog_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $current_blog_id, $blog_id ), $_wp_switched_stack );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $current_blog_id, $blog_id ), $_wp_switched_stack );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( ms_is_switched() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $blog_id, $wpdb->blogid );
- $this->assertEquals( $blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $blog_id, $wpdb->blogid );
+ $this->assertSame( $blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> restore_current_blog();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $current_blog_id ), $_wp_switched_stack );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $current_blog_id ), $_wp_switched_stack );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( ms_is_switched() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $blog_id, $wpdb->blogid );
- $this->assertEquals( $blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $blog_id, $wpdb->blogid );
+ $this->assertSame( $blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> restore_current_blog();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $cap_key, wp_get_current_user()->cap_key );
- $this->assertEquals( $current_blog_id, get_current_blog_id() );
- $this->assertEquals( array(), $_wp_switched_stack );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $cap_key, wp_get_current_user()->cap_key );
+ $this->assertSame( $current_blog_id, get_current_blog_id() );
+ $this->assertSame( array(), $_wp_switched_stack );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( ms_is_switched() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $current_blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $current_blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( restore_current_blog() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -153,11 +153,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $details, wp_cache_get( $blog_id . 'short', 'blog-details' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // get_blogaddress_by_name().
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://' . $details->domain . $details->path, get_blogaddress_by_name( trim( $details->path, '/' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://' . $details->domain . $details->path, get_blogaddress_by_name( trim( $details->path, '/' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // These are empty until get_blog_details() is called with $get_all = true.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, wp_cache_get( $blog_id, 'blog-details' ) );
- $this->assertEquals( false, wp_cache_get( $key, 'blog-lookup' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( wp_cache_get( $blog_id, 'blog-details' ) );
+ $this->assertFalse( wp_cache_get( $key, 'blog-lookup' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // $get_all = true, populate the full blog-details cache and the blog slug lookup cache.
</span><span class="cx" style="display: block; padding: 0 10px"> $details = get_blog_details( $blog_id, true );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -189,7 +189,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update the blog count cache to use get_blog_count().
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_network_counts();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, (int) get_blog_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, (int) get_blog_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_site_caches_should_invalidate_when_invalidation_is_not_suspended() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -215,7 +215,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_details = get_site( $site_id );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_suspend_cache_invalidation( $suspend );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $details->path, $new_details->path );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $details->path, $new_details->path );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -230,10 +230,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Delete the site without forcing a table drop.
</span><span class="cx" style="display: block; padding: 0 10px"> wpmu_delete_blog( $blog_id, false );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, wp_cache_get( $blog_id, 'blog-details' ) );
- $this->assertEquals( false, wp_cache_get( $blog_id . 'short', 'blog-details' ) );
- $this->assertEquals( false, wp_cache_get( $key, 'blog-lookup' ) );
- $this->assertEquals( false, wp_cache_get( $key, 'blog-id-cache' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( wp_cache_get( $blog_id, 'blog-details' ) );
+ $this->assertFalse( wp_cache_get( $blog_id . 'short', 'blog-details' ) );
+ $this->assertFalse( wp_cache_get( $key, 'blog-lookup' ) );
+ $this->assertFalse( wp_cache_get( $key, 'blog-id-cache' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -271,10 +271,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Delete the site and force a table drop.
</span><span class="cx" style="display: block; padding: 0 10px"> wpmu_delete_blog( $blog_id, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, wp_cache_get( $blog_id, 'blog-details' ) );
- $this->assertEquals( false, wp_cache_get( $blog_id . 'short', 'blog-details' ) );
- $this->assertEquals( false, wp_cache_get( $key, 'blog-lookup' ) );
- $this->assertEquals( false, wp_cache_get( $key, 'blog-id-cache' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( wp_cache_get( $blog_id, 'blog-details' ) );
+ $this->assertFalse( wp_cache_get( $blog_id . 'short', 'blog-details' ) );
+ $this->assertFalse( wp_cache_get( $key, 'blog-lookup' ) );
+ $this->assertFalse( wp_cache_get( $key, 'blog-id-cache' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -312,10 +312,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Delete the site and force a table drop.
</span><span class="cx" style="display: block; padding: 0 10px"> wpmu_delete_blog( $blog_id, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, wp_cache_get( $blog_id, 'blog-details' ) );
- $this->assertEquals( false, wp_cache_get( $blog_id . 'short', 'blog-details' ) );
- $this->assertEquals( false, wp_cache_get( $key, 'blog-lookup' ) );
- $this->assertEquals( false, wp_cache_get( $key, 'blog-id-cache' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( wp_cache_get( $blog_id, 'blog-details' ) );
+ $this->assertFalse( wp_cache_get( $blog_id . 'short', 'blog-details' ) );
+ $this->assertFalse( wp_cache_get( $key, 'blog-lookup' ) );
+ $this->assertFalse( wp_cache_get( $key, 'blog-id-cache' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -352,7 +352,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update the blog count cache to use get_blog_count().
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_network_counts();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, get_blog_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, get_blog_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -366,7 +366,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update the blog count cache to use get_blog_count().
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_network_counts();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, get_blog_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, get_blog_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -434,7 +434,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> get_blog_details( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // When the cache is primed with an invalid site, the value is set to -1.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( -1, wp_cache_get( $blog_id, 'blog-details' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( -1, wp_cache_get( $blog_id, 'blog-details' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Create a site in the invalid site's place.
</span><span class="cx" style="display: block; padding: 0 10px"> self::factory()->blog->create();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -453,7 +453,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_update_blog_status() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = update_blog_status( 1, 'spam', 0 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -461,7 +461,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_update_blog_status_invalid_status() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = update_blog_status( 1, 'doesnotexist', 'invalid' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid', $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_update_blog_status_make_ham_blog_action() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -475,15 +475,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_status( $blog_id, 'spam', 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0', $blog->spam );
- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0', $blog->spam );
+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The action should not fire if the status of 'spam' stays the same.
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_status( $blog_id, 'spam', 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0', $blog->spam );
- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0', $blog->spam );
+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'make_ham_blog', array( $this, '_action_counter_cb' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -498,15 +498,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_status( $blog_id, 'spam', 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1', $blog->spam );
- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1', $blog->spam );
+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The action should not fire if the status of 'spam' stays the same.
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_status( $blog_id, 'spam', 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1', $blog->spam );
- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1', $blog->spam );
+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'make_spam_blog', array( $this, '_action_counter_cb' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -521,15 +521,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_status( $blog_id, 'archived', 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1', $blog->archived );
- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1', $blog->archived );
+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The action should not fire if the status of 'archived' stays the same.
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_status( $blog_id, 'archived', 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1', $blog->archived );
- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1', $blog->archived );
+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'archive_blog', array( $this, '_action_counter_cb' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -545,14 +545,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_status( $blog_id, 'archived', 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0', $blog->archived );
- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0', $blog->archived );
+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The action should not fire if the status of 'archived' stays the same.
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_status( $blog_id, 'archived', 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0', $blog->archived );
- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0', $blog->archived );
+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'unarchive_blog', array( $this, '_action_counter_cb' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -567,15 +567,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_status( $blog_id, 'deleted', 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1', $blog->deleted );
- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1', $blog->deleted );
+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The action should not fire if the status of 'deleted' stays the same.
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_status( $blog_id, 'deleted', 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1', $blog->deleted );
- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1', $blog->deleted );
+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'make_delete_blog', array( $this, '_action_counter_cb' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -591,15 +591,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_status( $blog_id, 'deleted', 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0', $blog->deleted );
- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0', $blog->deleted );
+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The action should not fire if the status of 'deleted' stays the same.
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_status( $blog_id, 'deleted', 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0', $blog->deleted );
- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0', $blog->deleted );
+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'make_undelete_blog', array( $this, '_action_counter_cb' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -614,15 +614,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_status( $blog_id, 'mature', 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1', $blog->mature );
- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1', $blog->mature );
+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The action should not fire if the status of 'mature' stays the same.
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_status( $blog_id, 'mature', 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1', $blog->mature );
- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1', $blog->mature );
+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'mature_blog', array( $this, '_action_counter_cb' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -638,15 +638,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_status( $blog_id, 'mature', 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0', $blog->mature );
- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0', $blog->mature );
+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The action should not fire if the status of 'mature' stays the same.
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_status( $blog_id, 'mature', 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0', $blog->mature );
- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0', $blog->mature );
+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'unmature_blog', array( $this, '_action_counter_cb' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -661,15 +661,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_status( $blog_id, 'public', 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0', $blog->public );
- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0', $blog->public );
+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The action should not fire if the status of 'mature' stays the same.
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_status( $blog_id, 'public', 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0', $blog->public );
- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0', $blog->public );
+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'update_blog_public', array( $this, '_action_counter_cb' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -680,10 +680,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_posts_count() {
</span><span class="cx" style="display: block; padding: 0 10px"> self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = self::factory()->post->create();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, get_site()->post_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, get_site()->post_count );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_post( $post2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, get_site()->post_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, get_site()->post_count );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -692,11 +692,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_blog_details_cache_invalidation() {
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blogname', 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px"> $details = get_site( get_current_blog_id() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo', $details->blogname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo', $details->blogname );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'blogname', 'bar' );
</span><span class="cx" style="display: block; padding: 0 10px"> $details = get_site( get_current_blog_id() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bar', $details->blogname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bar', $details->blogname );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -709,8 +709,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $key = md5( $details->domain . $details->path );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test the original response and cached response for the newly created site.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $blog_id, get_blog_id_from_url( $details->domain, $details->path ) );
- $this->assertEquals( $blog_id, wp_cache_get( $key, 'blog-id-cache' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $blog_id, get_blog_id_from_url( $details->domain, $details->path ) );
+ $this->assertSame( $blog_id, wp_cache_get( $key, 'blog-id-cache' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -725,7 +725,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $details = get_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $blog_id, get_blog_id_from_url( strtoupper( $details->domain ), strtoupper( $details->path ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $blog_id, get_blog_id_from_url( strtoupper( $details->domain ), strtoupper( $details->path ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -735,8 +735,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $blog_id = self::factory()->blog->create( array( 'path' => '/xyz' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $details = get_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, get_blog_id_from_url( $details->domain, 'foo' ) );
- $this->assertEquals( -1, wp_cache_get( md5( $details->domain . 'foo' ), 'blog-id-cache' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, get_blog_id_from_url( $details->domain, 'foo' ) );
+ $this->assertSame( -1, wp_cache_get( md5( $details->domain . 'foo' ), 'blog-id-cache' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -749,8 +749,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $key = md5( $details->domain . $details->path );
</span><span class="cx" style="display: block; padding: 0 10px"> wpmu_delete_blog( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $blog_id, get_blog_id_from_url( $details->domain, $details->path ) );
- $this->assertEquals( $blog_id, wp_cache_get( $key, 'blog-id-cache' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $blog_id, get_blog_id_from_url( $details->domain, $details->path ) );
+ $this->assertSame( $blog_id, wp_cache_get( $key, 'blog-id-cache' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -763,9 +763,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $key = md5( $details->domain . $details->path );
</span><span class="cx" style="display: block; padding: 0 10px"> wpmu_delete_blog( $blog_id, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, wp_cache_get( $key, 'blog-id-cache' ) );
- $this->assertEquals( 0, get_blog_id_from_url( $details->domain, $details->path ) );
- $this->assertEquals( -1, wp_cache_get( $key, 'blog-id-cache' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( wp_cache_get( $key, 'blog-id-cache' ) );
+ $this->assertSame( 0, get_blog_id_from_url( $details->domain, $details->path ) );
+ $this->assertSame( -1, wp_cache_get( $key, 'blog-id-cache' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -810,26 +810,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $site = get_current_site();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $info = wp_upload_dir();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://' . $site->domain . '/wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['url'] );
- $this->assertEquals( ABSPATH . 'wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['path'] );
- $this->assertEquals( gmstrftime( '/%Y/%m' ), $info['subdir'] );
- $this->assertEquals( '', $info['error'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://' . $site->domain . '/wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['url'] );
+ $this->assertSame( ABSPATH . 'wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['path'] );
+ $this->assertSame( gmstrftime( '/%Y/%m' ), $info['subdir'] );
+ $this->assertFalse( $info['error'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $blog_id = self::factory()->blog->create();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> switch_to_blog( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $info = wp_upload_dir();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://' . $site->domain . '/wp-content/uploads/sites/' . get_current_blog_id() . '/' . gmstrftime( '%Y/%m' ), $info['url'] );
- $this->assertEquals( ABSPATH . 'wp-content/uploads/sites/' . get_current_blog_id() . '/' . gmstrftime( '%Y/%m' ), $info['path'] );
- $this->assertEquals( gmstrftime( '/%Y/%m' ), $info['subdir'] );
- $this->assertEquals( '', $info['error'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://' . $site->domain . '/wp-content/uploads/sites/' . get_current_blog_id() . '/' . gmstrftime( '%Y/%m' ), $info['url'] );
+ $this->assertSame( ABSPATH . 'wp-content/uploads/sites/' . get_current_blog_id() . '/' . gmstrftime( '%Y/%m' ), $info['path'] );
+ $this->assertSame( gmstrftime( '/%Y/%m' ), $info['subdir'] );
+ $this->assertFalse( $info['error'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> restore_current_blog();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $info = wp_upload_dir();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://' . $site->domain . '/wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['url'] );
- $this->assertEquals( ABSPATH . 'wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['path'] );
- $this->assertEquals( gmstrftime( '/%Y/%m' ), $info['subdir'] );
- $this->assertEquals( '', $info['error'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://' . $site->domain . '/wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['url'] );
+ $this->assertSame( ABSPATH . 'wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['path'] );
+ $this->assertSame( gmstrftime( '/%Y/%m' ), $info['subdir'] );
+ $this->assertFalse( $info['error'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -879,13 +879,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_domain_exists_with_default_site_id() {
</span><span class="cx" style="display: block; padding: 0 10px"> $details = get_site( 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, domain_exists( $details->domain, $details->path ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, domain_exists( $details->domain, $details->path ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_domain_exists_with_specified_site_id() {
</span><span class="cx" style="display: block; padding: 0 10px"> $details = get_site( 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, domain_exists( $details->domain, $details->path, $details->site_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, domain_exists( $details->domain, $details->path, $details->site_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -895,11 +895,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_domain_does_not_exist_with_invalid_site_id() {
</span><span class="cx" style="display: block; padding: 0 10px"> $details = get_site( 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( null, domain_exists( $details->domain, $details->path, 999 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( domain_exists( $details->domain, $details->path, 999 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_domain_does_not_exist_with_default_site_id() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( null, domain_exists( 'foo', 'bar' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( domain_exists( 'foo', 'bar' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_domain_filtered_to_exist() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -906,7 +906,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'domain_exists', array( $this, '_domain_exists_cb' ), 10, 4 );
</span><span class="cx" style="display: block; padding: 0 10px"> $exists = domain_exists( 'foo', 'bar' );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'domain_exists', array( $this, '_domain_exists_cb' ), 10, 4 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1234, $exists );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1234, $exists );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -920,7 +920,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'domain_exists', array( $this, '_domain_exists_cb' ), 10, 4 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the same result is returned with or without a trailing slash.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $exists1, $exists2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $exists1, $exists2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -928,7 +928,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_blogaddress_by_id_with_valid_id() {
</span><span class="cx" style="display: block; padding: 0 10px"> $blogaddress = get_blogaddress_by_id( 1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://' . WP_TESTS_DOMAIN . '/', $blogaddress );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://' . WP_TESTS_DOMAIN . '/', $blogaddress );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -936,7 +936,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_blogaddress_by_id_with_invalid_id() {
</span><span class="cx" style="display: block; padding: 0 10px"> $blogaddress = get_blogaddress_by_id( 42 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $blogaddress );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $blogaddress );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1180,7 +1180,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $old_count = did_action( 'clean_site_cache' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> clean_blog_cache( $site );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $old_count + 1, did_action( 'clean_site_cache' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $old_count + 1, did_action( 'clean_site_cache' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1194,7 +1194,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $suspend = wp_suspend_cache_invalidation();
</span><span class="cx" style="display: block; padding: 0 10px"> clean_blog_cache( $site );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_suspend_cache_invalidation( $suspend );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $old_count, did_action( 'clean_site_cache' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $old_count, did_action( 'clean_site_cache' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1204,7 +1204,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $old_count = did_action( 'clean_site_cache' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> clean_blog_cache( null );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $old_count, did_action( 'clean_site_cache' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $old_count, did_action( 'clean_site_cache' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1214,7 +1214,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $old_count = did_action( 'clean_site_cache' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> clean_blog_cache( 'something' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $old_count, did_action( 'clean_site_cache' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $old_count, did_action( 'clean_site_cache' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1443,7 +1443,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( 'last_updated' === $key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $old_site->last_updated <= $value );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $old_site->$key, $value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $old_site->$key, $value );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1540,7 +1540,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = wp_delete_site( $site_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Site', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $result->to_array(), $site->to_array() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $result->to_array(), $site->to_array() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2116,8 +2116,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $initialized );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_options, $options );
- $this->assertEquals( $expected_meta, $meta );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_options, $options );
+ $this->assertSame( $expected_meta, $meta );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_wp_initialize_site() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2214,7 +2214,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $user_is_admin );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_userdata( 1 )->user_email, $admin_email );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_userdata( 1 )->user_email, $admin_email );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2370,8 +2370,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Should not hit blog_details cache initialised in $this->populate_options_callback tirggered during
</span><span class="cx" style="display: block; padding: 0 10px"> // populate_options callback's call of get_blog_details.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://testsite1.example.org/test', get_blog_details( $blog_id )->siteurl );
- $this->assertEquals( 'http://testsite1.example.org/test', get_site( $blog_id )->siteurl );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://testsite1.example.org/test', get_blog_details( $blog_id )->siteurl );
+ $this->assertSame( 'http://testsite1.example.org/test', get_site( $blog_id )->siteurl );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'populate_options', array( $this, 'populate_options_callback' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisitesiteMetaphp"></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/multisite/siteMeta.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/siteMeta.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/multisite/siteMeta.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,13 +186,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_site_meta( self::$site_id, 'unique_delete_by_key', 'value', true );
</span><span class="cx" style="display: block; padding: 0 10px"> add_site_meta( self::$site_id2, 'unique_delete_by_key', 'value', true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'value', get_site_meta( self::$site_id, 'unique_delete_by_key', true ) );
- $this->assertEquals( 'value', get_site_meta( self::$site_id2, 'unique_delete_by_key', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'value', get_site_meta( self::$site_id, 'unique_delete_by_key', true ) );
+ $this->assertSame( 'value', get_site_meta( self::$site_id2, 'unique_delete_by_key', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( delete_site_meta_by_key( 'unique_delete_by_key' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_site_meta( self::$site_id, 'unique_delete_by_key', true ) );
- $this->assertEquals( '', get_site_meta( self::$site_id2, 'unique_delete_by_key', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_site_meta( self::$site_id, 'unique_delete_by_key', true ) );
+ $this->assertSame( '', get_site_meta( self::$site_id2, 'unique_delete_by_key', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_site_meta_should_be_deleted_when_site_is_deleted() {
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisitesiteQueryphp"></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/multisite/siteQuery.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/siteQuery.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/multisite/siteQuery.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -135,7 +135,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $found ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $found ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_site_query_by_site__in_with_single_id() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -181,7 +181,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_site_query_by_site__not_in_with_single_id() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -237,7 +237,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> self::$site_ids['wordpress.org/foo/bar/'],
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $found );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = $q->query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -248,7 +248,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array_reverse( $expected ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array_reverse( $expected ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_site_query_by_network_id_with_existing_sites() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -698,7 +698,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> self::$site_ids['make.wordpress.org/foo/'],
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_site_query_by_search_with_text_in_path_exclude_domain_from_search() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -715,7 +715,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> self::$site_ids['www.w.org/make/'],
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_site_query_by_search_with_text_in_domain_exclude_path_from_search() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -733,7 +733,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> self::$site_ids['make.wordpress.org/foo/'],
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_site_query_by_search_with_wildcard_in_text() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -814,7 +814,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $number_of_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $number_of_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -844,7 +844,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'count' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $number_of_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $number_of_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -874,7 +874,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'count' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $number_of_queries + 1, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $number_of_queries + 1, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -903,7 +903,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $strict ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( $expected, $found );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -933,7 +933,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( array( 555 ), $results );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure manually setting total_users doesn't get overwritten.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $q->found_sites );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $q->found_sites );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public static function filter_sites_pre_query( $sites, $query ) {
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisiteupdateBlogDetailsphp"></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/multisite/updateBlogDetails.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/updateBlogDetails.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/multisite/updateBlogDetails.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,9 +39,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'example.com', $blog->domain );
- $this->assertEquals( '/my_path/', $blog->path );
- $this->assertEquals( '0', $blog->spam );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'example.com', $blog->domain );
+ $this->assertSame( '/my_path/', $blog->path );
+ $this->assertSame( '0', $blog->spam );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,16 +71,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_details( $blog_id, array( $flag => $flag_value ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = get_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $flag_value, $blog->{$flag} );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $flag_value, $blog->{$flag} );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The hook attached to this flag should have fired once during update_blog_details().
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update the site to the exact same flag value for this flag.
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_details( $blog_id, array( $flag => $flag_value ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The hook attached to this flag should not have fired again.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $test_action_counter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $test_action_counter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( $hook, array( $this, '_action_counter_cb' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -116,7 +116,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_blog_details( 1, array( 'path' => $path ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $site = get_site( 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $site->path );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $site->path );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_single_directory_path() {
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisitewpGetSitesphp"></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/multisite/wpGetSites.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/wpGetSites.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/multisite/wpGetSites.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,7 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $missing_keys = array_diff_key( array_flip( $keys ), $sites[0] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $missing_keys, 'Keys are missing from site arrays.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $missing_keys, 'Keys are missing from site arrays.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisitewpInstallDefaultsphp"></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/multisite/wpInstallDefaults.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/wpInstallDefaults.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/multisite/wpInstallDefaults.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,8 +76,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_site( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Some page content', $first_page->post_content );
- $this->assertEquals( 'Some comment content', $first_comment[0]->comment_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Some page content', $first_page->post_content );
+ $this->assertSame( 'Some comment content', $first_comment[0]->comment_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisitephp"></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/multisite.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/multisite.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,7 +32,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Currently there is no wrapper function for the registration_log.
</span><span class="cx" style="display: block; padding: 0 10px"> $reg_blog = $wpdb->get_col( $wpdb->prepare( "SELECT email FROM {$wpdb->registration_log} WHERE {$wpdb->registration_log}.blog_id = 1 AND IP LIKE %s", $ip ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user->user_email, $reg_blog[ count( $reg_blog ) - 1 ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user->user_email, $reg_blog[ count( $reg_blog ) - 1 ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -88,7 +88,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected['all'] += 1;
</span><span class="cx" style="display: block; padding: 0 10px"> $expected['public'] += 1;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $counts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $counts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsoembedWpEmbedphp"></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/oembed/WpEmbed.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/oembed/WpEmbed.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/oembed/WpEmbed.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -109,7 +109,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $content = "\nhttp://example.com/embed/foo\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = $this->wp_embed->autoembed( $content );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $content, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $content, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_autoembed_should_return_modified_content() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -124,7 +124,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = $GLOBALS['wp_embed']->autoembed( $content );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_embed_unregister_handler( $handle );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "\nEmbedded http://example.com/embed/foo\n", $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "\nEmbedded http://example.com/embed/foo\n", $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_oembed_caches() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -136,8 +136,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->wp_embed->delete_oembed_caches( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), get_post_meta( $post_id, '_oembed_foo' ) );
- $this->assertEquals( array(), get_post_meta( $post_id, '_oembed_baz' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), get_post_meta( $post_id, '_oembed_foo' ) );
+ $this->assertSame( array(), get_post_meta( $post_id, '_oembed_baz' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_cache_oembed_invalid_post_type() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -168,7 +168,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_oembed_result', array( $this, '_pre_oembed_result_callback' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $post_id, $this->wp_embed->post_ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_post_meta( $post_id, $cachekey, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_post_meta( $post_id, $cachekey, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( get_post_meta( $post_id, $cachekey_time, true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -194,9 +194,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Cleanup.
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $post );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
- $this->assertEquals( $expected, $actual_2 );
- $this->assertEquals( $expected, $cached );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
+ $this->assertSame( $expected, $actual_2 );
+ $this->assertSame( $expected, $cached );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_shortcode_should_get_cached_failure_from_post_meta_for_known_post() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -225,10 +225,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Cleanup.
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $post );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
- $this->assertEquals( '{{unknown}}', $cached );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
+ $this->assertSame( '{{unknown}}', $cached );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $cached_time );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual_2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual_2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -252,9 +252,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_post( $oembed_post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotNull( $oembed_post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $post_content );
- $this->assertEquals( $expected, $actual );
- $this->assertEquals( $expected, $actual_2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $post_content );
+ $this->assertSame( $expected, $actual );
+ $this->assertSame( $expected, $actual_2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -277,10 +277,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_post( $oembed_post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
- $this->assertEquals( $expected, $actual_2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
+ $this->assertSame( $expected, $actual_2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotNull( $oembed_post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '{{unknown}}', $post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '{{unknown}}', $post_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -321,7 +321,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url = 'http://example.com/embed/foo';
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = $this->wp_embed->shortcode( array( 'src' => $url ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<a href="' . esc_url( $url ) . '">' . esc_html( $url ) . '</a>', $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<a href="' . esc_url( $url ) . '">' . esc_html( $url ) . '</a>', $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_shortcode_should_return_empty_string_for_missing_url() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -332,13 +332,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url = 'http://example.com/embed/foo';
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = $this->wp_embed->shortcode( array(), $url );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<a href="' . esc_url( $url ) . '">' . esc_html( $url ) . '</a>', $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<a href="' . esc_url( $url ) . '">' . esc_html( $url ) . '</a>', $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_run_shortcode_url_only() {
</span><span class="cx" style="display: block; padding: 0 10px"> $url = 'http://example.com/embed/foo';
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = $this->wp_embed->run_shortcode( '[embed]' . $url . '[/embed]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<a href="' . esc_url( $url ) . '">' . esc_html( $url ) . '</a>', $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<a href="' . esc_url( $url ) . '">' . esc_html( $url ) . '</a>', $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_maybe_make_link() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -345,7 +345,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url = 'http://example.com/embed/foo';
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = $this->wp_embed->maybe_make_link( $url );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<a href="' . esc_url( $url ) . '">' . esc_html( $url ) . '</a>', $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<a href="' . esc_url( $url ) . '">' . esc_html( $url ) . '</a>', $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_maybe_make_link_return_false_on_fail() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -357,6 +357,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $url = 'http://example.com/';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->wp_embed->linkifunknown = false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $url, $this->wp_embed->maybe_make_link( $url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $url, $this->wp_embed->maybe_make_link( $url ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsoembedcontrollerphp"></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/oembed/controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/oembed/controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/oembed/controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -175,11 +175,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_oembed_ensure_format() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'json', wp_oembed_ensure_format( 'json' ) );
- $this->assertEquals( 'xml', wp_oembed_ensure_format( 'xml' ) );
- $this->assertEquals( 'json', wp_oembed_ensure_format( 123 ) );
- $this->assertEquals( 'json', wp_oembed_ensure_format( 'random' ) );
- $this->assertEquals( 'json', wp_oembed_ensure_format( array() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'json', wp_oembed_ensure_format( 'json' ) );
+ $this->assertSame( 'xml', wp_oembed_ensure_format( 'xml' ) );
+ $this->assertSame( 'json', wp_oembed_ensure_format( 123 ) );
+ $this->assertSame( 'json', wp_oembed_ensure_format( 'random' ) );
+ $this->assertSame( 'json', wp_oembed_ensure_format( array() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_oembed_create_xml() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -265,7 +265,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'rest_no_route', $data['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'rest_no_route', $data['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_request_without_url_param() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -274,8 +274,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'rest_missing_callback_param', $data['code'] );
- $this->assertEquals( 'url', $data['data']['params'][0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'rest_missing_callback_param', $data['code'] );
+ $this->assertSame( 'url', $data['data']['params'][0] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_request_with_bad_url() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -285,7 +285,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'oembed_invalid_url', $data['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'oembed_invalid_url', $data['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_request_invalid_format() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -334,13 +334,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'type', $data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'width', $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1.0', $data['version'] );
- $this->assertEquals( get_bloginfo( 'name' ), $data['provider_name'] );
- $this->assertEquals( home_url(), $data['provider_url'] );
- $this->assertEquals( $user->display_name, $data['author_name'] );
- $this->assertEquals( get_author_posts_url( $user->ID, $user->user_nicename ), $data['author_url'] );
- $this->assertEquals( $post->post_title, $data['title'] );
- $this->assertEquals( 'rich', $data['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1.0', $data['version'] );
+ $this->assertSame( get_bloginfo( 'name' ), $data['provider_name'] );
+ $this->assertSame( home_url(), $data['provider_url'] );
+ $this->assertSame( $user->display_name, $data['author_name'] );
+ $this->assertSame( get_author_posts_url( $user->ID, $user->user_nicename ), $data['author_url'] );
+ $this->assertSame( $post->post_title, $data['title'] );
+ $this->assertSame( 'rich', $data['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['width'] <= $request['maxwidth'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -377,13 +377,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'type', $data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'width', $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1.0', $data['version'] );
- $this->assertEquals( get_bloginfo( 'name' ), $data['provider_name'] );
- $this->assertEquals( home_url(), $data['provider_url'] );
- $this->assertEquals( get_bloginfo( 'name' ), $data['author_name'] );
- $this->assertEquals( home_url(), $data['author_url'] );
- $this->assertEquals( $post->post_title, $data['title'] );
- $this->assertEquals( 'rich', $data['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1.0', $data['version'] );
+ $this->assertSame( get_bloginfo( 'name' ), $data['provider_name'] );
+ $this->assertSame( home_url(), $data['provider_url'] );
+ $this->assertSame( get_bloginfo( 'name' ), $data['author_name'] );
+ $this->assertSame( home_url(), $data['author_url'] );
+ $this->assertSame( $post->post_title, $data['title'] );
+ $this->assertSame( 'rich', $data['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['width'] <= $request['maxwidth'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'show_on_front', 'posts' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -422,13 +422,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'type', $data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'width', $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1.0', $data['version'] );
- $this->assertEquals( get_bloginfo( 'name' ), $data['provider_name'] );
- $this->assertEquals( home_url(), $data['provider_url'] );
- $this->assertEquals( $user->display_name, $data['author_name'] );
- $this->assertEquals( get_author_posts_url( $user->ID, $user->user_nicename ), $data['author_url'] );
- $this->assertEquals( $post->post_title, $data['title'] );
- $this->assertEquals( 'rich', $data['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1.0', $data['version'] );
+ $this->assertSame( get_bloginfo( 'name' ), $data['provider_name'] );
+ $this->assertSame( home_url(), $data['provider_url'] );
+ $this->assertSame( $user->display_name, $data['author_name'] );
+ $this->assertSame( get_author_posts_url( $user->ID, $user->user_nicename ), $data['author_url'] );
+ $this->assertSame( $post->post_title, $data['title'] );
+ $this->assertSame( 'rich', $data['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['width'] <= $request['maxwidth'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -508,30 +508,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_oembed_endpoint_url() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( home_url() . '/index.php?rest_route=/oembed/1.0/embed', get_oembed_endpoint_url() );
- $this->assertEquals( home_url() . '/index.php?rest_route=/oembed/1.0/embed', get_oembed_endpoint_url( '', 'json' ) );
- $this->assertEquals( home_url() . '/index.php?rest_route=/oembed/1.0/embed', get_oembed_endpoint_url( '', 'xml' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( home_url() . '/index.php?rest_route=/oembed/1.0/embed', get_oembed_endpoint_url() );
+ $this->assertSame( home_url() . '/index.php?rest_route=/oembed/1.0/embed', get_oembed_endpoint_url( '', 'json' ) );
+ $this->assertSame( home_url() . '/index.php?rest_route=/oembed/1.0/embed', get_oembed_endpoint_url( '', 'xml' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = $this->factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_permalink( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $url_encoded = urlencode( $url );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( home_url() . '/index.php?rest_route=%2Foembed%2F1.0%2Fembed&url=' . $url_encoded, get_oembed_endpoint_url( $url ) );
- $this->assertEquals( home_url() . '/index.php?rest_route=%2Foembed%2F1.0%2Fembed&url=' . $url_encoded . '&format=xml', get_oembed_endpoint_url( $url, 'xml' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( home_url() . '/index.php?rest_route=%2Foembed%2F1.0%2Fembed&url=' . $url_encoded, get_oembed_endpoint_url( $url ) );
+ $this->assertSame( home_url() . '/index.php?rest_route=%2Foembed%2F1.0%2Fembed&url=' . $url_encoded . '&format=xml', get_oembed_endpoint_url( $url, 'xml' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_oembed_endpoint_url_pretty_permalinks() {
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'permalink_structure', '/%postname%' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( home_url() . '/wp-json/oembed/1.0/embed', get_oembed_endpoint_url() );
- $this->assertEquals( home_url() . '/wp-json/oembed/1.0/embed', get_oembed_endpoint_url( '', 'xml' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( home_url() . '/wp-json/oembed/1.0/embed', get_oembed_endpoint_url() );
+ $this->assertSame( home_url() . '/wp-json/oembed/1.0/embed', get_oembed_endpoint_url( '', 'xml' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = $this->factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_permalink( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $url_encoded = urlencode( $url );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( home_url() . '/wp-json/oembed/1.0/embed?url=' . $url_encoded, get_oembed_endpoint_url( $url ) );
- $this->assertEquals( home_url() . '/wp-json/oembed/1.0/embed?url=' . $url_encoded . '&format=xml', get_oembed_endpoint_url( $url, 'xml' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( home_url() . '/wp-json/oembed/1.0/embed?url=' . $url_encoded, get_oembed_endpoint_url( $url ) );
+ $this->assertSame( home_url() . '/wp-json/oembed/1.0/embed?url=' . $url_encoded . '&format=xml', get_oembed_endpoint_url( $url, 'xml' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'permalink_structure', '' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -541,7 +541,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/oembed/1.0/proxy' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 400, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 400, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test with a user that does not have edit_posts capability.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$subscriber );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -549,9 +549,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'url', self::INVALID_OEMBED_URL );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $data['code'], 'rest_forbidden' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $data['code'], 'rest_forbidden' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_proxy_with_invalid_oembed_provider() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -559,9 +559,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/oembed/1.0/proxy' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'url', self::INVALID_OEMBED_URL );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'oembed_invalid_url', $data['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'oembed_invalid_url', $data['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_proxy_with_invalid_type() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -570,7 +570,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'type', 'xml' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 400, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 400, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_proxy_with_valid_oembed_provider() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -581,12 +581,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'maxheight', 789 );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( '_wpnonce', wp_create_nonce( 'wp_rest' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( 1, $this->request_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( 1, $this->request_count );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Subsequent request is cached and so it should not cause a request.
</span><span class="cx" style="display: block; padding: 0 10px"> rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->request_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->request_count );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Rest with another user should also be cached.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$administrator );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -596,7 +596,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'maxwidth', 456 );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'maxheight', 789 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->request_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->request_count );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test data object.
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -603,8 +603,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'object', $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'YouTube', $data->provider_name );
- $this->assertEquals( 'https://i.ytimg.com/vi/' . self::YOUTUBE_VIDEO_ID . '/hqdefault.jpg', $data->thumbnail_url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'YouTube', $data->provider_name );
+ $this->assertSame( 'https://i.ytimg.com/vi/' . self::YOUTUBE_VIDEO_ID . '/hqdefault.jpg', $data->thumbnail_url );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $data->width, $request['maxwidth'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $data->height, $request['maxheight'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -622,8 +622,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'maxheight', 789 );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( '_wpnonce', wp_create_nonce( 'wp_rest' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( 2, $this->request_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( 2, $this->request_count );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test data object.
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -642,8 +642,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'url', self::INVALID_OEMBED_URL );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'discover', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
- $this->assertEquals( 0, $this->request_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
+ $this->assertSame( 0, $this->request_count );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_proxy_with_invalid_oembed_provider_with_default_discover_param() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -653,8 +653,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/oembed/1.0/proxy' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'url', self::INVALID_OEMBED_URL );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
- $this->assertEquals( 1, $this->request_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
+ $this->assertSame( 1, $this->request_count );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_proxy_with_invalid_discover_param() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -665,9 +665,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 400, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 400, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $data['code'], 'rest_invalid_param' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $data['code'], 'rest_invalid_param' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -708,13 +708,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'type', $data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'width', $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1.0', $data['version'] );
- $this->assertEquals( get_bloginfo( 'name' ), $data['provider_name'] );
- $this->assertEquals( home_url(), $data['provider_url'] );
- $this->assertEquals( $user->display_name, $data['author_name'] );
- $this->assertEquals( get_author_posts_url( $user->ID, $user->user_nicename ), $data['author_url'] );
- $this->assertEquals( $post->post_title, $data['title'] );
- $this->assertEquals( 'rich', $data['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1.0', $data['version'] );
+ $this->assertSame( get_bloginfo( 'name' ), $data['provider_name'] );
+ $this->assertSame( home_url(), $data['provider_url'] );
+ $this->assertSame( $user->display_name, $data['author_name'] );
+ $this->assertSame( get_author_posts_url( $user->ID, $user->user_nicename ), $data['author_url'] );
+ $this->assertSame( $post->post_title, $data['title'] );
+ $this->assertSame( 'rich', $data['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['width'] <= $request['maxwidth'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -757,13 +757,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'type', $data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'width', $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1.0', $data['version'] );
- $this->assertEquals( get_bloginfo( 'name' ), $data['provider_name'] );
- $this->assertEquals( home_url(), $data['provider_url'] );
- $this->assertEquals( get_bloginfo( 'name' ), $data['author_name'] );
- $this->assertEquals( home_url(), $data['author_url'] );
- $this->assertEquals( $post->post_title, $data['title'] );
- $this->assertEquals( 'rich', $data['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1.0', $data['version'] );
+ $this->assertSame( get_bloginfo( 'name' ), $data['provider_name'] );
+ $this->assertSame( home_url(), $data['provider_url'] );
+ $this->assertSame( get_bloginfo( 'name' ), $data['author_name'] );
+ $this->assertSame( home_url(), $data['author_url'] );
+ $this->assertSame( $post->post_title, $data['title'] );
+ $this->assertSame( 'rich', $data['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['width'] <= $request['maxwidth'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'show_on_front', 'posts' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -784,11 +784,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->oembed_result_filter_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->oembed_result_filter_count );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'object', $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Untrusted', $data->provider_name );
- $this->assertEquals( self::UNTRUSTED_PROVIDER_URL, $data->provider_url );
- $this->assertEquals( 'rich', $data->type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Untrusted', $data->provider_name );
+ $this->assertSame( self::UNTRUSTED_PROVIDER_URL, $data->provider_url );
+ $this->assertSame( 'rich', $data->type );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $data->html );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -807,7 +807,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->oembed_result_filter_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->oembed_result_filter_count );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'object', $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringStartsWith( '<b>Unfiltered</b>', $data->html );
</span></span></pre></div>
<a id="trunktestsphpunittestsoembeddiscoveryphp"></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/oembed/discovery.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/oembed/discovery.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/oembed/discovery.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,7 +48,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_oembed_add_discovery_links' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_oembed_add_discovery_links' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_add_oembed_discovery_links_to_page() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,7 +63,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_oembed_add_discovery_links' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_oembed_add_discovery_links' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_add_oembed_discovery_links_to_attachment() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,6 +83,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_echo( 'wp_oembed_add_discovery_links' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_echo( 'wp_oembed_add_discovery_links' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsoembedfilterResultphp"></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/oembed/filterResult.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/oembed/filterResult.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/oembed/filterResult.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,7 +9,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $html, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $html, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_filter_oembed_result_with_untrusted_provider() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,7 +21,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $matches[1] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $matches[2] ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $matches[1], $matches[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $matches[1], $matches[2] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_filter_oembed_result_only_one_iframe_is_allowed() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,7 +28,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $html = '<div><iframe></iframe><iframe></iframe><p></p></div>';
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), '' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"></iframe>', $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"></iframe>', $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_filter_oembed_result_with_newlines() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,7 +41,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), '' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"></iframe>', $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"></iframe>', $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_filter_oembed_result_without_iframe() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,13 +65,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $matches[1] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $matches[2] ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $matches[1], $matches[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $matches[1], $matches[2] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_filter_oembed_result_wrong_type_provided() {
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = wp_filter_oembed_result( 'some string', (object) array( 'type' => 'link' ), '' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'some string', $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'some string', $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_filter_oembed_result_invalid_result() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,7 +83,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $html = '<blockquote></blockquote><iframe></iframe>';
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), '' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<blockquote class="wp-embedded-content"></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);"></iframe>', $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<blockquote class="wp-embedded-content"></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);"></iframe>', $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_filter_oembed_result_allowed_html() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,7 +90,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $html = '<blockquote class="foo" id="bar"><strong><a href="" target=""></a></strong></blockquote><iframe></iframe>';
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), '' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<blockquote class="wp-embedded-content"><a href=""></a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);"></iframe>', $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<blockquote class="wp-embedded-content"><a href=""></a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);"></iframe>', $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function _data_oembed_test_strings() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -124,7 +124,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'html' => $html,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = _wp_oembed_get_object()->data2html( $data, 'https://untrusted.localhost' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -134,6 +134,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $html = '<blockquote></blockquote><iframe></iframe>';
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = _oembed_filter_feed_content( wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), '' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<blockquote class="wp-embedded-content"></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"></iframe>', $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<blockquote class="wp-embedded-content"></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"></iframe>', $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsoembedgetResponseDataphp"></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/oembed/getResponseData.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/oembed/getResponseData.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/oembed/getResponseData.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -133,8 +133,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = get_oembed_response_data( $post, 1000 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 600, $data['width'] );
- $this->assertEquals( 338, $data['height'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 600, $data['width'] );
+ $this->assertSame( 338, $data['height'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_oembed_response_data_maxwidth_too_low() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -142,8 +142,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = get_oembed_response_data( $post, 100 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $data['width'] );
- $this->assertEquals( 200, $data['height'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $data['width'] );
+ $this->assertSame( 200, $data['height'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_oembed_response_data_maxwidth_invalid() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -151,13 +151,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = get_oembed_response_data( $post, '400;" DROP TABLES' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 400, $data['width'] );
- $this->assertEquals( 225, $data['height'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 400, $data['width'] );
+ $this->assertSame( 225, $data['height'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = get_oembed_response_data( $post, "lol this isn't even a number?!?!?" );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $data['width'] );
- $this->assertEquals( 200, $data['height'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $data['width'] );
+ $this->assertSame( 200, $data['height'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_oembed_response_data_with_thumbnail() {
</span></span></pre></div>
<a id="trunktestsphpunittestsoembedpostEmbedUrlphp"></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/oembed/postEmbedUrl.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/oembed/postEmbedUrl.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/oembed/postEmbedUrl.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,7 +16,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $permalink = get_permalink( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $embed_url = get_post_embed_url( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $permalink . '/embed', $embed_url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $permalink . '/embed', $embed_url );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_with_ugly_permalinks() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,7 +24,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $permalink = get_permalink( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $embed_url = get_post_embed_url( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $permalink . '&embed=true', $embed_url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $permalink . '&embed=true', $embed_url );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsoembedtemplatephp"></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/oembed/template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/oembed/template.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/oembed/template.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -211,7 +211,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_embed_excerpt_more_no_embed() {
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['wp_query'] = new WP_Query();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo bar', wp_embed_excerpt_more( 'foo bar' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo bar', wp_embed_excerpt_more( 'foo bar' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_embed_excerpt_more() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -222,7 +222,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', wp_embed_excerpt_more( '' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', wp_embed_excerpt_more( '' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( get_post_embed_url( $post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -233,7 +233,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> get_the_permalink()
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_is_embed_post() {
</span></span></pre></div>
<a id="trunktestsphpunittestsoembedwpOembedphp"></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/oembed/wpOembed.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/oembed/wpOembed.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/oembed/wpOembed.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,7 +37,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_oembed_result', array( $this, '_filter_pre_oembed_result' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotFalse( $this->pre_oembed_result_filtered );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->pre_oembed_result_filtered, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->pre_oembed_result_filtered, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_filter_pre_oembed_result_prevents_http_request_when_viewing_the_post() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,7 +52,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_oembed_result', array( $this, '_filter_pre_oembed_result' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotFalse( $this->pre_oembed_result_filtered );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->pre_oembed_result_filtered, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->pre_oembed_result_filtered, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_filter_pre_oembed_result_non_existent_post() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -84,7 +84,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_oembed_result', array( $this, '_filter_pre_oembed_result' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotNull( $this->pre_oembed_result_filtered );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->pre_oembed_result_filtered, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->pre_oembed_result_filtered, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,7 +113,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> restore_current_blog();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotNull( $this->pre_oembed_result_filtered );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->pre_oembed_result_filtered, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->pre_oembed_result_filtered, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,7 +150,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> restore_current_blog();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotNull( $this->pre_oembed_result_filtered );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->pre_oembed_result_filtered, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->pre_oembed_result_filtered, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -177,7 +177,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> restore_current_blog();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotNull( $this->pre_oembed_result_filtered );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->pre_oembed_result_filtered, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->pre_oembed_result_filtered, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -205,7 +205,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> restore_current_blog();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotNull( $this->pre_oembed_result_filtered );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->pre_oembed_result_filtered, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->pre_oembed_result_filtered, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $expected_stack, $actual_stack );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsoptionmultisitephp"></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/option/multisite.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/option/multisite.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/option/multisite.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -35,19 +35,19 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( add_blog_option( 1, $key, $value ) );
</span><span class="cx" style="display: block; padding: 0 10px"> // Assert all values of $blog_id that means the current or main blog (the same here).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, get_blog_option( 1, $key ) );
- $this->assertEquals( $value, get_blog_option( null, $key ) );
- $this->assertEquals( $value, get_blog_option( '1', $key ) );
- $this->assertEquals( $value, get_option( $key ) ); // Check get_option().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, get_blog_option( 1, $key ) );
+ $this->assertSame( $value, get_blog_option( null, $key ) );
+ $this->assertSame( $value, get_blog_option( '1', $key ) );
+ $this->assertSame( $value, get_option( $key ) ); // Check get_option().
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( add_blog_option( 1, $key, $value ) ); // Already exists.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( update_blog_option( 1, $key, $value ) ); // Value is the same.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( update_blog_option( 1, $key, $value2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value2, get_blog_option( 1, $key ) );
- $this->assertEquals( $value2, get_option( $key ) ); // Check get_option().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value2, get_blog_option( 1, $key ) );
+ $this->assertSame( $value2, get_option( $key ) ); // Check get_option().
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( add_blog_option( 1, $key, $value ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value2, get_blog_option( 1, $key ) );
- $this->assertEquals( $value2, get_option( $key ) ); // Check get_option().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value2, get_blog_option( 1, $key ) );
+ $this->assertSame( $value2, get_option( $key ) ); // Check get_option().
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( delete_blog_option( 1, $key ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_blog_option( 1, $key ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,8 +54,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_option( $key ) ); // Check get_option().
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( delete_blog_option( 1, $key ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( update_blog_option( 1, $key2, $value2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value2, get_blog_option( 1, $key2 ) );
- $this->assertEquals( $value2, get_option( $key2 ) ); // Check get_option().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value2, get_blog_option( 1, $key2 ) );
+ $this->assertSame( $value2, get_option( $key2 ) ); // Check get_option().
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( delete_blog_option( 1, $key2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_blog_option( 1, $key2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_option( $key2 ) ); // Check get_option().
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,18 +72,18 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( add_blog_option( null, $key, $value ) );
</span><span class="cx" style="display: block; padding: 0 10px"> // Assert all values of $blog_id that means the current or main blog (the same here).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, get_blog_option( null, $key ) );
- $this->assertEquals( $value, get_blog_option( null, $key ) );
- $this->assertEquals( $value, get_option( $key ) ); // Check get_option().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, get_blog_option( null, $key ) );
+ $this->assertSame( $value, get_blog_option( null, $key ) );
+ $this->assertSame( $value, get_option( $key ) ); // Check get_option().
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( add_blog_option( null, $key, $value ) ); // Already exists.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( update_blog_option( null, $key, $value ) ); // Value is the same.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( update_blog_option( null, $key, $value2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value2, get_blog_option( null, $key ) );
- $this->assertEquals( $value2, get_option( $key ) ); // Check get_option().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value2, get_blog_option( null, $key ) );
+ $this->assertSame( $value2, get_option( $key ) ); // Check get_option().
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( add_blog_option( null, $key, $value ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value2, get_blog_option( null, $key ) );
- $this->assertEquals( $value2, get_option( $key ) ); // Check get_option().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value2, get_blog_option( null, $key ) );
+ $this->assertSame( $value2, get_option( $key ) ); // Check get_option().
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( delete_blog_option( null, $key ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_blog_option( null, $key ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,8 +90,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_option( $key ) ); // Check get_option().
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( delete_blog_option( null, $key ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( update_blog_option( null, $key2, $value2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value2, get_blog_option( null, $key2 ) );
- $this->assertEquals( $value2, get_option( $key2 ) ); // Check get_option().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value2, get_blog_option( null, $key2 ) );
+ $this->assertSame( $value2, get_option( $key2 ) ); // Check get_option().
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( delete_blog_option( null, $key2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_blog_option( null, $key2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_option( $key2 ) ); // Check get_option().
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -119,18 +119,18 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( add_blog_option( $blog_id, $key, $value ) );
</span><span class="cx" style="display: block; padding: 0 10px"> // Assert all values of $blog_id that means the current or main blog (the same here).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, get_blog_option( $blog_id, $key ) );
- $this->assertEquals( $value, get_blog_option( "$blog_id", $key ) );
- // $this->assertEquals( $value, get_option( $key ) ); // Check get_option().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, get_blog_option( $blog_id, $key ) );
+ $this->assertSame( $value, get_blog_option( "$blog_id", $key ) );
+ // $this->assertSame( $value, get_option( $key ) ); // Check get_option().
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( add_blog_option( $blog_id, $key, $value ) ); // Already exists.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( update_blog_option( $blog_id, $key, $value ) ); // Value is the same.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( update_blog_option( $blog_id, $key, $value2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value2, get_blog_option( $blog_id, $key ) );
- // $this->assertEquals( $value2, get_option( $key ) ); // Check get_option().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value2, get_blog_option( $blog_id, $key ) );
+ // $this->assertSame( $value2, get_option( $key ) ); // Check get_option().
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( add_blog_option( $blog_id, $key, $value ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value2, get_blog_option( $blog_id, $key ) );
- // $this->assertEquals( $value2, get_option( $key ) ); // Check get_option().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value2, get_blog_option( $blog_id, $key ) );
+ // $this->assertSame( $value2, get_option( $key ) ); // Check get_option().
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( delete_blog_option( $blog_id, $key ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_blog_option( $blog_id, $key ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,8 +137,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // $this->assertFalse( get_option( $key ) ); // Check get_option().
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( delete_blog_option( $blog_id, $key ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( update_blog_option( $blog_id, $key2, $value2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value2, get_blog_option( $blog_id, $key2 ) );
- // $this->assertEquals( $value2, get_option( $key2 ) ); // Check get_option().
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value2, get_blog_option( $blog_id, $key2 ) );
+ // $this->assertSame( $value2, get_option( $key2 ) ); // Check get_option().
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( delete_blog_option( $blog_id, $key2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_blog_option( $blog_id, $key2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> // $this->assertFalse( get_option( $key2 ) ); // Check get_option().
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -184,7 +184,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_sanitize_network_option_illegal_names( $option_value, $sanitized_option_value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> update_site_option( 'illegal_names', $option_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $sanitized_option_value, get_site_option( 'illegal_names' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $sanitized_option_value, get_site_option( 'illegal_names' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_illegal_names() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -203,7 +203,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_sanitize_network_option_limited_email_domains( $option_value, $sanitized_option_value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> update_site_option( 'limited_email_domains', $option_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $sanitized_option_value, get_site_option( 'limited_email_domains' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $sanitized_option_value, get_site_option( 'limited_email_domains' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -214,7 +214,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_sanitize_network_option_banned_email_domains( $option_value, $sanitized_option_value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> update_site_option( 'banned_email_domains', $option_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $sanitized_option_value, get_site_option( 'banned_email_domains' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $sanitized_option_value, get_site_option( 'banned_email_domains' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_email_domains() {
</span></span></pre></div>
<a id="trunktestsphpunittestsoptionnetworkOptionphp"></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/option/networkOption.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/option/networkOption.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/option/networkOption.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $value = __FUNCTION__;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_network_option( $id, $option, $value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, get_network_option( $id, $option, false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, get_network_option( $id, $option, false ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,7 +47,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_site_option( $option, $value );
</span><span class="cx" style="display: block; padding: 0 10px"> add_network_option( $id, $option, $value );
</span><span class="cx" style="display: block; padding: 0 10px"> delete_site_option( $option );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, get_network_option( $id, $option, false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, get_network_option( $id, $option, false ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -88,7 +88,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $option = rand_str();
</span><span class="cx" style="display: block; padding: 0 10px"> $value = rand_str();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_response, add_network_option( $network_id, $option, $value ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_response, add_network_option( $network_id, $option, $value ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -100,7 +100,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_network_option_network_id_parameter( $network_id, $expected_response ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $option = rand_str();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_response, get_network_option( $network_id, $option, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_response, get_network_option( $network_id, $option, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_network_id_parameter() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -203,6 +203,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( update_network_option( null, 'array_w_object', $array_w_object_2 ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that no new database queries were performed.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_queries_pre_update, get_num_queries() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_queries_pre_update, get_num_queries() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsoptionoptionphp"></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/option/option.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/option/option.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/option/option.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,19 +17,19 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_option( 'doesnotexist' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( add_option( $key, $value ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, get_option( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, get_option( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( add_option( $key, $value ) ); // Already exists.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( update_option( $key, $value ) ); // Value is the same.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( update_option( $key, $value2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value2, get_option( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value2, get_option( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( add_option( $key, $value ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value2, get_option( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value2, get_option( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( delete_option( $key ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_option( $key ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( delete_option( $key ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( update_option( $key2, $value2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value2, get_option( $key2 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value2, get_option( $key2 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( delete_option( $key2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_option( $key2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,17 +41,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Default filter overrides $default arg.
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'default_option_doesnotexist', array( $this, '__return_foo' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo', get_option( 'doesnotexist', 'bar' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo', get_option( 'doesnotexist', 'bar' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Remove the filter and the $default arg is honored.
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'default_option_doesnotexist', array( $this, '__return_foo' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bar', get_option( 'doesnotexist', 'bar' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bar', get_option( 'doesnotexist', 'bar' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Once the option exists, the $default arg and the default filter are ignored.
</span><span class="cx" style="display: block; padding: 0 10px"> add_option( 'doesnotexist', $value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, get_option( 'doesnotexist', 'foo' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, get_option( 'doesnotexist', 'foo' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'default_option_doesnotexist', array( $this, '__return_foo' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, get_option( 'doesnotexist', 'foo' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, get_option( 'doesnotexist', 'foo' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'default_option_doesnotexist', array( $this, '__return_foo' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Cleanup.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -79,7 +79,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( add_option( $key, $value ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, get_option( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, get_option( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $value = (object) $value;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( update_option( $key, $value ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -138,6 +138,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $added );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = $wpdb->get_row( $wpdb->prepare( "SELECT autoload FROM $wpdb->options WHERE option_name = %s LIMIT 1", $name ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual->autoload );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual->autoload );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsoptionregistrationphp"></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/option/registration.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/option/registration.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/option/registration.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,12 +11,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'test_option', $registered );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args = $registered['test_option'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test_group', $args['group'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test_group', $args['group'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check defaults.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'string', $args['type'] );
- $this->assertEquals( false, $args['show_in_rest'] );
- $this->assertEquals( '', $args['description'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'string', $args['type'] );
+ $this->assertFalse( $args['show_in_rest'] );
+ $this->assertSame( '', $args['description'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_register_with_callback() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,7 +23,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> register_setting( 'test_group', 'test_option', array( $this, 'filter_registered_setting' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $filtered = apply_filters( 'sanitize_option_test_option', 'smart', 'test_option', 'smart' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'S-M-R-T', $filtered );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'S-M-R-T', $filtered );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_register_with_array() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $filtered = apply_filters( 'sanitize_option_test_option', 'smart', 'test_option', 'smart' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'S-M-R-T', $filtered );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'S-M-R-T', $filtered );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function filter_registered_setting() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,7 +55,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Got that Viper with them rally stripes', get_option( 'test_default' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Got that Viper with them rally stripes', get_option( 'test_default' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,7 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // This set of tests/references (and a previous version) are in support of Viper007Bond.
</span><span class="cx" style="display: block; padding: 0 10px"> // His Viper doesn't have rally stripes, but for the sake of the Big Tymers, we'll go with it.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'We the #1 Stunnas', get_option( 'test_default', 'We the #1 Stunnas' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'We the #1 Stunnas', get_option( 'test_default', 'We the #1 Stunnas' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -88,7 +88,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_delete( 'notoptions', 'options' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( add_option( 'test_default', 'hello' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'hello', get_option( 'test_default' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'hello', get_option( 'test_default' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsoptionsanitizeoptionphp"></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/option/sanitize-option.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/option/sanitize-option.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/option/sanitize-option.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -138,7 +138,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $errors );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $errors );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_permalink_structure', $errors[0]['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_permalink_structure', $errors[0]['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $expected, $actual );
</span></span></pre></div>
<a id="trunktestsphpunittestsoptionsiteOptionphp"></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/option/siteOption.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/option/siteOption.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/option/siteOption.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,7 +24,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $key = __FUNCTION__;
</span><span class="cx" style="display: block; padding: 0 10px"> $value = __FUNCTION__;
</span><span class="cx" style="display: block; padding: 0 10px"> add_site_option( $key, $value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, get_site_option( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, get_site_option( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_site_option_returns_updated_value() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_value = __FUNCTION__ . '_2';
</span><span class="cx" style="display: block; padding: 0 10px"> add_site_option( $key, $value );
</span><span class="cx" style="display: block; padding: 0 10px"> update_site_option( $key, $new_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_value, get_site_option( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_value, get_site_option( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_site_option_does_not_exist_returns_filtered_default_with_no_default_provided() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,7 +40,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'default_site_option_doesnotexist', array( $this, '__return_foo' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $site_option = get_site_option( 'doesnotexist' );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'default_site_option_doesnotexist', array( $this, '__return_foo' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo', $site_option );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo', $site_option );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_site_option_does_not_exist_returns_filtered_default_with_default_provided() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,11 +47,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'default_site_option_doesnotexist', array( $this, '__return_foo' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $site_option = get_site_option( 'doesnotexist', 'bar' );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'default_site_option_doesnotexist', array( $this, '__return_foo' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo', $site_option );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo', $site_option );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_site_option_does_not_exist_returns_provided_default() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bar', get_site_option( 'doesnotexist', 'bar' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bar', get_site_option( 'doesnotexist', 'bar' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_site_option_exists_does_not_return_provided_default() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -58,7 +58,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $key = __FUNCTION__;
</span><span class="cx" style="display: block; padding: 0 10px"> $value = __FUNCTION__;
</span><span class="cx" style="display: block; padding: 0 10px"> add_site_option( $key, $value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, get_site_option( $key, 'foo' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, get_site_option( $key, 'foo' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_site_option_exists_does_not_return_filtered_default() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,7 +68,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'default_site_option_' . $key, array( $this, '__return_foo' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $site_option = get_site_option( $key );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'default_site_option_' . $key, array( $this, '__return_foo' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, $site_option );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, $site_option );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_add_site_option_returns_true_for_new_option() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -121,7 +121,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'bar' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> add_site_option( $key, $value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, get_site_option( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, get_site_option( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_site_option_add_and_get_serialized_object() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -157,7 +157,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $option = __FUNCTION__;
</span><span class="cx" style="display: block; padding: 0 10px"> $default = 'a default';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_site_option( $option, $default ), $default );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_site_option( $option, $default ), $default );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_site_option( $option ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsoptionsiteTransientphp"></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/option/siteTransient.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/option/siteTransient.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/option/siteTransient.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,10 +20,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_site_transient( 'doesnotexist' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( set_site_transient( $key, $value ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, get_site_transient( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, get_site_transient( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( set_site_transient( $key, $value ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( set_site_transient( $key, $value2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value2, get_site_transient( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value2, get_site_transient( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( delete_site_transient( $key ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_site_transient( $key ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( delete_site_transient( $key ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,7 +37,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( set_site_transient( $key, $value ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, get_site_transient( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, get_site_transient( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $value = (object) $value;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( set_site_transient( $key, $value ) );
</span></span></pre></div>
<a id="trunktestsphpunittestsoptionslashesphp"></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/option/slashes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/option/slashes.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/option/slashes.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,10 +28,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_option( 'slash_test_3', $this->slash_3 );
</span><span class="cx" style="display: block; padding: 0 10px"> add_option( 'slash_test_4', $this->slash_4 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->slash_1, get_option( 'slash_test_1' ) );
- $this->assertEquals( $this->slash_2, get_option( 'slash_test_2' ) );
- $this->assertEquals( $this->slash_3, get_option( 'slash_test_3' ) );
- $this->assertEquals( $this->slash_4, get_option( 'slash_test_4' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->slash_1, get_option( 'slash_test_1' ) );
+ $this->assertSame( $this->slash_2, get_option( 'slash_test_2' ) );
+ $this->assertSame( $this->slash_3, get_option( 'slash_test_3' ) );
+ $this->assertSame( $this->slash_4, get_option( 'slash_test_4' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,15 +41,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_option( 'slash_test_5', 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'slash_test_5', $this->slash_1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->slash_1, get_option( 'slash_test_5' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->slash_1, get_option( 'slash_test_5' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'slash_test_5', $this->slash_2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->slash_2, get_option( 'slash_test_5' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->slash_2, get_option( 'slash_test_5' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'slash_test_5', $this->slash_3 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->slash_3, get_option( 'slash_test_5' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->slash_3, get_option( 'slash_test_5' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'slash_test_5', $this->slash_4 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->slash_4, get_option( 'slash_test_5' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->slash_4, get_option( 'slash_test_5' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsoptionthemeModsphp"></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/option/themeMods.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/option/themeMods.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/option/themeMods.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,17 +6,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Option_Theme_Mods extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_theme_mod_default() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_theme_mod( 'non_existent' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( get_theme_mod( 'non_existent' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_theme_mod_defined_default() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'default', get_theme_mod( 'non_existent', 'default' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'default', get_theme_mod( 'non_existent', 'default' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_theme_mod_set() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = 'value';
</span><span class="cx" style="display: block; padding: 0 10px"> set_theme_mod( 'test_name', $expected );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_theme_mod( 'test_name' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_theme_mod( 'test_name' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_theme_mod_update() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,13 +23,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> set_theme_mod( 'test_update', 'first_value' );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = 'updated_value';
</span><span class="cx" style="display: block; padding: 0 10px"> set_theme_mod( 'test_update', $expected );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_theme_mod( 'test_update' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_theme_mod( 'test_update' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_theme_mod_remove() {
</span><span class="cx" style="display: block; padding: 0 10px"> set_theme_mod( 'test_remove', 'value' );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_theme_mod( 'test_remove' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_theme_mod( 'test_remove' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( get_theme_mod( 'test_remove' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,7 +38,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_theme_mod_default_value_with_percent_symbols
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_theme_mod_default_value_with_percent_symbols( $default, $expected ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_theme_mod( 'test_name', $default ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_theme_mod( 'test_name', $default ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_theme_mod_default_value_with_percent_symbols() {
</span></span></pre></div>
<a id="trunktestsphpunittestsoptiontransientphp"></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/option/transient.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/option/transient.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/option/transient.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,10 +20,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_transient( 'doesnotexist' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( set_transient( $key, $value ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, get_transient( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, get_transient( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( set_transient( $key, $value ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( set_transient( $key, $value2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value2, get_transient( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value2, get_transient( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( delete_transient( $key ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_transient( $key ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( delete_transient( $key ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,7 +37,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( set_transient( $key, $value ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, get_transient( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, get_transient( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $value = (object) $value;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( set_transient( $key, $value ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,7 +74,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $value = rand_str();
</span><span class="cx" style="display: block; padding: 0 10px"> $value2 = rand_str();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( set_transient( $key, $value ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, get_transient( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, get_transient( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_option( '_transient_timeout_' . $key ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -96,7 +96,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Create a bogus a transient.
</span><span class="cx" style="display: block; padding: 0 10px"> $key = 'test_transient';
</span><span class="cx" style="display: block; padding: 0 10px"> set_transient( $key, 'test', 60 * 10 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test', get_transient( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test', get_transient( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Useful variables for tracking.
</span><span class="cx" style="display: block; padding: 0 10px"> $transient_timeout = '_transient_timeout_' . $key;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -114,7 +114,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> get_transient( $key );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure 'delete_option' was not called for both the transient and the timeout.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $a->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $a->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -124,7 +124,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Create a transient.
</span><span class="cx" style="display: block; padding: 0 10px"> $key = 'test_transient';
</span><span class="cx" style="display: block; padding: 0 10px"> set_transient( $key, 'test', 60 * 10 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test', get_transient( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test', get_transient( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the timeout option returns false.
</span><span class="cx" style="display: block; padding: 0 10px"> $timeout = '_transient_timeout_' . $key;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -141,7 +141,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> get_transient( $key );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure 'delete_option' was called for both the transient and the timeout.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $a->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $a->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -155,6 +155,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'args' => array( $timeout ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $a->get_events() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $a->get_events() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsoptionupdateOptionphp"></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/option/updateOption.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/option/updateOption.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/option/updateOption.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,8 +32,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $value = get_option( 'test_update_option_default' );
</span><span class="cx" style="display: block; padding: 0 10px"> $after = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $before, $after );
- $this->assertEquals( $value, 'value' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $before, $after );
+ $this->assertSame( $value, 'value' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,8 +52,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $value = get_option( 'test_update_option_default' );
</span><span class="cx" style="display: block; padding: 0 10px"> $after = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $before, $after );
- $this->assertEquals( $value, 'value' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $before, $after );
+ $this->assertSame( $value, 'value' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -73,8 +73,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $after = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Database has been hit.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $before + 1, $after );
- $this->assertEquals( $value, 'value' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $before + 1, $after );
+ $this->assertSame( $value, 'value' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -94,8 +94,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $after = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Database has been hit.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $before + 1, $after );
- $this->assertEquals( $value, 'value' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $before + 1, $after );
+ $this->assertSame( $value, 'value' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -115,8 +115,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $before = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px"> $value = get_option( 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $before, $wpdb->num_queries );
- $this->assertEquals( $value, 'bar2' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $before, $wpdb->num_queries );
+ $this->assertSame( $value, 'bar2' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,8 +137,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $value = get_option( 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // 'foo' should still be autoload=yes, so we should see no additional querios.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $before, $wpdb->num_queries );
- $this->assertEquals( $value, 'bar' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $before, $wpdb->num_queries );
+ $this->assertSame( $value, 'bar' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -161,8 +161,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $value = get_option( 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // 'foo' should still be autoload=yes, so we should see no additional querios.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $before, $wpdb->num_queries );
- $this->assertEquals( $value, 'bar2' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $before, $wpdb->num_queries );
+ $this->assertSame( $value, 'bar2' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -187,7 +187,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( update_option( 'array_w_object', $array_w_object ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that no new database queries were performed.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_queries_pre_update, get_num_queries() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_queries_pre_update, get_num_queries() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsoptionuserSettingsphp"></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/option/userSettings.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/option/userSettings.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/option/userSettings.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->set_user_setting( 'foo', 'bar' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bar', get_user_setting( 'foo' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bar', get_user_setting( 'foo' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_set_user_setting_dashes() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,7 +37,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->set_user_setting( 'foo', 'foo-bar-baz' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo-bar-baz', get_user_setting( 'foo' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo-bar-baz', get_user_setting( 'foo' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_set_user_setting_strip_asterisks() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,7 +47,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->set_user_setting( 'foo', 'foo*bar*baz' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foobarbaz', get_user_setting( 'foo' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foobarbaz', get_user_setting( 'foo' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // set_user_setting() bails if `headers_sent()` is true.
</span></span></pre></div>
<a id="trunktestsphpunittestsoptionwpLoadAllOptionsphp"></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/option/wpLoadAllOptions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/option/wpLoadAllOptions.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/option/wpLoadAllOptions.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $after = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Database has not been hit.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $before, $after );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $before, $after );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -50,7 +50,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $after = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Database has been hit.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $before + 1, $after );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $before + 1, $after );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,7 +76,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_installing( $temp );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Filter was called.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->alloptions, $all_options );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->alloptions, $all_options );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestspomomophp"></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/pomo/mo.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/pomo/mo.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/pomo/mo.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_mo_simple() {
</span><span class="cx" style="display: block; padding: 0 10px"> $mo = new MO();
</span><span class="cx" style="display: block; padding: 0 10px"> $mo->import_from_file( DIR_TESTDATA . '/pomo/simple.mo' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'Project-Id-Version' => 'WordPress 2.6-bleeding',
</span><span class="cx" style="display: block; padding: 0 10px"> 'Report-Msgid-Bugs-To' => 'wp-polyglots@lists.automattic.com',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,41 +15,41 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $mo->headers
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $mo->entries ) );
- $this->assertEquals( array( 'dyado' ), $mo->entries['baba']->translations );
- $this->assertEquals( array( 'yes' ), $mo->entries["kuku\nruku"]->translations );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $mo->entries ) );
+ $this->assertSame( array( 'dyado' ), $mo->entries['baba']->translations );
+ $this->assertSame( array( 'yes' ), $mo->entries["kuku\nruku"]->translations );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_mo_plural() {
</span><span class="cx" style="display: block; padding: 0 10px"> $mo = new MO();
</span><span class="cx" style="display: block; padding: 0 10px"> $mo->import_from_file( DIR_TESTDATA . '/pomo/plural.mo' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $mo->entries ) );
- $this->assertEquals( array( 'oney dragoney', 'twoey dragoney', 'manyey dragoney', 'manyeyey dragoney', 'manyeyeyey dragoney' ), $mo->entries['one dragon']->translations );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $mo->entries ) );
+ $this->assertSame( array( 'oney dragoney', 'twoey dragoney', 'manyey dragoney', 'manyeyey dragoney', 'manyeyeyey dragoney' ), $mo->entries['one dragon']->translations );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'oney dragoney', $mo->translate_plural( 'one dragon', '%d dragons', 1 ) );
- $this->assertEquals( 'twoey dragoney', $mo->translate_plural( 'one dragon', '%d dragons', 2 ) );
- $this->assertEquals( 'twoey dragoney', $mo->translate_plural( 'one dragon', '%d dragons', -8 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'oney dragoney', $mo->translate_plural( 'one dragon', '%d dragons', 1 ) );
+ $this->assertSame( 'twoey dragoney', $mo->translate_plural( 'one dragon', '%d dragons', 2 ) );
+ $this->assertSame( 'twoey dragoney', $mo->translate_plural( 'one dragon', '%d dragons', -8 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $mo->set_header( 'Plural-Forms', 'nplurals=5; plural=0' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'oney dragoney', $mo->translate_plural( 'one dragon', '%d dragons', 1 ) );
- $this->assertEquals( 'oney dragoney', $mo->translate_plural( 'one dragon', '%d dragons', 2 ) );
- $this->assertEquals( 'oney dragoney', $mo->translate_plural( 'one dragon', '%d dragons', -8 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'oney dragoney', $mo->translate_plural( 'one dragon', '%d dragons', 1 ) );
+ $this->assertSame( 'oney dragoney', $mo->translate_plural( 'one dragon', '%d dragons', 2 ) );
+ $this->assertSame( 'oney dragoney', $mo->translate_plural( 'one dragon', '%d dragons', -8 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $mo->set_header( 'Plural-Forms', 'nplurals=5; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'oney dragoney', $mo->translate_plural( 'one dragon', '%d dragons', 1 ) );
- $this->assertEquals( 'manyey dragoney', $mo->translate_plural( 'one dragon', '%d dragons', 11 ) );
- $this->assertEquals( 'twoey dragoney', $mo->translate_plural( 'one dragon', '%d dragons', 3 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'oney dragoney', $mo->translate_plural( 'one dragon', '%d dragons', 1 ) );
+ $this->assertSame( 'manyey dragoney', $mo->translate_plural( 'one dragon', '%d dragons', 11 ) );
+ $this->assertSame( 'twoey dragoney', $mo->translate_plural( 'one dragon', '%d dragons', 3 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $mo->set_header( 'Plural-Forms', 'nplurals=2; plural=n !=1;' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'oney dragoney', $mo->translate_plural( 'one dragon', '%d dragons', 1 ) );
- $this->assertEquals( 'twoey dragoney', $mo->translate_plural( 'one dragon', '%d dragons', 2 ) );
- $this->assertEquals( 'twoey dragoney', $mo->translate_plural( 'one dragon', '%d dragons', -8 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'oney dragoney', $mo->translate_plural( 'one dragon', '%d dragons', 1 ) );
+ $this->assertSame( 'twoey dragoney', $mo->translate_plural( 'one dragon', '%d dragons', 2 ) );
+ $this->assertSame( 'twoey dragoney', $mo->translate_plural( 'one dragon', '%d dragons', -8 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_mo_context() {
</span><span class="cx" style="display: block; padding: 0 10px"> $mo = new MO();
</span><span class="cx" style="display: block; padding: 0 10px"> $mo->import_from_file( DIR_TESTDATA . '/pomo/context.mo' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $mo->entries ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $mo->entries ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $plural_entry = new Translation_Entry(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'singular' => 'one dragon',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,7 +59,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $plural_entry, $mo->entries[ $plural_entry->key() ] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'dragonland', $mo->entries[ $plural_entry->key() ]->context );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'dragonland', $mo->entries[ $plural_entry->key() ]->context );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $single_entry = new Translation_Entry(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -69,7 +69,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $single_entry, $mo->entries[ $single_entry->key() ] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'not so dragon', $mo->entries[ $single_entry->key() ]->context );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'not so dragon', $mo->entries[ $single_entry->key() ]->context );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,8 +81,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $guest->add_entry( new Translation_Entry( array( 'singular' => 'green' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $guest->add_entry( new Translation_Entry( array( 'singular' => 'red' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $host->merge_with( $guest );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $host->entries ) );
- $this->assertEquals( array(), array_diff( array( 'pink', 'green', 'red' ), array_keys( $host->entries ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $host->entries ) );
+ $this->assertSame( array(), array_diff( array( 'pink', 'green', 'red' ), array_keys( $host->entries ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_export_mo_file() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,7 +137,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $again = new MO();
</span><span class="cx" style="display: block; padding: 0 10px"> $again->import_from_file( $temp_fn );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( count( $entries ), count( $again->entries ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( count( $entries ), count( $again->entries ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $entries as $entry ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $entry, $again->entries[ $entry->key() ] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -159,15 +159,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $again = new MO();
</span><span class="cx" style="display: block; padding: 0 10px"> $again->import_from_file( $temp_fn );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $again->entries ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $again->entries ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_nplurals_with_backslashn() {
</span><span class="cx" style="display: block; padding: 0 10px"> $mo = new MO();
</span><span class="cx" style="display: block; padding: 0 10px"> $mo->import_from_file( DIR_TESTDATA . '/pomo/bad_nplurals.mo' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '%d foro', $mo->translate_plural( '%d forum', '%d forums', 1 ) );
- $this->assertEquals( '%d foros', $mo->translate_plural( '%d forum', '%d forums', 2 ) );
- $this->assertEquals( '%d foros', $mo->translate_plural( '%d forum', '%d forums', -1 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '%d foro', $mo->translate_plural( '%d forum', '%d forums', 1 ) );
+ $this->assertSame( '%d foros', $mo->translate_plural( '%d forum', '%d forums', 2 ) );
+ $this->assertSame( '%d foros', $mo->translate_plural( '%d forum', '%d forums', -1 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function disabled_test_performance() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -184,11 +184,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $mo = new MO();
</span><span class="cx" style="display: block; padding: 0 10px"> $mo->import_from_file( DIR_TESTDATA . '/pomo/overload.mo' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'Табло' ), $mo->entries['Dashboard']->translations );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'Табло' ), $mo->entries['Dashboard']->translations );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_load_pot_file() {
</span><span class="cx" style="display: block; padding: 0 10px"> $mo = new MO();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $mo->import_from_file( DIR_TESTDATA . '/pomo/mo.pot' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $mo->import_from_file( DIR_TESTDATA . '/pomo/mo.pot' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestspomonoopTranslationsphp"></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/pomo/noopTranslations.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/pomo/noopTranslations.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/pomo/noopTranslations.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -18,33 +18,33 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_header() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $this->noop->get_header( 'Content-Type' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $this->noop->get_header( 'Content-Type' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_add_entry() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->noop->add_entry( $this->entry );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $this->noop->entries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $this->noop->entries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_set_header() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->noop->set_header( 'header', 'value' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $this->noop->headers );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $this->noop->headers );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_translate_entry() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->noop->add_entry( $this->entry );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $this->noop->translate_entry( $this->entry ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $this->noop->translate_entry( $this->entry ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_translate() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->noop->add_entry( $this->entry );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'baba', $this->noop->translate( 'baba' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'baba', $this->noop->translate( 'baba' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_plural() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->noop->add_entry( $this->plural_entry );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'dyado', $this->noop->translate_plural( 'dyado', 'dyados', 1 ) );
- $this->assertEquals( 'dyados', $this->noop->translate_plural( 'dyado', 'dyados', 11 ) );
- $this->assertEquals( 'dyados', $this->noop->translate_plural( 'dyado', 'dyados', 0 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'dyado', $this->noop->translate_plural( 'dyado', 'dyados', 1 ) );
+ $this->assertSame( 'dyados', $this->noop->translate_plural( 'dyado', 'dyados', 11 ) );
+ $this->assertSame( 'dyados', $this->noop->translate_plural( 'dyado', 'dyados', 0 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestspomopluralFormsphp"></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/pomo/pluralForms.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/pomo/pluralForms.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/pomo/pluralForms.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -213,7 +213,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $plural_forms->get( 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } catch ( Exception $e ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_exception, $e->getMessage() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_exception, $e->getMessage() );
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -236,6 +236,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $first = $mock->get( 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $second = $mock->get( 2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $first, $second );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $first, $second );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestspomopophp"></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/pomo/po.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/pomo/po.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/pomo/po.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,45 +43,45 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_prepend_each_line() {
</span><span class="cx" style="display: block; padding: 0 10px"> $po = new PO();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'baba_', $po->prepend_each_line( '', 'baba_' ) );
- $this->assertEquals( 'baba_dyado', $po->prepend_each_line( 'dyado', 'baba_' ) );
- $this->assertEquals( "# baba\n# dyado\n# \n", $po->prepend_each_line( "baba\ndyado\n\n", '# ' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'baba_', $po->prepend_each_line( '', 'baba_' ) );
+ $this->assertSame( 'baba_dyado', $po->prepend_each_line( 'dyado', 'baba_' ) );
+ $this->assertSame( "# baba\n# dyado\n# \n", $po->prepend_each_line( "baba\ndyado\n\n", '# ' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_poify() {
</span><span class="cx" style="display: block; padding: 0 10px"> $po = new PO();
</span><span class="cx" style="display: block; padding: 0 10px"> // Simple.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '"baba"', $po->poify( 'baba' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '"baba"', $po->poify( 'baba' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Long word.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->po_a90, $po->poify( $this->a90 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->po_a90, $po->poify( $this->a90 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Tab.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '"ba\tba"', $po->poify( "ba\tba" ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '"ba\tba"', $po->poify( "ba\tba" ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Do not add leading empty string of one-line string ending on a newline.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '"\\\\a\\\\n\\n"', $po->poify( "\a\\n\n" ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '"\\\\a\\\\n\\n"', $po->poify( "\a\\n\n" ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Backslash.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '"ba\\\\ba"', $po->poify( 'ba\\ba' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '"ba\\\\ba"', $po->poify( 'ba\\ba' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Random wordpress.pot string.
</span><span class="cx" style="display: block; padding: 0 10px"> $src = 'Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '"Categories can be selectively converted to tags using the <a href=\\"%s\\">category to tag converter</a>."', $po->poify( $src ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '"Categories can be selectively converted to tags using the <a href=\\"%s\\">category to tag converter</a>."', $po->poify( $src ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $this->po_mail, $po->poify( $this->mail ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $this->po_mail, $po->poify( $this->mail ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_unpoify() {
</span><span class="cx" style="display: block; padding: 0 10px"> $po = new PO();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'baba', $po->unpoify( '"baba"' ) );
- $this->assertEquals( "baba\ngugu", $po->unpoify( '"baba\n"' . "\t\t\t\n" . '"gugu"' ) );
- $this->assertEquals( $this->a90, $po->unpoify( $this->po_a90 ) );
- $this->assertEquals( '\\t\\n', $po->unpoify( '"\\\\t\\\\n"' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'baba', $po->unpoify( '"baba"' ) );
+ $this->assertSame( "baba\ngugu", $po->unpoify( '"baba\n"' . "\t\t\t\n" . '"gugu"' ) );
+ $this->assertSame( $this->a90, $po->unpoify( $this->po_a90 ) );
+ $this->assertSame( '\\t\\n', $po->unpoify( '"\\\\t\\\\n"' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Wordwrapped.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'babadyado', $po->unpoify( "\"\"\n\"baba\"\n\"dyado\"" ) );
- $this->assertEqualsIgnoreEOL( $this->mail, $po->unpoify( $this->po_mail ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'babadyado', $po->unpoify( "\"\"\n\"baba\"\n\"dyado\"" ) );
+ $this->assertSameIgnoreEOL( $this->mail, $po->unpoify( $this->po_mail ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_export_entry() {
</span><span class="cx" style="display: block; padding: 0 10px"> $po = new PO();
</span><span class="cx" style="display: block; padding: 0 10px"> $entry = new Translation_Entry( array( 'singular' => 'baba' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "msgid \"baba\"\nmsgstr \"\"", $po->export_entry( $entry ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "msgid \"baba\"\nmsgstr \"\"", $po->export_entry( $entry ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Plural.
</span><span class="cx" style="display: block; padding: 0 10px"> $entry = new Translation_Entry(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -89,7 +89,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'plural' => 'babas',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'msgid "baba"
</span><span class="cx" style="display: block; padding: 0 10px"> msgid_plural "babas"
</span><span class="cx" style="display: block; padding: 0 10px"> msgstr[0] ""
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -102,7 +102,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'translator_comments' => "baba\ndyado",
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL(
</ins><span class="cx" style="display: block; padding: 0 10px"> '# baba
</span><span class="cx" style="display: block; padding: 0 10px"> # dyado
</span><span class="cx" style="display: block; padding: 0 10px"> msgid "baba"
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -115,7 +115,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'extracted_comments' => 'baba',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL(
</ins><span class="cx" style="display: block; padding: 0 10px"> '#. baba
</span><span class="cx" style="display: block; padding: 0 10px"> msgid "baba"
</span><span class="cx" style="display: block; padding: 0 10px"> msgstr ""',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -128,7 +128,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'references' => range( 1, 29 ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL(
</ins><span class="cx" style="display: block; padding: 0 10px"> '#. baba
</span><span class="cx" style="display: block; padding: 0 10px"> #: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
</span><span class="cx" style="display: block; padding: 0 10px"> #: 29
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -142,7 +142,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'translations' => array(),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "msgid \"baba\"\nmsgstr \"\"", $po->export_entry( $entry ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "msgid \"baba\"\nmsgstr \"\"", $po->export_entry( $entry ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $entry = new Translation_Entry(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,7 +150,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'translations' => array( 'куку', 'буку' ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "msgid \"baba\"\nmsgstr \"куку\"", $po->export_entry( $entry ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "msgid \"baba\"\nmsgstr \"куку\"", $po->export_entry( $entry ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $entry = new Translation_Entry(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -159,7 +159,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'translations' => array( 'кукубуку' ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'msgid "baba"
</span><span class="cx" style="display: block; padding: 0 10px"> msgid_plural "babas"
</span><span class="cx" style="display: block; padding: 0 10px"> msgstr[0] "кукубуку"',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -173,7 +173,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'translations' => array( 'кукубуку', 'кукуруку', 'бабаяга' ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'msgid "baba"
</span><span class="cx" style="display: block; padding: 0 10px"> msgid_plural "babas"
</span><span class="cx" style="display: block; padding: 0 10px"> msgstr[0] "кукубуку"
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -191,7 +191,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'flags' => array( 'fuzzy', 'php-format' ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL(
</ins><span class="cx" style="display: block; padding: 0 10px"> '#, fuzzy, php-format
</span><span class="cx" style="display: block; padding: 0 10px"> msgctxt "ctxt"
</span><span class="cx" style="display: block; padding: 0 10px"> msgid "baba"
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -209,7 +209,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $po = new PO();
</span><span class="cx" style="display: block; padding: 0 10px"> $po->add_entry( $entry );
</span><span class="cx" style="display: block; padding: 0 10px"> $po->add_entry( $entry2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "msgid \"baba\"\nmsgstr \"\"\n\nmsgid \"dyado\"\nmsgstr \"\"", $po->export_entries() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "msgid \"baba\"\nmsgstr \"\"\n\nmsgid \"dyado\"\nmsgstr \"\"", $po->export_entries() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_export_headers() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -216,7 +216,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $po = new PO();
</span><span class="cx" style="display: block; padding: 0 10px"> $po->set_header( 'Project-Id-Version', 'WordPress 2.6-bleeding' );
</span><span class="cx" style="display: block; padding: 0 10px"> $po->set_header( 'POT-Creation-Date', '2008-04-08 18:00+0000' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: WordPress 2.6-bleeding\\n\"\n\"POT-Creation-Date: 2008-04-08 18:00+0000\\n\"", $po->export_headers() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: WordPress 2.6-bleeding\\n\"\n\"POT-Creation-Date: 2008-04-08 18:00+0000\\n\"", $po->export_headers() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_export() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -227,8 +227,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $po->set_header( 'POT-Creation-Date', '2008-04-08 18:00+0000' );
</span><span class="cx" style="display: block; padding: 0 10px"> $po->add_entry( $entry );
</span><span class="cx" style="display: block; padding: 0 10px"> $po->add_entry( $entry2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "msgid \"baba\"\nmsgstr \"\"\n\nmsgid \"dyado\"\nmsgstr \"\"", $po->export( false ) );
- $this->assertEquals( "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: WordPress 2.6-bleeding\\n\"\n\"POT-Creation-Date: 2008-04-08 18:00+0000\\n\"\n\nmsgid \"baba\"\nmsgstr \"\"\n\nmsgid \"dyado\"\nmsgstr \"\"", $po->export() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "msgid \"baba\"\nmsgstr \"\"\n\nmsgid \"dyado\"\nmsgstr \"\"", $po->export( false ) );
+ $this->assertSame( "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: WordPress 2.6-bleeding\\n\"\n\"POT-Creation-Date: 2008-04-08 18:00+0000\\n\"\n\nmsgid \"baba\"\nmsgstr \"\"\n\nmsgid \"dyado\"\nmsgstr \"\"", $po->export() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -243,19 +243,19 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $temp_fn = $this->temp_filename();
</span><span class="cx" style="display: block; padding: 0 10px"> $po->export_to_file( $temp_fn, false );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $po->export( false ), file_get_contents( $temp_fn ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $po->export( false ), file_get_contents( $temp_fn ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $temp_fn2 = $this->temp_filename();
</span><span class="cx" style="display: block; padding: 0 10px"> $po->export_to_file( $temp_fn2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $po->export(), file_get_contents( $temp_fn2 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $po->export(), file_get_contents( $temp_fn2 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_import_from_file() {
</span><span class="cx" style="display: block; padding: 0 10px"> $po = new PO();
</span><span class="cx" style="display: block; padding: 0 10px"> $res = $po->import_from_file( DIR_TESTDATA . '/pomo/simple.po' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( true, $res );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertTrue( $res );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'Project-Id-Version' => 'WordPress 2.6-bleeding',
</span><span class="cx" style="display: block; padding: 0 10px"> 'Plural-Forms' => 'nplurals=2; plural=n != 1;',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -317,7 +317,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_import_from_file_with_windows_line_endings_should_work_as_with_unix_line_endings() {
</span><span class="cx" style="display: block; padding: 0 10px"> $po = new PO();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $po->import_from_file( DIR_TESTDATA . '/pomo/windows-line-endings.po' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $po->entries ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $po->entries ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // TODO: Add tests for bad files.
</span></span></pre></div>
<a id="trunktestsphpunittestspomotranslationEntryphp"></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/pomo/translationEntry.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/pomo/translationEntry.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/pomo/translationEntry.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,12 +21,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'flags' => 'baba',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'baba', $entry->singular );
- $this->assertEquals( 'babas', $entry->plural );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'baba', $entry->singular );
+ $this->assertSame( 'babas', $entry->plural );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $entry->is_plural );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'баба', 'баби' ), $entry->translations );
- $this->assertEquals( array(), $entry->references );
- $this->assertEquals( array(), $entry->flags );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'баба', 'баби' ), $entry->translations );
+ $this->assertSame( array(), $entry->references );
+ $this->assertSame( array(), $entry->flags );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_key() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,7 +44,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'plural' => 'babas',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $entry_baba->key(), $entry_baba_plural->key() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $entry_baba->key(), $entry_baba_plural->key() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $entry_baba->key(), $entry_baba_ctxt->key() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $entry_baba_plural->key(), $entry_baba_ctxt->key() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $entry_baba->key(), $entry_dyado->key() );
</span></span></pre></div>
<a id="trunktestsphpunittestspomotranslationsphp"></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/pomo/translations.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/pomo/translations.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/pomo/translations.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,14 +11,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $empty = new Translation_Entry();
</span><span class="cx" style="display: block; padding: 0 10px"> $po = new Translations();
</span><span class="cx" style="display: block; padding: 0 10px"> $po->add_entry( $entry );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $entry->key() => $entry ), $po->entries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $entry->key() => $entry ), $po->entries );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Add the same entry more than once.
</span><span class="cx" style="display: block; padding: 0 10px"> // We do not need to test proper key generation here, see test_key().
</span><span class="cx" style="display: block; padding: 0 10px"> $po->add_entry( $entry );
</span><span class="cx" style="display: block; padding: 0 10px"> $po->add_entry( $entry );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $entry->key() => $entry ), $po->entries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $entry->key() => $entry ), $po->entries );
</ins><span class="cx" style="display: block; padding: 0 10px"> $po->add_entry( $entry2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> $entry->key() => $entry,
</span><span class="cx" style="display: block; padding: 0 10px"> $entry2->key() => $entry2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,8 +26,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $po->entries
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> // Add empty entry.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $po->add_entry( $empty ) );
- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $po->add_entry( $empty ) );
+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> $entry->key() => $entry,
</span><span class="cx" style="display: block; padding: 0 10px"> $entry2->key() => $entry2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,7 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $po = new Translations();
</span><span class="cx" style="display: block; padding: 0 10px"> $po->add_entry( array( 'singular' => 'baba' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $entries = array_values( $po->entries );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $entry->key(), $entries[0]->key() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $entry->key(), $entries[0]->key() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_translate() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,10 +59,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $domain = new Translations();
</span><span class="cx" style="display: block; padding: 0 10px"> $domain->add_entry( $entry1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $domain->add_entry( $entry2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'babax', $domain->translate( 'baba' ) );
- $this->assertEquals( 'babay', $domain->translate( 'baba', 'x' ) );
- $this->assertEquals( 'baba', $domain->translate( 'baba', 'y' ) );
- $this->assertEquals( 'babaz', $domain->translate( 'babaz' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'babax', $domain->translate( 'baba' ) );
+ $this->assertSame( 'babay', $domain->translate( 'baba', 'x' ) );
+ $this->assertSame( 'baba', $domain->translate( 'baba', 'y' ) );
+ $this->assertSame( 'babaz', $domain->translate( 'babaz' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_translate_plural() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -91,18 +91,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $domain->add_entry( $entry_incomplete );
</span><span class="cx" style="display: block; padding: 0 10px"> $domain->add_entry( $entry_toomany );
</span><span class="cx" style="display: block; padding: 0 10px"> $domain->add_entry( $entry_2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'other', $domain->translate_plural( 'other', 'others', 1 ) );
- $this->assertEquals( 'others', $domain->translate_plural( 'other', 'others', 111 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'other', $domain->translate_plural( 'other', 'others', 1 ) );
+ $this->assertSame( 'others', $domain->translate_plural( 'other', 'others', 111 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Too few translations + cont logic.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'babas', $domain->translate_plural( 'baba', 'babas', 2 ) );
- $this->assertEquals( 'babas', $domain->translate_plural( 'baba', 'babas', 0 ) );
- $this->assertEquals( 'babas', $domain->translate_plural( 'baba', 'babas', -1 ) );
- $this->assertEquals( 'babas', $domain->translate_plural( 'baba', 'babas', 999 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'babas', $domain->translate_plural( 'baba', 'babas', 2 ) );
+ $this->assertSame( 'babas', $domain->translate_plural( 'baba', 'babas', 0 ) );
+ $this->assertSame( 'babas', $domain->translate_plural( 'baba', 'babas', -1 ) );
+ $this->assertSame( 'babas', $domain->translate_plural( 'baba', 'babas', 999 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Proper.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'dyadox', $domain->translate_plural( 'dyado', 'dyados', 1 ) );
- $this->assertEquals( 'dyadoy', $domain->translate_plural( 'dyado', 'dyados', 0 ) );
- $this->assertEquals( 'dyadoy', $domain->translate_plural( 'dyado', 'dyados', 18881 ) );
- $this->assertEquals( 'dyadoy', $domain->translate_plural( 'dyado', 'dyados', -18881 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'dyadox', $domain->translate_plural( 'dyado', 'dyados', 1 ) );
+ $this->assertSame( 'dyadoy', $domain->translate_plural( 'dyado', 'dyados', 0 ) );
+ $this->assertSame( 'dyadoy', $domain->translate_plural( 'dyado', 'dyados', 18881 ) );
+ $this->assertSame( 'dyadoy', $domain->translate_plural( 'dyado', 'dyados', -18881 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_digit_and_merge() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -122,9 +122,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $domain->add_entry( $entry_digit_1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $domain->add_entry( $entry_digit_2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $dummy_translation = new Translations;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1', $domain->translate( '1' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1', $domain->translate( '1' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $domain->merge_with( $dummy_translation );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1', $domain->translate( '1' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1', $domain->translate( '1' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestspostattachmentsphp"></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/post/attachments.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/attachments.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/attachments.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,19 +39,19 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // medium, medium_large, and full size will both point to the original.
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'medium' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_basename( $upload['file'] ), wp_basename( $downsize[0] ) );
- $this->assertEquals( 50, $downsize[1] );
- $this->assertEquals( 50, $downsize[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_basename( $upload['file'] ), wp_basename( $downsize[0] ) );
+ $this->assertSame( 50, $downsize[1] );
+ $this->assertSame( 50, $downsize[2] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'medium_large' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_basename( $upload['file'] ), wp_basename( $downsize[0] ) );
- $this->assertEquals( 50, $downsize[1] );
- $this->assertEquals( 50, $downsize[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_basename( $upload['file'] ), wp_basename( $downsize[0] ) );
+ $this->assertSame( 50, $downsize[1] );
+ $this->assertSame( 50, $downsize[2] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'full' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_basename( $upload['file'] ), wp_basename( $downsize[0] ) );
- $this->assertEquals( 50, $downsize[1] );
- $this->assertEquals( 50, $downsize[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_basename( $upload['file'] ), wp_basename( $downsize[0] ) );
+ $this->assertSame( 50, $downsize[1] );
+ $this->assertSame( 50, $downsize[2] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_insert_image_thumb_only() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,7 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Intermediate copies should exist: thumbnail only.
</span><span class="cx" style="display: block; padding: 0 10px"> $thumb = image_get_intermediate_size( $id, 'thumbnail' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a2-small-150x150.jpg', $thumb['file'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a2-small-150x150.jpg', $thumb['file'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $uploads = wp_upload_dir();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_file( $uploads['basedir'] . DIRECTORY_SEPARATOR . $thumb['path'] ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,29 +81,29 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( image_get_intermediate_size( $id, 'medium_large' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The thumb url should point to the thumbnail intermediate.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $thumb['url'], wp_get_attachment_thumb_url( $id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $thumb['url'], wp_get_attachment_thumb_url( $id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // image_downsize() should return the correct images and sizes.
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'thumbnail' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a2-small-150x150.jpg', wp_basename( $downsize[0] ) );
- $this->assertEquals( 150, $downsize[1] );
- $this->assertEquals( 150, $downsize[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a2-small-150x150.jpg', wp_basename( $downsize[0] ) );
+ $this->assertSame( 150, $downsize[1] );
+ $this->assertSame( 150, $downsize[2] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // medium, medium_large, and full will both point to the original.
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'medium' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a2-small.jpg', wp_basename( $downsize[0] ) );
- $this->assertEquals( 400, $downsize[1] );
- $this->assertEquals( 300, $downsize[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a2-small.jpg', wp_basename( $downsize[0] ) );
+ $this->assertSame( 400, $downsize[1] );
+ $this->assertSame( 300, $downsize[2] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'medium_large' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a2-small.jpg', wp_basename( $downsize[0] ) );
- $this->assertEquals( 400, $downsize[1] );
- $this->assertEquals( 300, $downsize[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a2-small.jpg', wp_basename( $downsize[0] ) );
+ $this->assertSame( 400, $downsize[1] );
+ $this->assertSame( 300, $downsize[2] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'full' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a2-small.jpg', wp_basename( $downsize[0] ) );
- $this->assertEquals( 400, $downsize[1] );
- $this->assertEquals( 300, $downsize[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a2-small.jpg', wp_basename( $downsize[0] ) );
+ $this->assertSame( 400, $downsize[1] );
+ $this->assertSame( 300, $downsize[2] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_insert_image_medium_sizes() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -128,40 +128,40 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Intermediate copies should exist: thumbnail and medium.
</span><span class="cx" style="display: block; padding: 0 10px"> $thumb = image_get_intermediate_size( $id, 'thumbnail' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-150x150.jpg', $thumb['file'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2007-06-17DSC_4173-150x150.jpg', $thumb['file'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_file( $uploads['basedir'] . DIRECTORY_SEPARATOR . $thumb['path'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $medium = image_get_intermediate_size( $id, 'medium' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-400x602.jpg', $medium['file'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2007-06-17DSC_4173-400x602.jpg', $medium['file'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_file( $uploads['basedir'] . DIRECTORY_SEPARATOR . $medium['path'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $medium_large = image_get_intermediate_size( $id, 'medium_large' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-600x904.jpg', $medium_large['file'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2007-06-17DSC_4173-600x904.jpg', $medium_large['file'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_file( $uploads['basedir'] . DIRECTORY_SEPARATOR . $medium_large['path'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The thumb url should point to the thumbnail intermediate.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $thumb['url'], wp_get_attachment_thumb_url( $id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $thumb['url'], wp_get_attachment_thumb_url( $id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // image_downsize() should return the correct images and sizes.
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'thumbnail' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-150x150.jpg', wp_basename( $downsize[0] ) );
- $this->assertEquals( 150, $downsize[1] );
- $this->assertEquals( 150, $downsize[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2007-06-17DSC_4173-150x150.jpg', wp_basename( $downsize[0] ) );
+ $this->assertSame( 150, $downsize[1] );
+ $this->assertSame( 150, $downsize[2] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'medium' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-400x602.jpg', wp_basename( $downsize[0] ) );
- $this->assertEquals( 400, $downsize[1] );
- $this->assertEquals( 602, $downsize[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2007-06-17DSC_4173-400x602.jpg', wp_basename( $downsize[0] ) );
+ $this->assertSame( 400, $downsize[1] );
+ $this->assertSame( 602, $downsize[2] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'medium_large' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-600x904.jpg', wp_basename( $downsize[0] ) );
- $this->assertEquals( 600, $downsize[1] );
- $this->assertEquals( 904, $downsize[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2007-06-17DSC_4173-600x904.jpg', wp_basename( $downsize[0] ) );
+ $this->assertSame( 600, $downsize[1] );
+ $this->assertSame( 904, $downsize[2] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $downsize = image_downsize( $id, 'full' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173.jpg', wp_basename( $downsize[0] ) );
- $this->assertEquals( 680, $downsize[1] );
- $this->assertEquals( 1024, $downsize[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2007-06-17DSC_4173.jpg', wp_basename( $downsize[0] ) );
+ $this->assertSame( 680, $downsize[1] );
+ $this->assertSame( 1024, $downsize[2] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -187,15 +187,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that the file and intermediates exist.
</span><span class="cx" style="display: block; padding: 0 10px"> $thumb = image_get_intermediate_size( $id, 'thumbnail' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-150x150.jpg', $thumb['file'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2007-06-17DSC_4173-150x150.jpg', $thumb['file'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_file( $uploads['basedir'] . DIRECTORY_SEPARATOR . $thumb['path'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $medium = image_get_intermediate_size( $id, 'medium' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-400x602.jpg', $medium['file'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2007-06-17DSC_4173-400x602.jpg', $medium['file'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_file( $uploads['basedir'] . DIRECTORY_SEPARATOR . $medium['path'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $medium_large = image_get_intermediate_size( $id, 'medium_large' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2007-06-17DSC_4173-600x904.jpg', $medium_large['file'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2007-06-17DSC_4173-600x904.jpg', $medium_large['file'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_file( $uploads['basedir'] . DIRECTORY_SEPARATOR . $medium_large['path'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = wp_get_attachment_metadata( $id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -255,7 +255,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_post( $post );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the update didn't remove the attached file.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $attached_file, get_post_meta( $id, '_wp_attached_file', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $attached_file, get_post_meta( $id, '_wp_attached_file', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -272,7 +272,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Assert that the attachment is an orphan.
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment = get_post( $attachment_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $attachment->post_parent, 0 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $attachment->post_parent, 0 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = wp_insert_post(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -284,7 +284,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Assert that the attachment has a parent.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_insert_attachment( $attachment, '', $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment = get_post( $attachment_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $attachment->post_parent, $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $attachment->post_parent, $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestspostfilteringphp"></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/post/filtering.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/filtering.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/filtering.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $id = self::factory()->post->create( array( 'post_content' => $content ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $post->post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $post->post_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // A simple test to make sure unbalanced tags are fixed.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -53,7 +53,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $id = self::factory()->post->create( array( 'post_content' => $content ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $post->post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $post->post_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test KSES filtering of disallowed attribute.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,7 +70,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $id = self::factory()->post->create( array( 'post_content' => $content ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $post->post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $post->post_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,7 +90,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $id = self::factory()->post->create( array( 'post_content' => $content ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $post->post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $post->post_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure unbalanced tags are untouched when the balance option is off.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,6 +110,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $id = self::factory()->post->create( array( 'post_content' => $content ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $content, $post->post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $content, $post->post_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestspostformatsphp"></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/post/formats.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/formats.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/formats.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,20 +17,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = set_post_format( $post_id, 'aside' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $result ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $format = get_post_format( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'aside', $format );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'aside', $format );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = set_post_format( $post_id, 'standard' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $result ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = set_post_format( $post_id, '' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $result ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,7 +45,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = set_post_format( $post_id, 'aside' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $result ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // The format can be set but not retrieved until it is registered.
</span><span class="cx" style="display: block; padding: 0 10px"> $format = get_post_format( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $format );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -53,17 +53,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_post_type_support( 'page', 'post-formats' );
</span><span class="cx" style="display: block; padding: 0 10px"> // The previous set can now be retrieved.
</span><span class="cx" style="display: block; padding: 0 10px"> $format = get_post_format( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'aside', $format );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'aside', $format );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = set_post_format( $post_id, 'standard' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $result ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = set_post_format( $post_id, '' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $result ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_post_type_support( 'page', 'post-formats' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,13 +77,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = set_post_format( $post_id, 'aside' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $result ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( has_post_format( 'aside', $post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = set_post_format( $post_id, 'standard' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $result ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Standard is a special case. It shows as false when set.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_post_format( 'standard', $post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,47 +113,47 @@
</span><span class="cx" style="display: block; padding: 0 10px"> DATA;
</span><span class="cx" style="display: block; padding: 0 10px"> $link_post_id = self::factory()->post->create( array( 'post_content' => $link ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $content_link = get_url_in_content( get_post_field( 'post_content', $link_post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $content_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $content_link );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $link_with_post_id = self::factory()->post->create( array( 'post_content' => $link_with_commentary ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $content_link = get_url_in_content( get_post_field( 'post_content', $link_with_post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $content_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $content_link );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $content_link = get_url_in_content( get_post_field( 'post_content', $link_post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $content_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $content_link );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $content_link = get_url_in_content( get_post_field( 'post_content', $link_with_post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $content_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $content_link );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $empty_post_id = self::factory()->post->create( array( 'post_content' => '' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $content_link = get_url_in_content( get_post_field( 'post_content', $empty_post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $content_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $content_link );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comm_post_id = self::factory()->post->create( array( 'post_content' => $commentary ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $content_link = get_url_in_content( get_post_field( 'post_content', $comm_post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $content_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $content_link );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Now with an href.
</span><span class="cx" style="display: block; padding: 0 10px"> $href_post_id = self::factory()->post->create( array( 'post_content' => $href ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $content_link = get_url_in_content( get_post_field( 'post_content', $href_post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $link, $content_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $link, $content_link );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $href_with_post_id = self::factory()->post->create( array( 'post_content' => $href_with_commentary ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $content_link = get_url_in_content( get_post_field( 'post_content', $href_with_post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $link, $content_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $link, $content_link );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $content_link = get_url_in_content( get_post_field( 'post_content', $href_post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $link, $content_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $link, $content_link );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $content_link = get_url_in_content( get_post_field( 'post_content', $href_with_post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $link, $content_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $link, $content_link );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $empty_post_id = self::factory()->post->create( array( 'post_content' => '' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $content_link = get_url_in_content( get_post_field( 'post_content', $empty_post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $content_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $content_link );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comm_post_id = self::factory()->post->create( array( 'post_content' => $commentary ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $content_link = get_url_in_content( get_post_field( 'post_content', $comm_post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $content_link );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $content_link );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestspostgetLastPostDatephp"></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/post/getLastPostDate.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/getLastPostDate.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/getLastPostDate.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,7 +52,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_post_date_last, get_lastpostdate( 'blog', 'post' ) );
- $this->assertEquals( $book_post_date_last, get_lastpostdate( 'blog', 'book' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_post_date_last, get_lastpostdate( 'blog', 'post' ) );
+ $this->assertSame( $book_post_date_last, get_lastpostdate( 'blog', 'book' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestspostgetLastPostModifiedphp"></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/post/getLastPostModified.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/getLastPostModified.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/getLastPostModified.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -103,7 +103,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_post_modified_last, get_lastpostmodified( 'blog', 'post' ) );
- $this->assertEquals( $book_post_modified_last, get_lastpostmodified( 'blog', 'book' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_post_modified_last, get_lastpostmodified( 'blog', 'post' ) );
+ $this->assertSame( $book_post_modified_last, get_lastpostmodified( 'blog', 'book' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestspostgetPageByPathphp"></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/post/getPageByPath.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/getPageByPath.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/getPageByPath.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,8 +34,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $page = get_post( $page->ID );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'some-page', $attachment->post_name );
- $this->assertEquals( 'some-page', $page->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'some-page', $attachment->post_name );
+ $this->assertSame( 'some-page', $page->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // get_page_by_path() should return a post of the requested type before returning an attachment.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $page, get_page_by_path( 'some-page' ) );
</span></span></pre></div>
<a id="trunktestsphpunittestspostgetPageChildrenphp"></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/post/getPageChildren.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/getPageChildren.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/getPageChildren.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,22 +74,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_hierarchical_order_should_be_respected_in_results() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array( 100, 101, 103, 102, 106, 107, 108, 105 );
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = get_page_children( 0, $this->pages );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_list_pluck( $actual, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_list_pluck( $actual, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_not_all_pages_should_be_returned_when_page_id_is_in_the_middle_of_the_tree() {
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array( 106, 107, 108 );
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = get_page_children( 102, $this->pages );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_list_pluck( $actual, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_list_pluck( $actual, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_page_id_that_is_a_leaf_should_return_empty_array() {
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = get_page_children( 103, $this->pages );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_nonzero_page_id_not_matching_any_actual_post_id_should_return_empty_array() {
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = get_page_children( 200, $this->pages );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestspostgetPageUriphp"></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/post/getPageUri.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/getPageUri.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/getPageUri.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,7 +16,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $post_array->ancestors );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Dummy assertion. If this test fails, it will actually error out on an E_WARNING.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'get-page-uri-post-name', get_page_uri( $post_array ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'get-page-uri-post-name', get_page_uri( $post_array ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,14 +41,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the parent for good measure.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'parent', get_page_uri( $parent_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'parent', get_page_uri( $parent_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Try the child normally.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'parent/child', get_page_uri( $child_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'parent/child', get_page_uri( $child_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Now delete the parent from the database and check.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_post( $parent_id, true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'child', get_page_uri( $child_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'child', get_page_uri( $child_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,7 +71,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'child', get_page_uri( $child_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'child', get_page_uri( $child_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -86,6 +86,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( get_permalink( $post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'blood-orange-announces-summer-tour-dates', get_page_uri() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'blood-orange-announces-summer-tour-dates', get_page_uri() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestspostgetPagesphp"></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/post/getPages.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/getPages.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/getPages.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wp_cache_get( 'last_changed', 'posts' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $pages = get_pages();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $pages ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $pages ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $time1 = wp_cache_get( 'last_changed', 'posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $time1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries = $wpdb->num_queries;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -30,9 +30,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Again. num_queries and last_changed should remain the same.
</span><span class="cx" style="display: block; padding: 0 10px"> $pages = get_pages();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $pages ) );
- $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $pages ) );
+ $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $pages as $page ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $page );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,9 +40,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Again with different args. last_changed should not increment because of
</span><span class="cx" style="display: block; padding: 0 10px"> // different args to get_pages(). num_queries should bump by 1.
</span><span class="cx" style="display: block; padding: 0 10px"> $pages = get_pages( array( 'number' => 2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $pages ) );
- $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
- $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $pages ) );
+ $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+ $this->assertSame( $num_queries + 1, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $pages as $page ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $page );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,9 +51,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Again. num_queries and last_changed should remain the same.
</span><span class="cx" style="display: block; padding: 0 10px"> $pages = get_pages( array( 'number' => 2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $pages ) );
- $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $pages ) );
+ $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $pages as $page ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $page );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,9 +60,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Do the first query again. The interim queries should not affect it.
</span><span class="cx" style="display: block; padding: 0 10px"> $pages = get_pages();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $pages ) );
- $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $pages ) );
+ $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $pages as $page ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $page );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,9 +75,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // last_changed bumped so num_queries should increment.
</span><span class="cx" style="display: block; padding: 0 10px"> $pages = get_pages( array( 'number' => 2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $pages ) );
- $this->assertEquals( $time2, wp_cache_get( 'last_changed', 'posts' ) );
- $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $pages ) );
+ $this->assertSame( $time2, wp_cache_get( 'last_changed', 'posts' ) );
+ $this->assertSame( $num_queries + 1, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $pages as $page ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $page );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -95,9 +95,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // num_queries should bump after wp_delete_post() bumps last_changed.
</span><span class="cx" style="display: block; padding: 0 10px"> $pages = get_pages();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $pages ) );
- $this->assertEquals( $last_changed, wp_cache_get( 'last_changed', 'posts' ) );
- $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $pages ) );
+ $this->assertSame( $last_changed, wp_cache_get( 'last_changed', 'posts' ) );
+ $this->assertSame( $num_queries + 1, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $pages as $page ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $page );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -259,7 +259,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_post_meta( $posts[1], 'some-meta-key', '' );
</span><span class="cx" style="display: block; padding: 0 10px"> add_post_meta( $posts[2], 'some-meta-key', '1' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> 1,
</span><span class="cx" style="display: block; padding: 0 10px"> count(
</span><span class="cx" style="display: block; padding: 0 10px"> get_pages(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -270,7 +270,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> 1,
</span><span class="cx" style="display: block; padding: 0 10px"> count(
</span><span class="cx" style="display: block; padding: 0 10px"> get_pages(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -281,7 +281,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( get_pages( array( 'meta_key' => 'some-meta-key' ) ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( get_pages( array( 'meta_key' => 'some-meta-key' ) ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -302,12 +302,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $include = get_pages( array( 'include' => $inc ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $inc_result = wp_list_pluck( $include, 'ID' );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $inc_result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $inc, $inc_result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $inc, $inc_result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $exclude = get_pages( array( 'exclude' => $exc ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $exc_result = wp_list_pluck( $exclude, 'ID' );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $exc_result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $inc, $exc_result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $inc, $exc_result );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -376,7 +376,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> preg_match_all( '#<option#', wp_dropdown_pages( 'echo=0' ), $matches );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 5, count( $matches[0] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 5, count( $matches[0] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -637,7 +637,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( "/?p=$post_id&post_type=$type" );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_id, get_queried_object_id() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_id, get_queried_object_id() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = wp_list_pages(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -648,9 +648,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $output );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, substr_count( $output, 'class="page_item ' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, substr_count( $output, 'class="page_item ' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'current_page_item', $output );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, substr_count( $output, 'current_page_item' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, substr_count( $output, 'current_page_item' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_post_type( $type );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -715,12 +715,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $pages = get_pages(); // Database gets queried.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_queries + 1, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $pages = get_pages(); // Database should not get queried.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestspostgetPostClassphp"></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/post/getPostClass.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/getPostClass.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/getPostClass.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,9 +48,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 22271
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_with_custom_classes_and_no_post() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), get_post_class( '', null ) );
- $this->assertEquals( array( 'foo' ), get_post_class( 'foo', null ) );
- $this->assertEquals( array( 'foo', 'bar' ), get_post_class( array( 'foo', 'bar' ), null ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), get_post_class( '', null ) );
+ $this->assertSame( array( 'foo' ), get_post_class( 'foo', null ) );
+ $this->assertSame( array( 'foo', 'bar' ), get_post_class( array( 'foo', 'bar' ), null ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestspostlistPagesphp"></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/post/listPages.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/listPages.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/listPages.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -143,7 +143,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </li>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul></li>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, wp_list_pages( $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, wp_list_pages( $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_list_pages_depth() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -157,7 +157,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <li class="page_item page-item-' . self::$parent_3 . ' page_item_has_children"><a href="' . get_permalink( self::$parent_3 ) . '">Parent 3</a></li>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul></li>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, wp_list_pages( $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, wp_list_pages( $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_list_pages_show_date() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -173,7 +173,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <li class="page_item page-item-' . self::$parent_3 . ' page_item_has_children"><a href="' . get_permalink( self::$parent_3 ) . '">Parent 3</a> ' . $date . '</li>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul></li>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, wp_list_pages( $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, wp_list_pages( $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_list_pages_date_format() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -207,7 +207,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </li>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul></li>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, wp_list_pages( $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, wp_list_pages( $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_list_pages_child_of() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -221,7 +221,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <li class="page_item page-item-' . self::$children[ self::$parent_2 ][2] . '"><a href="' . get_permalink( self::$children[ self::$parent_2 ][2] ) . '">Child 3</a></li>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul></li>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, wp_list_pages( $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, wp_list_pages( $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_list_pages_exclude() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -249,7 +249,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <li class="page_item page-item-' . self::$children[ self::$parent_2 ][2] . '"><a href="' . get_permalink( self::$children[ self::$parent_2 ][2] ) . '">Child 3</a></li>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul></li>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, wp_list_pages( $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, wp_list_pages( $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_list_pages_title_li() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -264,7 +264,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <li class="page_item page-item-' . self::$parent_3 . ' page_item_has_children"><a href="' . get_permalink( self::$parent_3 ) . '">Parent 3</a></li>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul></li>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, wp_list_pages( $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, wp_list_pages( $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_list_pages_echo() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -291,7 +291,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<li class="pagenav">Pages<ul><li class="page_item page-item-' . self::$parent_3 . '"><a href="' . get_permalink( self::$parent_3 ) . '">Parent 3</a></li>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul></li>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, wp_list_pages( $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, wp_list_pages( $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_list_pages_number() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -304,7 +304,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<li class="pagenav">Pages<ul><li class="page_item page-item-' . self::$parent_1 . '"><a href="' . get_permalink( self::$parent_1 ) . '">Parent 1</a></li>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul></li>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, wp_list_pages( $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, wp_list_pages( $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_list_pages_sort_column() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -320,7 +320,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <li class="page_item page-item-' . self::$parent_2 . ' page_item_has_children"><a href="' . get_permalink( self::$parent_2 ) . '">Parent 2</a></li>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul></li>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, wp_list_pages( $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, wp_list_pages( $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_list_pages_link_before() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -352,7 +352,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </li>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul></li>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, wp_list_pages( $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, wp_list_pages( $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_list_pages_link_after() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -384,7 +384,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </li>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul></li>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, wp_list_pages( $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, wp_list_pages( $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -398,7 +398,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <li class="page_item page-item-' . self::$parent_3 . '"><a href="' . get_permalink( self::$parent_3 ) . '">Parent 3</a></li>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul></li>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, wp_list_pages( $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, wp_list_pages( $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_list_pages_exclude_tree() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -416,7 +416,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </li>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul></li>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $expected, wp_list_pages( $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $expected, wp_list_pages( $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_list_pages_discarded_whitespace() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -446,6 +446,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </ul></li>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = str_replace( array( "\r\n", "\n", "\t" ), '', $expected );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_list_pages( $args ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_list_pages( $args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestspostmetaphp"></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/post/meta.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/meta.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/meta.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,8 +52,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( add_post_meta( self::$post_id, 'unique', 'another value', true ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check it exists.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'value', get_post_meta( self::$post_id, 'unique', true ) );
- $this->assertEquals( array( 'value' ), get_post_meta( self::$post_id, 'unique', false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'value', get_post_meta( self::$post_id, 'unique', true ) );
+ $this->assertSame( array( 'value' ), get_post_meta( self::$post_id, 'unique', false ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fail to delete the wrong value.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( delete_post_meta( self::$post_id, 'unique', 'wrong value' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,8 +62,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( delete_post_meta( self::$post_id, 'unique', 'value' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check it is deleted.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_post_meta( self::$post_id, 'unique', true ) );
- $this->assertEquals( array(), get_post_meta( self::$post_id, 'unique', false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_post_meta( self::$post_id, 'unique', true ) );
+ $this->assertSame( array(), get_post_meta( self::$post_id, 'unique', false ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -73,8 +73,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'integer', add_post_meta( self::$post_id, 'nonunique', 'another value' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check they exist.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'value', get_post_meta( self::$post_id, 'nonunique', true ) );
- $this->assertEquals( array( 'value', 'another value' ), get_post_meta( self::$post_id, 'nonunique', false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'value', get_post_meta( self::$post_id, 'nonunique', true ) );
+ $this->assertSame( array( 'value', 'another value' ), get_post_meta( self::$post_id, 'nonunique', false ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fail to delete the wrong value.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( delete_post_meta( self::$post_id, 'nonunique', 'wrong value' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,8 +83,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( delete_post_meta( self::$post_id, 'nonunique', 'value' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the remainder exists.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'another value', get_post_meta( self::$post_id, 'nonunique', true ) );
- $this->assertEquals( array( 'another value' ), get_post_meta( self::$post_id, 'nonunique', false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'another value', get_post_meta( self::$post_id, 'nonunique', true ) );
+ $this->assertSame( array( 'another value' ), get_post_meta( self::$post_id, 'nonunique', false ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add a third one.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'integer', add_post_meta( self::$post_id, 'nonunique', 'someother value' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -98,7 +98,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( in_array( get_post_meta( self::$post_id, 'nonunique', true ), $expected, true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = get_post_meta( self::$post_id, 'nonunique', false );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $actual );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Delete the lot.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( delete_post_meta_by_key( 'nonunique' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,10 +113,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'integer', add_post_meta( self::$post_id, 'nonunique_update', 'another value' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check they exist.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'value', get_post_meta( self::$post_id, 'unique_update', true ) );
- $this->assertEquals( array( 'value' ), get_post_meta( self::$post_id, 'unique_update', false ) );
- $this->assertEquals( 'value', get_post_meta( self::$post_id, 'nonunique_update', true ) );
- $this->assertEquals( array( 'value', 'another value' ), get_post_meta( self::$post_id, 'nonunique_update', false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'value', get_post_meta( self::$post_id, 'unique_update', true ) );
+ $this->assertSame( array( 'value' ), get_post_meta( self::$post_id, 'unique_update', false ) );
+ $this->assertSame( 'value', get_post_meta( self::$post_id, 'nonunique_update', true ) );
+ $this->assertSame( array( 'value', 'another value' ), get_post_meta( self::$post_id, 'nonunique_update', false ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update them.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( update_post_meta( self::$post_id, 'unique_update', 'new', 'value' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -124,10 +124,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( update_post_meta( self::$post_id, 'nonunique_update', 'another new', 'another value' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check they updated.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'new', get_post_meta( self::$post_id, 'unique_update', true ) );
- $this->assertEquals( array( 'new' ), get_post_meta( self::$post_id, 'unique_update', false ) );
- $this->assertEquals( 'new', get_post_meta( self::$post_id, 'nonunique_update', true ) );
- $this->assertEquals( array( 'new', 'another new' ), get_post_meta( self::$post_id, 'nonunique_update', false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'new', get_post_meta( self::$post_id, 'unique_update', true ) );
+ $this->assertSame( array( 'new' ), get_post_meta( self::$post_id, 'unique_update', false ) );
+ $this->assertSame( 'new', get_post_meta( self::$post_id, 'nonunique_update', true ) );
+ $this->assertSame( array( 'new', 'another new' ), get_post_meta( self::$post_id, 'nonunique_update', false ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,14 +137,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'integer', add_post_meta( self::$post_id_2, 'unique_delete', 'value', true ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check they exist.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'value', get_post_meta( self::$post_id, 'unique_delete', true ) );
- $this->assertEquals( 'value', get_post_meta( self::$post_id_2, 'unique_delete', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'value', get_post_meta( self::$post_id, 'unique_delete', true ) );
+ $this->assertSame( 'value', get_post_meta( self::$post_id_2, 'unique_delete', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Delete one of them.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( delete_post_meta( self::$post_id, 'unique_delete', 'value' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the other still exists.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'value', get_post_meta( self::$post_id_2, 'unique_delete', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'value', get_post_meta( self::$post_id_2, 'unique_delete', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -154,15 +154,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'integer', add_post_meta( self::$post_id_2, 'unique_delete_by_key', 'value', true ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check they exist.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'value', get_post_meta( self::$post_id, 'unique_delete_by_key', true ) );
- $this->assertEquals( 'value', get_post_meta( self::$post_id_2, 'unique_delete_by_key', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'value', get_post_meta( self::$post_id, 'unique_delete_by_key', true ) );
+ $this->assertSame( 'value', get_post_meta( self::$post_id_2, 'unique_delete_by_key', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Delete one of them.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( delete_post_meta_by_key( 'unique_delete_by_key' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the other still exists.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_post_meta( self::$post_id_2, 'unique_delete_by_key', true ) );
- $this->assertEquals( '', get_post_meta( self::$post_id_2, 'unique_delete_by_key', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_post_meta( self::$post_id_2, 'unique_delete_by_key', true ) );
+ $this->assertSame( '', get_post_meta( self::$post_id_2, 'unique_delete_by_key', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_post_meta_by_id() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -204,10 +204,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'integer', $mid3 = add_post_meta( self::$post_id, 'nonunique_update', 'another value' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check they exist.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'value', get_post_meta( self::$post_id, 'unique_update', true ) );
- $this->assertEquals( array( 'value' ), get_post_meta( self::$post_id, 'unique_update', false ) );
- $this->assertEquals( 'value', get_post_meta( self::$post_id, 'nonunique_update', true ) );
- $this->assertEquals( array( 'value', 'another value' ), get_post_meta( self::$post_id, 'nonunique_update', false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'value', get_post_meta( self::$post_id, 'unique_update', true ) );
+ $this->assertSame( array( 'value' ), get_post_meta( self::$post_id, 'unique_update', false ) );
+ $this->assertSame( 'value', get_post_meta( self::$post_id, 'nonunique_update', true ) );
+ $this->assertSame( array( 'value', 'another value' ), get_post_meta( self::$post_id, 'nonunique_update', false ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update them.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( update_meta( $mid1, 'unique_update', 'new' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -215,16 +215,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( update_meta( $mid3, 'nonunique_update', 'another new' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check they updated.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'new', get_post_meta( self::$post_id, 'unique_update', true ) );
- $this->assertEquals( array( 'new' ), get_post_meta( self::$post_id, 'unique_update', false ) );
- $this->assertEquals( 'new', get_post_meta( self::$post_id, 'nonunique_update', true ) );
- $this->assertEquals( array( 'new', 'another new' ), get_post_meta( self::$post_id, 'nonunique_update', false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'new', get_post_meta( self::$post_id, 'unique_update', true ) );
+ $this->assertSame( array( 'new' ), get_post_meta( self::$post_id, 'unique_update', false ) );
+ $this->assertSame( 'new', get_post_meta( self::$post_id, 'nonunique_update', true ) );
+ $this->assertSame( array( 'new', 'another new' ), get_post_meta( self::$post_id, 'nonunique_update', false ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Slashed update.
</span><span class="cx" style="display: block; padding: 0 10px"> $data = "'quote and \slash";
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( update_meta( $mid1, 'unique_update', addslashes( $data ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_metadata_by_mid( 'post', $mid1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $data, $meta->meta_value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $data, $meta->meta_value );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -263,9 +263,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Reset global so subsequent data tests do not get polluted.
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['wp_meta_keys'] = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'post', $this->last_register_meta_call['object_type'] );
- $this->assertEquals( $meta_key, $this->last_register_meta_call['meta_key'] );
- $this->assertEquals( $args, $this->last_register_meta_call['args'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'post', $this->last_register_meta_call['object_type'] );
+ $this->assertSame( $meta_key, $this->last_register_meta_call['meta_key'] );
+ $this->assertSame( $args, $this->last_register_meta_call['args'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_register_post_meta() {
</span></span></pre></div>
<a id="trunktestsphpunittestspostnavmenuphp"></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/post/nav-menu.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/nav-menu.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/nav-menu.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,7 +40,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, strpos( $menu, '<ul' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, strpos( $menu, '<ul' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_get_associated_nav_menu_items() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -156,7 +156,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Confirm it saved properly.
</span><span class="cx" style="display: block; padding: 0 10px"> $custom_item = wp_setup_nav_menu_item( get_post( $custom_item_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Wordpress.org', $custom_item->title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Wordpress.org', $custom_item->title );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update the orphan with an associated nav menu.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_nav_menu_item(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -169,7 +169,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $menu_items = wp_get_nav_menu_items( $this->menu_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $custom_item = wp_filter_object_list( $menu_items, array( 'db_id' => $custom_item_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $custom_item = array_pop( $custom_item );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'WordPress.org', $custom_item->title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'WordPress.org', $custom_item->title );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -218,7 +218,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $locations['primary'] = $menu_obj->term_id;
</span><span class="cx" style="display: block; padding: 0 10px"> set_theme_mod( 'nav_menu_locations', $locations );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'My Menu', wp_get_nav_menu_name( 'primary' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'My Menu', wp_get_nav_menu_name( 'primary' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -247,7 +247,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // And this is what we got when calling wp_get_nav_menus().
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menus_names = wp_list_pluck( wp_get_nav_menus(), 'name' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $nav_menus_names, $expected_nav_menus_names );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $nav_menus_names, $expected_nav_menus_names );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -279,8 +279,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type_archive_item = wp_setup_nav_menu_item( get_post( $post_type_archive_item_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_type_slug, $post_type_archive_item->title );
- $this->assertEquals( $post_type_description, $post_type_archive_item->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_type_slug, $post_type_archive_item->title );
+ $this->assertSame( $post_type_description, $post_type_archive_item->description );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -310,8 +310,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type_archive_item = wp_setup_nav_menu_item( get_post( $post_type_archive_item_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_type_slug, $post_type_archive_item->title );
- $this->assertEquals( $post_type_description, $post_type_archive_item->description ); // Fail!
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_type_slug, $post_type_archive_item->title );
+ $this->assertSame( $post_type_description, $post_type_archive_item->description ); // Fail!
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -345,8 +345,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type_archive_item = wp_setup_nav_menu_item( get_post( $post_type_archive_item_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_type_slug, $post_type_archive_item->title );
- $this->assertEquals( $menu_item_description, $post_type_archive_item->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_type_slug, $post_type_archive_item->title );
+ $this->assertSame( $menu_item_description, $post_type_archive_item->description );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -723,13 +723,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'data' => $data,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'auto-draft', get_post_status( $auto_draft_post_id ) );
- $this->assertEquals( 'draft', get_post_status( $draft_post_id ) );
- $this->assertEquals( 'private', get_post_status( $private_post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'auto-draft', get_post_status( $auto_draft_post_id ) );
+ $this->assertSame( 'draft', get_post_status( $draft_post_id ) );
+ $this->assertSame( 'private', get_post_status( $private_post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_delete_post( $wp_customize->changeset_post_id(), true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_post_status( $auto_draft_post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'trash', get_post_status( $draft_post_id ) );
- $this->assertEquals( 'private', get_post_status( $private_post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'trash', get_post_status( $draft_post_id ) );
+ $this->assertSame( 'private', get_post_status( $private_post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -943,7 +943,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $custom_item = wp_setup_nav_menu_item( get_post( $custom_item_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $correct_url, $custom_item->url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $correct_url, $custom_item->url );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestspostobjectsphp"></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/post/objects.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/objects.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/objects.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,28 +10,28 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, $post->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, $post->ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $post->ancestors ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $post->ancestors );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $post->ancestors );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Unset and then verify that the magic method fills the property again.
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $post->ancestors );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $post->ancestors );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $post->ancestors );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Magic get should make meta accessible as properties.
</span><span class="cx" style="display: block; padding: 0 10px"> add_post_meta( $id, 'test', 'test' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test', get_post_meta( $id, 'test', true ) );
- $this->assertEquals( 'test', $post->test );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test', get_post_meta( $id, 'test', true ) );
+ $this->assertSame( 'test', $post->test );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure meta does not eclipse true properties.
</span><span class="cx" style="display: block; padding: 0 10px"> add_post_meta( $id, 'post_type', 'dummy' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'dummy', get_post_meta( $id, 'post_type', true ) );
- $this->assertEquals( 'post', $post->post_type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'dummy', get_post_meta( $id, 'post_type', true ) );
+ $this->assertSame( 'post', $post->post_type );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Excercise the output argument.
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id, ARRAY_A );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'post', $post['post_type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'post', $post['post_type'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id, ARRAY_N );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $post );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,13 +41,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post, ARRAY_A );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'post', $post['post_type'] );
- $this->assertEquals( $id, $post['ID'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'post', $post['post_type'] );
+ $this->assertSame( $id, $post['ID'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Should default to OBJECT when given invalid output argument.
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id, 'invalid-output-value' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, $post->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, $post->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure stdClass in $GLOBALS['post'] is handled.
</span><span class="cx" style="display: block; padding: 0 10px"> $post_std = $post->to_array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,7 +56,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['post'] = $post_std;
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( null );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, $post->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, $post->ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> unset( $GLOBALS['post'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If no global post and passing empty value, expect null.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,7 +76,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_parent' => $parent_id,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $updated, $child_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $updated, $child_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $updated = wp_update_post(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'ID' => $grandchild_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,19 +83,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_parent' => $child_id,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $updated, $grandchild_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $updated, $grandchild_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $parent_id ), get_post( $child_id )->ancestors );
- $this->assertEquals( array( $parent_id ), get_post_ancestors( $child_id ) );
- $this->assertEquals( array( $parent_id ), get_post_ancestors( get_post( $child_id ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $parent_id ), get_post( $child_id )->ancestors );
+ $this->assertSame( array( $parent_id ), get_post_ancestors( $child_id ) );
+ $this->assertSame( array( $parent_id ), get_post_ancestors( get_post( $child_id ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $child_id, $parent_id ), get_post( $grandchild_id )->ancestors );
- $this->assertEquals( array( $child_id, $parent_id ), get_post_ancestors( $grandchild_id ) );
- $this->assertEquals( array( $child_id, $parent_id ), get_post_ancestors( get_post( $grandchild_id ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $child_id, $parent_id ), get_post( $grandchild_id )->ancestors );
+ $this->assertSame( array( $child_id, $parent_id ), get_post_ancestors( $grandchild_id ) );
+ $this->assertSame( array( $child_id, $parent_id ), get_post_ancestors( get_post( $grandchild_id ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), get_post( $parent_id )->ancestors );
- $this->assertEquals( array(), get_post_ancestors( $parent_id ) );
- $this->assertEquals( array(), get_post_ancestors( get_post( $parent_id ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), get_post( $parent_id )->ancestors );
+ $this->assertSame( array(), get_post_ancestors( $parent_id ) );
+ $this->assertSame( array(), get_post_ancestors( get_post( $parent_id ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,7 +104,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_post_ancestors_with_falsey_values() {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( array( null, 0, false, '0', '' ) as $post_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', get_post_ancestors( $post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), get_post_ancestors( $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), get_post_ancestors( $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,18 +113,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $post->post_category );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $post->post_category ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $post->post_category ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( get_option( 'default_category' ), $post->post_category[0] );
</span><span class="cx" style="display: block; padding: 0 10px"> $term1 = wp_insert_term( 'Foo', 'category' );
</span><span class="cx" style="display: block; padding: 0 10px"> $term2 = wp_insert_term( 'Bar', 'category' );
</span><span class="cx" style="display: block; padding: 0 10px"> $term3 = wp_insert_term( 'Baz', 'category' );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_post_categories( $post_id, array( $term1['term_id'], $term2['term_id'], $term3['term_id'] ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $post->post_category ) );
- $this->assertEquals( array( $term2['term_id'], $term3['term_id'], $term1['term_id'] ), $post->post_category );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $post->post_category ) );
+ $this->assertSame( array( $term2['term_id'], $term3['term_id'], $term1['term_id'] ), $post->post_category );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id, ARRAY_A );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $post['post_category'] ) );
- $this->assertEquals( array( $term2['term_id'], $term3['term_id'], $term1['term_id'] ), $post['post_category'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $post['post_category'] ) );
+ $this->assertSame( array( $term2['term_id'], $term3['term_id'], $term1['term_id'] ), $post['post_category'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_tags_input_property() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -135,13 +135,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $post->tags_input );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_post_tags( $post_id, 'Foo, Bar, Baz' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $post->tags_input );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $post->tags_input ) );
- $this->assertEquals( array( 'Bar', 'Baz', 'Foo' ), $post->tags_input );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $post->tags_input ) );
+ $this->assertSame( array( 'Bar', 'Baz', 'Foo' ), $post->tags_input );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id, ARRAY_A );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $post['tags_input'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $post['tags_input'] ) );
- $this->assertEquals( array( 'Bar', 'Baz', 'Foo' ), $post['tags_input'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $post['tags_input'] ) );
+ $this->assertSame( array( 'Bar', 'Baz', 'Foo' ), $post['tags_input'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_page_template_property() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,11 +150,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $post->page_template );
</span><span class="cx" style="display: block; padding: 0 10px"> $template = get_post_meta( $post->ID, '_wp_page_template', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $template, $post->page_template );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $template, $post->page_template );
</ins><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( $post_id, '_wp_page_template', 'foo.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> $template = get_post_meta( $post->ID, '_wp_page_template', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo.php', $template );
- $this->assertEquals( $template, $post->page_template );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo.php', $template );
+ $this->assertSame( $template, $post->page_template );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_post_filter() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -166,22 +166,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'raw', $post->filter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'raw', $post->filter );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'int', $post->post_parent );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $display_post = get_post( $post, OBJECT, 'js' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'js', $display_post->filter );
- $this->assertEquals( esc_js( "Mary's home" ), $display_post->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'js', $display_post->filter );
+ $this->assertSame( esc_js( "Mary's home" ), $display_post->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Pass a js filtered WP_Post to get_post() with the filter set to raw.
</span><span class="cx" style="display: block; padding: 0 10px"> // The post should be fetched from cache instead of using the passed object.
</span><span class="cx" style="display: block; padding: 0 10px"> $raw_post = get_post( $display_post, OBJECT, 'raw' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'raw', $raw_post->filter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'raw', $raw_post->filter );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( esc_js( "Mary's home" ), $raw_post->post_title );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $raw_post->filter( 'js' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'js', $post->filter );
- $this->assertEquals( esc_js( "Mary's home" ), $raw_post->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'js', $post->filter );
+ $this->assertSame( esc_js( "Mary's home" ), $raw_post->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_post_identity() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -189,8 +189,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post->foo = 'bar';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bar', get_post( $post )->foo );
- $this->assertEquals( 'bar', get_post( $post, OBJECT, 'display' )->foo );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bar', get_post( $post )->foo );
+ $this->assertSame( 'bar', get_post( $post, OBJECT, 'display' )->foo );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_post_array() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -198,9 +198,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id, ARRAY_A );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, $post['ID'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, $post['ID'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $post['ancestors'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'raw', $post['filter'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'raw', $post['filter'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestspostoutputphp"></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/post/output.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/output.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/output.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,7 +59,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( have_posts() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( the_post() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( strip_ws( $expected ), strip_ws( get_echo( 'the_content' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( strip_ws( $expected ), strip_ws( get_echo( 'the_content' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_the_content_shortcode() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -87,7 +87,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( have_posts() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( the_post() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( strip_ws( $expected ), strip_ws( get_echo( 'the_content' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( strip_ws( $expected ), strip_ws( get_echo( 'the_content' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_the_content_shortcode_paragraph() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,7 +125,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( have_posts() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( the_post() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( strip_ws( $expected ), strip_ws( get_echo( 'the_content' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( strip_ws( $expected ), strip_ws( get_echo( 'the_content' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_the_content_attribute_filtering() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -147,7 +147,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( have_posts() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( the_post() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( strip_ws( $expected ), strip_ws( get_echo( 'the_content' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( strip_ws( $expected ), strip_ws( get_echo( 'the_content' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> kses_remove_filters();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -171,7 +171,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( have_posts() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( the_post() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( strip_ws( $expected ), strip_ws( get_echo( 'the_content' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( strip_ws( $expected ), strip_ws( get_echo( 'the_content' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> kses_remove_filters();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestspostqueryphp"></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/post/query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/query.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/query.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -35,7 +35,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $q->get( 'category__in' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $posts );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $post_id ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $post_id ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts2 = $q->query( array( 'category__and' => array( $term_id, $term_id2 ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $q->get( 'category__and' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -96,8 +96,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fourth post added in filter.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 4, count( $query->posts ) );
- $this->assertEquals( 4, $query->post_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 4, count( $query->posts ) );
+ $this->assertSame( 4, $query->post_count );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $query->posts as $post ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -105,10 +105,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_a( $post, 'WP_Post' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Filters are raw.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'raw', $post->filter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'raw', $post->filter );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Custom data added in the_posts filter is preserved.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $post->ID, 'custom data' ), $post->custom_data );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $post->ID, 'custom data' ), $post->custom_data );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'the_posts', array( $this, 'the_posts_filter' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -613,7 +613,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $q->found_posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $q->found_posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 2, $q->max_num_pages );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -636,7 +636,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $q->found_posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $q->found_posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 2, $q->max_num_pages );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -662,7 +662,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'split_the_query', '__return_true' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $q->found_posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $q->found_posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 2, $q->max_num_pages );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -689,7 +689,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'split_the_query', '__return_false' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $q->found_posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $q->found_posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 2, $q->max_num_pages );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -722,7 +722,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $methd->setAccessible( true );
</span><span class="cx" style="display: block; padding: 0 10px"> $methd->invoke( $q, array( 'no_found_rows' => false ), array() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $q->found_posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $q->found_posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestspostrevisionsphp"></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/post/revisions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/revisions.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/revisions.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,7 +60,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $revisions );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $lastrevision = end( $revisions );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'I cant spel werds.', $lastrevision->post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'I cant spel werds.', $lastrevision->post_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> // #16215
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( self::$author_user_id, $lastrevision->post_author );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -544,7 +544,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $revisions = wp_get_post_revisions( $post['ID'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $revision_ids, array_values( wp_list_pluck( $revisions, 'ID' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $revision_ids, array_values( wp_list_pluck( $revisions, 'ID' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -579,6 +579,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $revisions = wp_get_post_revisions( $post['ID'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $revision_ids, array_values( wp_list_pluck( $revisions, 'ID' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $revision_ids, array_values( wp_list_pluck( $revisions, 'ID' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestspostslashesphp"></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/post/slashes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/slashes.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/slashes.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,9 +40,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = edit_post();
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->slash_1, $post->post_title );
- $this->assertEquals( $this->slash_5, $post->post_content );
- $this->assertEquals( $this->slash_7, $post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->slash_1, $post->post_title );
+ $this->assertSame( $this->slash_5, $post->post_content );
+ $this->assertSame( $this->slash_7, $post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['post_ID'] = $id;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,9 +55,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = edit_post();
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->slash_2, $post->post_title );
- $this->assertEquals( $this->slash_4, $post->post_content );
- $this->assertEquals( $this->slash_6, $post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->slash_2, $post->post_title );
+ $this->assertSame( $this->slash_4, $post->post_content );
+ $this->assertSame( $this->slash_6, $post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,9 +76,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_1 ), $post->post_title );
- $this->assertEquals( wp_unslash( $this->slash_3 ), $post->post_content );
- $this->assertEquals( wp_unslash( $this->slash_5 ), $post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_1 ), $post->post_title );
+ $this->assertSame( wp_unslash( $this->slash_3 ), $post->post_content );
+ $this->assertSame( wp_unslash( $this->slash_5 ), $post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $id = wp_insert_post(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -91,9 +91,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_2 ), $post->post_title );
- $this->assertEquals( wp_unslash( $this->slash_4 ), $post->post_content );
- $this->assertEquals( wp_unslash( $this->slash_6 ), $post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_2 ), $post->post_title );
+ $this->assertSame( wp_unslash( $this->slash_4 ), $post->post_content );
+ $this->assertSame( wp_unslash( $this->slash_6 ), $post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -112,9 +112,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_1 ), $post->post_title );
- $this->assertEquals( wp_unslash( $this->slash_3 ), $post->post_content );
- $this->assertEquals( wp_unslash( $this->slash_5 ), $post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_1 ), $post->post_title );
+ $this->assertSame( wp_unslash( $this->slash_3 ), $post->post_content );
+ $this->assertSame( wp_unslash( $this->slash_5 ), $post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_post(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -126,9 +126,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_2 ), $post->post_title );
- $this->assertEquals( wp_unslash( $this->slash_4 ), $post->post_content );
- $this->assertEquals( wp_unslash( $this->slash_6 ), $post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_2 ), $post->post_title );
+ $this->assertSame( wp_unslash( $this->slash_4 ), $post->post_content );
+ $this->assertSame( wp_unslash( $this->slash_6 ), $post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -147,9 +147,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->slash_1, $post->post_title );
- $this->assertEquals( $this->slash_3, $post->post_content );
- $this->assertEquals( $this->slash_5, $post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->slash_1, $post->post_title );
+ $this->assertSame( $this->slash_3, $post->post_content );
+ $this->assertSame( $this->slash_5, $post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $untrashed = wp_untrash_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $untrashed );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -156,8 +156,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->slash_1, $post->post_title );
- $this->assertEquals( $this->slash_3, $post->post_content );
- $this->assertEquals( $this->slash_5, $post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->slash_1, $post->post_title );
+ $this->assertSame( $this->slash_3, $post->post_content );
+ $this->assertSame( $this->slash_5, $post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsposttemplatephp"></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/post/template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/template.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/template.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,7 +21,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '<p class="post-nav-links">Pages: <span class="post-page-numbers current" aria-current="page">1</span> ' . $page2 . '2</a> ' . $page3 . '3</a></p>';
</span><span class="cx" style="display: block; padding: 0 10px"> $output = wp_link_pages( array( 'echo' => 0 ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $before_after = " <span class=\"post-page-numbers current\" aria-current=\"page\">1</span> {$page2}2</a> {$page3}3</a>";
</span><span class="cx" style="display: block; padding: 0 10px"> $output = wp_link_pages(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,7 +32,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $before_after, $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $before_after, $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $separator = " <span class=\"post-page-numbers current\" aria-current=\"page\">1</span>{$page2}2</a>{$page3}3</a>";
</span><span class="cx" style="display: block; padding: 0 10px"> $output = wp_link_pages(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,7 +44,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $separator, $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $separator, $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $link = " <span class=\"post-page-numbers current\" aria-current=\"page\"><em>1</em></span>{$page2}<em>2</em></a>{$page3}<em>3</em></a>";
</span><span class="cx" style="display: block; padding: 0 10px"> $output = wp_link_pages(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -58,7 +58,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $link, $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $link, $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $next = "{$page2}<em>Next page</em></a>";
</span><span class="cx" style="display: block; padding: 0 10px"> $output = wp_link_pages(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -73,7 +73,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $next, $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $next, $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['page'] = 2;
</span><span class="cx" style="display: block; padding: 0 10px"> $next_prev = "{$permalink}<em>Previous page</em></a>{$page3}<em>Next page</em></a>";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -89,7 +89,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $next_prev, $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $next_prev, $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $next_prev_link = "{$permalink}Woo page</a>{$page3}Hoo page</a>";
</span><span class="cx" style="display: block; padding: 0 10px"> $output = wp_link_pages(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,7 +104,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $next_prev_link, $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $next_prev_link, $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['page'] = 1;
</span><span class="cx" style="display: block; padding: 0 10px"> $separator = "<p class=\"post-nav-links\">Pages: <span class=\"post-page-numbers current\" aria-current=\"page\">1</span> | {$page2}2</a> | {$page3}3</a></p>";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -115,7 +115,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $separator, $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $separator, $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $pagelink = " <span class=\"post-page-numbers current\" aria-current=\"page\">Page 1</span> | {$page2}Page 2</a> | {$page3}Page 3</a>";
</span><span class="cx" style="display: block; padding: 0 10px"> $output = wp_link_pages(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -128,7 +128,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $pagelink, $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $pagelink, $output );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_dropdown_pages() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -164,7 +164,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> LINEAGE;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = wp_dropdown_pages( array( 'echo' => 0 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $lineage, $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $lineage, $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $depth = <<<DEPTH
</span><span class="cx" style="display: block; padding: 0 10px"> <select name='page_id' id='page_id'>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -179,7 +179,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'depth' => 1,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $depth, $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $depth, $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $option_none = <<<NONE
</span><span class="cx" style="display: block; padding: 0 10px"> <select name='page_id' id='page_id'>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -197,7 +197,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'option_none_value' => 'Woo',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $option_none, $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $option_none, $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $option_no_change = <<<NO
</span><span class="cx" style="display: block; padding: 0 10px"> <select name='page_id' id='page_id'>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -217,7 +217,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'show_option_no_change' => 'Burrito',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEqualsIgnoreEOL( $option_no_change, $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSameIgnoreEOL( $option_no_change, $output );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -353,13 +353,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_page_template_slug( $page_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_page_template_slug( $page_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( $page_id, '_wp_page_template', 'default' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_page_template_slug( $page_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_page_template_slug( $page_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( $page_id, '_wp_page_template', 'example.php' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'example.php', get_page_template_slug( $page_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'example.php', get_page_template_slug( $page_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -375,7 +375,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( $page_id, '_wp_page_template', 'example.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( get_permalink( $page_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'example.php', get_page_template_slug() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'example.php', get_page_template_slug() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -385,14 +385,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_page_template_slug_non_page() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_page_template_slug( $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_page_template_slug( $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( $post_id, '_wp_page_template', 'default' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_page_template_slug( $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_page_template_slug( $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( $post_id, '_wp_page_template', 'example.php' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'example.php', get_page_template_slug( $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'example.php', get_page_template_slug( $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -405,7 +405,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( get_permalink( $post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'example.php', get_page_template_slug() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'example.php', get_page_template_slug() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestspostthumbnailsphp"></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/post/thumbnails.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/thumbnails.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/thumbnails.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,12 +60,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> set_post_thumbnail( self::$post, self::$attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$attachment_id, get_post_thumbnail_id( self::$post ) );
- $this->assertEquals( self::$attachment_id, get_post_thumbnail_id( self::$post->ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$attachment_id, get_post_thumbnail_id( self::$post ) );
+ $this->assertSame( self::$attachment_id, get_post_thumbnail_id( self::$post->ID ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['post'] = self::$post;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$attachment_id, get_post_thumbnail_id() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$attachment_id, get_post_thumbnail_id() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_update_post_thumbnail_cache() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,7 +90,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 12235
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_the_post_thumbnail_caption() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_the_post_thumbnail_caption() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_the_post_thumbnail_caption() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $caption = 'This is a caption.';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -107,7 +107,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> set_post_thumbnail( $post_id, $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $caption, get_the_post_thumbnail_caption( $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $caption, get_the_post_thumbnail_caption( $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -127,7 +127,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> set_post_thumbnail( $post_id, $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_the_post_thumbnail_caption( $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_the_post_thumbnail_caption( $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -154,8 +154,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_the_post_thumbnail() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_the_post_thumbnail() );
- $this->assertEquals( '', get_the_post_thumbnail( self::$post ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_the_post_thumbnail() );
+ $this->assertSame( '', get_the_post_thumbnail( self::$post ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> set_post_thumbnail( self::$post, self::$attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = wp_get_attachment_image(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -167,11 +167,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_the_post_thumbnail( self::$post ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_the_post_thumbnail( self::$post ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['post'] = self::$post;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_the_post_thumbnail() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_the_post_thumbnail() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_the_post_thumbnail() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -210,11 +210,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> set_post_thumbnail( self::$post, self::$attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_the_post_thumbnail_url() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_get_attachment_url( self::$attachment_id ), get_the_post_thumbnail_url( self::$post ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_get_attachment_url( self::$attachment_id ), get_the_post_thumbnail_url( self::$post ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['post'] = self::$post;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_get_attachment_url( self::$attachment_id ), get_the_post_thumbnail_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_get_attachment_url( self::$attachment_id ), get_the_post_thumbnail_url() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -307,7 +307,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $thumbnail_id = get_post_thumbnail_id( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$attachment_id, $thumbnail_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$attachment_id, $thumbnail_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = wp_insert_post(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -342,7 +342,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $thumbnail_id = get_post_thumbnail_id( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$attachment_id, $thumbnail_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$attachment_id, $thumbnail_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Images do not support featured images.
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = wp_insert_post(
</span></span></pre></div>
<a id="trunktestsphpunittestsposttypesphp"></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/post/types.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/types.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/types.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -30,11 +30,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $pobj = get_post_type_object( 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post_Type', $pobj );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo', $pobj->name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo', $pobj->name );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test some defaults.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( is_post_type_hierarchical( 'foo' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), get_object_taxonomies( 'foo' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), get_object_taxonomies( 'foo' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_post_type( 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -168,9 +168,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> register_post_type( 'bar' );
</span><span class="cx" style="display: block; padding: 0 10px"> register_taxonomy_for_object_type( 'post_tag', 'bar' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'post_tag' ), get_object_taxonomies( 'bar' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'post_tag' ), get_object_taxonomies( 'bar' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> register_taxonomy_for_object_type( 'category', 'bar' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'category', 'post_tag' ), get_object_taxonomies( 'bar' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'category', 'post_tag' ), get_object_taxonomies( 'bar' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_object_in_taxonomy( 'bar', 'post_tag' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_object_in_taxonomy( 'bar', 'post_tag' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -267,9 +267,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 38844
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_post_type_object_includes_menu_icon_for_builtin_post_types() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'dashicons-admin-post', get_post_type_object( 'post' )->menu_icon );
- $this->assertEquals( 'dashicons-admin-page', get_post_type_object( 'page' )->menu_icon );
- $this->assertEquals( 'dashicons-admin-media', get_post_type_object( 'attachment' )->menu_icon );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'dashicons-admin-post', get_post_type_object( 'post' )->menu_icon );
+ $this->assertSame( 'dashicons-admin-page', get_post_type_object( 'page' )->menu_icon );
+ $this->assertSame( 'dashicons-admin-media', get_post_type_object( 'attachment' )->menu_icon );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestspostwpInsertPostphp"></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/post/wpInsertPost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/wpInsertPost.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/wpInsertPost.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,7 +77,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_trash_post( $trashed_about_page_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'about__trashed', get_post( $trashed_about_page_id )->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'about__trashed', get_post( $trashed_about_page_id )->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -93,7 +93,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_trash_post( $trashed_about_page_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo__trashed__foo__trashed', get_post( $trashed_about_page_id )->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo__trashed__foo__trashed', get_post( $trashed_about_page_id )->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,7 +110,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_trash_post( $about_page_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_untrash_post( $about_page_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'about', get_post( $about_page_id )->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'about', get_post( $about_page_id )->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -133,8 +133,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'about__trashed', get_post( $trashed_about_page_id )->post_name );
- $this->assertEquals( 'about', get_post( $about_page_id )->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'about__trashed', get_post( $trashed_about_page_id )->post_name );
+ $this->assertSame( 'about', get_post( $about_page_id )->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -160,8 +160,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_untrash_post( $about_page_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'about', get_post( $another_about_page_id )->post_name );
- $this->assertEquals( 'about-2', get_post( $about_page_id )->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'about', get_post( $another_about_page_id )->post_name );
+ $this->assertSame( 'about-2', get_post( $about_page_id )->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -316,7 +316,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'publish', get_post_status( $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'publish', get_post_status( $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = $this->factory()->post->create(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -325,6 +325,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'future', get_post_status( $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'future', get_post_status( $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestspostwpUniquePostSlugphp"></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/post/wpUniquePostSlug.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/wpUniquePostSlug.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post/wpUniquePostSlug.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $outputs[ $k ], urldecode( $post->post_name ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $outputs[ $k ], urldecode( $post->post_name ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,11 +56,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $args['post_type'] = 'post-type-2';
</span><span class="cx" style="display: block; padding: 0 10px"> $two = self::factory()->post->create( $args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'some-slug', get_post( $one )->post_name );
- $this->assertEquals( 'some-slug', get_post( $two )->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'some-slug', get_post( $one )->post_name );
+ $this->assertSame( 'some-slug', get_post( $two )->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'some-other-slug', wp_unique_post_slug( 'some-other-slug', $one, 'publish', 'post-type-1', 0 ) );
- $this->assertEquals( 'some-other-slug', wp_unique_post_slug( 'some-other-slug', $one, 'publish', 'post-type-2', 0 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'some-other-slug', wp_unique_post_slug( 'some-other-slug', $one, 'publish', 'post-type-1', 0 ) );
+ $this->assertSame( 'some-other-slug', wp_unique_post_slug( 'some-other-slug', $one, 'publish', 'post-type-2', 0 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_post_type( 'post-type-1' );
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_post_type( 'post-type-2' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,10 +81,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $args['post_name'] = 'some-slug-2';
</span><span class="cx" style="display: block; padding: 0 10px"> $two = self::factory()->post->create( $args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'some-slug', get_post( $one )->post_name );
- $this->assertEquals( 'some-slug-2', get_post( $two )->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'some-slug', get_post( $one )->post_name );
+ $this->assertSame( 'some-slug-2', get_post( $two )->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'some-slug-3', wp_unique_post_slug( 'some-slug', 0, 'publish', 'post-type-1', 0 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'some-slug-3', wp_unique_post_slug( 'some-slug', 0, 'publish', 'post-type-1', 0 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_post_type( 'post-type-1' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,12 +117,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $two = self::factory()->post->create( $args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'some-slug', get_post( $one )->post_name );
- $this->assertEquals( 'image', get_post( $attachment )->post_name );
- $this->assertEquals( 'image-2', get_post( $two )->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'some-slug', get_post( $one )->post_name );
+ $this->assertSame( 'image', get_post( $attachment )->post_name );
+ $this->assertSame( 'image-2', get_post( $two )->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // 'image' can be a child of image-2.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'image', wp_unique_post_slug( 'image', 0, 'publish', 'post-type-1', $two ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'image', wp_unique_post_slug( 'image', 0, 'publish', 'post-type-1', $two ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_post_type( 'post-type-1' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -190,7 +190,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = wp_unique_post_slug( '2015', $p, 'publish', 'post', 0 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2015-2', $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2015-2', $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -208,7 +208,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = wp_unique_post_slug( '2015', $p, 'publish', 'post', 0 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2015-2', $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2015-2', $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -225,7 +225,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = wp_unique_post_slug( '2015', $p, 'publish', 'post', 0 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2015', $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2015', $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -242,7 +242,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = wp_unique_post_slug( '11', $p, 'publish', 'post', 0 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '11-2', $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '11-2', $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -259,7 +259,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = wp_unique_post_slug( '11', $p, 'publish', 'post', 0 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '11', $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '11', $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -276,7 +276,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = wp_unique_post_slug( '13', $p, 'publish', 'post', 0 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '13', $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '13', $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -293,7 +293,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = wp_unique_post_slug( '30', $p, 'publish', 'post', 0 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '30-2', $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '30-2', $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -310,7 +310,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = wp_unique_post_slug( '30', $p, 'publish', 'post', 0 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '30', $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '30', $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -327,7 +327,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = wp_unique_post_slug( '32', $p, 'publish', 'post', 0 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '32', $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '32', $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestspostphp"></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/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/post.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -85,25 +85,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Fetch the post and make sure it matches.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post['post_content'], $out->post_content );
- $this->assertEquals( $post['post_title'], $out->post_title );
- $this->assertEquals( $post['post_status'], $out->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post['post_content'], $out->post_content );
+ $this->assertSame( $post['post_title'], $out->post_title );
+ $this->assertSame( $post['post_status'], $out->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $post['post_author'], $out->post_author );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test cache state.
</span><span class="cx" style="display: block; padding: 0 10px"> $pcache = wp_cache_get( $id, 'posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'stdClass', $pcache );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, $pcache->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, $pcache->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_object_term_cache( $id, $post_type );
</span><span class="cx" style="display: block; padding: 0 10px"> $tcache = wp_cache_get( $id, 'post_tag_relationships' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $tcache );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $tcache ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $tcache ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $tcache = wp_cache_get( $id, 'ctax_relationships' );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'cpt' === $post_type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $tcache );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $tcache ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $tcache ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $tcache );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -141,14 +141,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Fetch the post and make sure it matches.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post['post_content'], $out->post_content );
- $this->assertEquals( $post['post_title'], $out->post_title );
- $this->assertEquals( 'future', $out->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post['post_content'], $out->post_content );
+ $this->assertSame( $post['post_title'], $out->post_title );
+ $this->assertSame( 'future', $out->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $post['post_author'], $out->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post['post_date'], $out->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post['post_date'], $out->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There should be a publish_future_post hook scheduled on the future date.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $future_date, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $future_date, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -173,11 +173,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fetch the post and make sure has the correct date and status.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'future', $out->post_status );
- $this->assertEquals( $post['post_date'], $out->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'future', $out->post_status );
+ $this->assertSame( $post['post_date'], $out->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that there's a publish_future_post job scheduled at the right time.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Now save it again with a date further in the future.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -188,11 +188,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fetch the post again and make sure it has the new post_date.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'future', $out->post_status );
- $this->assertEquals( $post['post_date'], $out->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'future', $out->post_status );
+ $this->assertSame( $post['post_date'], $out->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // And the correct date on the cron job.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $future_date_2, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $future_date_2, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -218,11 +218,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fetch the post and make sure has the correct date and status.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'future', $out->post_status );
- $this->assertEquals( $post['post_date'], $out->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'future', $out->post_status );
+ $this->assertSame( $post['post_date'], $out->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that there's a publish_future_post job scheduled at the right time.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Now save it again with a date further in the future.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -233,11 +233,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fetch the post again and make sure it has the new post_date.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'future', $out->post_status );
- $this->assertEquals( $post['post_date'], $out->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'future', $out->post_status );
+ $this->assertSame( $post['post_date'], $out->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // And the correct date on the cron job.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $future_date_2, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $future_date_2, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -264,14 +264,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Fetch the post and make sure it matches.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post['post_content'], $out->post_content );
- $this->assertEquals( $post['post_title'], $out->post_title );
- $this->assertEquals( 'draft', $out->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post['post_content'], $out->post_content );
+ $this->assertSame( $post['post_title'], $out->post_title );
+ $this->assertSame( 'draft', $out->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $post['post_author'], $out->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post['post_date'], $out->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post['post_date'], $out->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There should be a publish_future_post hook scheduled on the future date.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -295,11 +295,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fetch the post and make sure has the correct date and status.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'future', $out->post_status );
- $this->assertEquals( $post['post_date'], $out->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'future', $out->post_status );
+ $this->assertSame( $post['post_date'], $out->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that there's a publish_future_post job scheduled at the right time.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Now save it again with status set to draft.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -309,11 +309,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fetch the post again and make sure it has the new post_date.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'draft', $out->post_status );
- $this->assertEquals( $post['post_date'], $out->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'draft', $out->post_status );
+ $this->assertSame( $post['post_date'], $out->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // And the correct date on the cron job.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -339,11 +339,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fetch the post and make sure has the correct date and status.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'future', $out->post_status );
- $this->assertEquals( $post['post_date'], $out->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'future', $out->post_status );
+ $this->assertSame( $post['post_date'], $out->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that there's a publish_future_post job scheduled at the right time.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Now save it again with status changed.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -353,11 +353,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fetch the post again and make sure it has the new post_date.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $status, $out->post_status );
- $this->assertEquals( $post['post_date'], $out->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $status, $out->post_status );
+ $this->assertSame( $post['post_date'], $out->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // And the correct date on the cron job.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -385,14 +385,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Fetch the post and make sure it matches.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post['post_content'], $out->post_content );
- $this->assertEquals( $post['post_title'], $out->post_title );
- $this->assertEquals( 'private', $out->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post['post_content'], $out->post_content );
+ $this->assertSame( $post['post_title'], $out->post_title );
+ $this->assertSame( 'private', $out->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $post['post_author'], $out->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post['post_date'], $out->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post['post_date'], $out->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There should be a publish_future_post hook scheduled on the future date.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -412,10 +412,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Test both return paths with or without WP_Error.
</span><span class="cx" style="display: block; padding: 0 10px"> $insert_post = wp_insert_post( $post, true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $insert_post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_date', $insert_post->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_date', $insert_post->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $insert_post = wp_insert_post( $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $insert_post );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $insert_post );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -438,11 +438,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fetch the post and make sure has the correct date and status.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'future', $out->post_status );
- $this->assertEquals( $post['post_date'], $out->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'future', $out->post_status );
+ $this->assertSame( $post['post_date'], $out->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that there's a publish_future_post job scheduled at the right time.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $future_date_1, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Now save it again with status set to draft.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -452,11 +452,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fetch the post again and make sure it has the new post_date.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'private', $out->post_status );
- $this->assertEquals( $post['post_date'], $out->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'private', $out->post_status );
+ $this->assertSame( $post['post_date'], $out->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // And the correct date on the cron job.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -478,7 +478,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->set_permalink_structure();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "$p-2", $post->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "$p-2", $post->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -518,8 +518,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'world', get_post_meta( $post_id, 'hello', true ) );
- $this->assertEquals( 'bar', get_post_meta( $post_id, 'foo', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'world', get_post_meta( $post_id, 'hello', true ) );
+ $this->assertSame( 'bar', get_post_meta( $post_id, 'foo', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -543,7 +543,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->post_ids[] = $id;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that there's a publish_future_post job scheduled at the right time.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $future_date, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $future_date, $this->_next_schedule_for_post( 'publish_future_post', $id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Now delete the post and make sure the cron entry is removed.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_post( $id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -576,7 +576,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $plink = get_permalink( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Permalink should include the post ID at the end.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'siteurl' ) . '/2007/10/31/' . $id . '/', $plink );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'siteurl' ) . '/2007/10/31/' . $id . '/', $plink );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_publish_post() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -583,12 +583,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $draft_id = self::factory()->post->create( array( 'post_status' => 'draft' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $draft_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'draft', $post->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'draft', $post->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_publish_post( $draft_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $draft_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'publish', $post->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'publish', $post->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -604,14 +604,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'future', $post->post_status );
- $this->assertEquals( $future_date, $post->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'future', $post->post_status );
+ $this->assertSame( $future_date, $post->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_publish_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'publish', $post->post_status );
- $this->assertEquals( $future_date, $post->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'publish', $post->post_status );
+ $this->assertSame( $future_date, $post->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -626,8 +626,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'publish', $post->post_status );
- $this->assertEquals( $future_date, $post->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'publish', $post->post_status );
+ $this->assertSame( $future_date, $post->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -638,8 +638,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = wp_insert_post( array( 'post_title' => '<script>Test</script>' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<script>Test</script>', $post->post_title );
- $this->assertEquals( 'draft', $post->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<script>Test</script>', $post->post_title );
+ $this->assertSame( 'draft', $post->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> kses_init_filters();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -650,7 +650,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Test', $post->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Test', $post->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> kses_remove_filters();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -663,14 +663,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = wp_insert_post( array( 'post_title' => '<script>Test</script>' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<script>Test</script>', $post->post_title );
- $this->assertEquals( 'draft', $post->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<script>Test</script>', $post->post_title );
+ $this->assertSame( 'draft', $post->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> kses_init_filters();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_publish_post( $post->ID );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<script>Test</script>', $post->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<script>Test</script>', $post->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> kses_remove_filters();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -682,7 +682,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> global $post;
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_id = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px"> $post = self::factory()->post->create_and_get( array( 'post_parent' => $parent_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $parent_id ), get_post_ancestors( 0 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $parent_id ), get_post_ancestors( 0 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -694,8 +694,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post['ID'] = 123456789;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, wp_insert_post( $post ) );
- $this->assertEquals( 0, wp_update_post( $post ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, wp_insert_post( $post ) );
+ $this->assertSame( 0, wp_update_post( $post ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', wp_insert_post( $post, true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', wp_update_post( $post, true ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -707,10 +707,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_content' => 'Page 0' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> setup_postdata( $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $multipage );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $multipage );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $pages );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $numpages );
- $this->assertEquals( array( 'Page 0' ), $pages );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $numpages );
+ $this->assertSame( array( 'Page 0' ), $pages );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_parse_post_content_multi_page() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -718,10 +718,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_content' => 'Page 0<!--nextpage-->Page 1<!--nextpage-->Page 2<!--nextpage-->Page 3' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> setup_postdata( $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $multipage );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $multipage );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 4, $pages );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 4, $numpages );
- $this->assertEquals( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $pages );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 4, $numpages );
+ $this->assertSame( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $pages );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_parse_post_content_remaining_single_page() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -729,10 +729,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_content' => 'Page 0' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> setup_postdata( $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $multipage );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $multipage );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $pages );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $numpages );
- $this->assertEquals( array( 'Page 0' ), $pages );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $numpages );
+ $this->assertSame( array( 'Page 0' ), $pages );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_parse_post_content_remaining_multi_page() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -740,10 +740,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_content' => 'Page 0<!--nextpage-->Page 1<!--nextpage-->Page 2<!--nextpage-->Page 3' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> setup_postdata( $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $multipage );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $multipage );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 4, $pages );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 4, $numpages );
- $this->assertEquals( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $pages );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 4, $numpages );
+ $this->assertSame( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $pages );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -754,10 +754,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_content' => '<!--nextpage-->Page 0<!--nextpage-->Page 1<!--nextpage-->Page 2<!--nextpage-->Page 3' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> setup_postdata( $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $multipage );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $multipage );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 4, $pages );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 4, $numpages );
- $this->assertEquals( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $pages );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 4, $numpages );
+ $this->assertSame( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $pages );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -768,10 +768,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_content' => '<!--nextpage-->Page 0' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> setup_postdata( $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $multipage );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $multipage );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $pages );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $numpages );
- $this->assertEquals( array( 'Page 0' ), $pages );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $numpages );
+ $this->assertSame( array( 'Page 0' ), $pages );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -797,7 +797,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $insert_post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $post->post_author, self::$editor_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post->post_title, $title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post->post_title, $title );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -852,7 +852,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_post['post_status'] = 'draft';
</span><span class="cx" style="display: block; padding: 0 10px"> wp_insert_post( $_post );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_ids[ $key ] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'draft', $post->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'draft', $post->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( 'publish', $post->post_status );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $after_draft_counts = wp_count_posts();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -870,7 +870,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_trash_post( $post_ids[ $key ] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_ids[ $key ] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'trash', $post->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'trash', $post->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( 'publish', $post->post_status );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $after_trash_counts = wp_count_posts();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -892,7 +892,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $counts = wp_count_posts();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $counts->test ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $counts->test );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $counts->test );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -960,7 +960,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $expected as $field => $value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, $post->$field );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, $post->$field );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -978,8 +978,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'open', $post->comment_status );
- $this->assertEquals( 'open', $post->ping_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'open', $post->comment_status );
+ $this->assertSame( 'open', $post->ping_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -997,8 +997,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'closed', $post->comment_status );
- $this->assertEquals( 'closed', $post->ping_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'closed', $post->comment_status );
+ $this->assertSame( 'closed', $post->ping_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1018,8 +1018,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'open', $post->comment_status );
- $this->assertEquals( 'open', $post->ping_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'open', $post->comment_status );
+ $this->assertSame( 'open', $post->ping_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> _unregister_post_type( $post_type );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1040,8 +1040,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'closed', $post->comment_status );
- $this->assertEquals( 'closed', $post->ping_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'closed', $post->comment_status );
+ $this->assertSame( 'closed', $post->ping_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> _unregister_post_type( $post_type );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1079,8 +1079,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure it's still sticky.
</span><span class="cx" style="display: block; padding: 0 10px"> $saved_post = get_post( $post->ID );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_sticky( $saved_post->ID ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Updated', $saved_post->post_title );
- $this->assertEquals( 'Updated', $saved_post->post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Updated', $saved_post->post_title );
+ $this->assertSame( 'Updated', $saved_post->post_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1120,8 +1120,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure it's still sticky.
</span><span class="cx" style="display: block; padding: 0 10px"> $saved_post = get_post( $post->ID );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_sticky( $saved_post->ID ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Updated', $saved_post->post_title );
- $this->assertEquals( 'Updated', $saved_post->post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Updated', $saved_post->post_title );
+ $this->assertSame( 'Updated', $saved_post->post_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1147,8 +1147,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'post_stuck', array( $a1, 'action' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'post_unstuck', array( $a2, 'action' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $a1->get_call_count() );
- $this->assertEquals( 1, $a2->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $a1->get_call_count() );
+ $this->assertSame( 1, $a2->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1174,7 +1174,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $updated_post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure changing the post_title didn't modify the post_name.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'stuff', $updated_post->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'stuff', $updated_post->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1212,11 +1212,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post['post_content'], $out->post_content );
- $this->assertEquals( $post['post_title'], $out->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post['post_content'], $out->post_content );
+ $this->assertSame( $post['post_title'], $out->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $post['post_author'], $out->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_date_from_gmt( $post['post_date_gmt'] ), $out->post_date );
- $this->assertEquals( $post['post_date_gmt'], $out->post_date_gmt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_date_from_gmt( $post['post_date_gmt'] ), $out->post_date );
+ $this->assertSame( $post['post_date_gmt'], $out->post_date_gmt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_delete_post_reassign_hierarchical_post_type() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1233,11 +1233,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_parent' => $parent_page_id,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $parent_page_id, get_post( $page_id )->post_parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $parent_page_id, get_post( $page_id )->post_parent );
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_delete_post( $parent_page_id, true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $grandparent_page_id, get_post( $page_id )->post_parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $grandparent_page_id, get_post( $page_id )->post_parent );
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_delete_post( $grandparent_page_id, true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, get_post( $page_id )->post_parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, get_post( $page_id )->post_parent );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1248,7 +1248,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_insert_post_for_customize_changeset_should_not_drop_post_name() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_filter( 'wp_insert_post_data', '_wp_customize_changeset_filter_insert_post_data' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_filter( 'wp_insert_post_data', '_wp_customize_changeset_filter_insert_post_data' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $changeset_data = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'blogname' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1266,8 +1266,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_content' => wp_json_encode( $changeset_data ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $uuid, get_post( $post_id )->post_name, 'Expected lower-case UUID4 to be inserted.' );
- $this->assertEquals( $changeset_data, json_decode( get_post( $post_id )->post_content, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $uuid, get_post( $post_id )->post_name, 'Expected lower-case UUID4 to be inserted.' );
+ $this->assertSame( $changeset_data, json_decode( get_post( $post_id )->post_content, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $changeset_data['blogname']['value'] = 'Hola Mundo';
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_post(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1277,8 +1277,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_content' => wp_json_encode( $changeset_data ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $uuid, get_post( $post_id )->post_name, 'Expected post_name to not have been dropped for drafts.' );
- $this->assertEquals( $changeset_data, json_decode( get_post( $post_id )->post_content, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $uuid, get_post( $post_id )->post_name, 'Expected post_name to not have been dropped for drafts.' );
+ $this->assertSame( $changeset_data, json_decode( get_post( $post_id )->post_content, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $changeset_data['blogname']['value'] = 'Hallo Welt';
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_post(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1288,8 +1288,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_content' => wp_json_encode( $changeset_data ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $uuid, get_post( $post_id )->post_name, 'Expected post_name to not have been dropped for pending.' );
- $this->assertEquals( $changeset_data, json_decode( get_post( $post_id )->post_content, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $uuid, get_post( $post_id )->post_name, 'Expected post_name to not have been dropped for pending.' );
+ $this->assertSame( $changeset_data, json_decode( get_post( $post_id )->post_content, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1310,7 +1310,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'override-slug-' . $post->post_type, $post->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'override-slug-' . $post->post_type, $post->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_wp_unique_post_slug', array( $this, 'filter_pre_wp_unique_post_slug' ), 10, 6 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1334,7 +1334,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self::assertEquals( '0000-00-00 00:00:00', $post->post_date_gmt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self::assertSame( '0000-00-00 00:00:00', $post->post_date_gmt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsqueryconditionalsphp"></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/query/conditionals.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/conditionals.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/query/conditionals.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -192,7 +192,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the correct page was fetched.
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_query;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $page_id, $wp_query->get_queried_object()->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $page_id, $wp_query->get_queried_object()->ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -231,7 +231,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the correct page was fetched.
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_query;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $page_id, $wp_query->get_queried_object()->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $page_id, $wp_query->get_queried_object()->ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -268,7 +268,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the correct page was fetched.
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_query;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $page_id, $wp_query->get_queried_object()->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $page_id, $wp_query->get_queried_object()->ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -308,7 +308,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the correct page was fetched.
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_query;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $page_id, $wp_query->get_queried_object()->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $page_id, $wp_query->get_queried_object()->ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -328,7 +328,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the correct page was fetched.
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_query;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $page_id, $wp_query->get_queried_object()->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $page_id, $wp_query->get_queried_object()->ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // '(about)/page/?([0-9]{1,})/?$' => 'index.php?pagename=$matches[1]&paged=$matches[2]'
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -347,7 +347,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the correct page was fetched.
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_query;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $page_id, $wp_query->get_queried_object()->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $page_id, $wp_query->get_queried_object()->ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // '(about)(/[0-9]+)?/?$' => 'index.php?pagename=$matches[1]&page=$matches[2]'
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -368,7 +368,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the correct page was fetched.
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_query;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $page_id, $wp_query->get_queried_object()->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $page_id, $wp_query->get_queried_object()->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'show_on_front', 'posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> delete_option( 'page_for_posts' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -482,7 +482,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_search_encoded_chars() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( '/search/F%C3%BCnf%2Bbar/' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_query_var( 's' ), 'Fünf+bar' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_query_var( 's' ), 'Fünf+bar' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // 'category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?category_name=$matches[1]&feed=$matches[2]',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -823,13 +823,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( '/ptawtq/' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertQueryTrue( 'is_post_type_archive', 'is_archive' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_queried_object(), get_post_type_object( $cpt_name ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_queried_object(), get_post_type_object( $cpt_name ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'pre_get_posts', array( $this, 'pre_get_posts_with_tax_query' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( '/ptawtq/' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertQueryTrue( 'is_post_type_archive', 'is_archive' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_queried_object(), get_post_type_object( $cpt_name ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_queried_object(), get_post_type_object( $cpt_name ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'pre_get_posts', array( $this, 'pre_get_posts_with_tax_query' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -865,13 +865,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( "/$cpt_name/" );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertQueryTrue( 'is_post_type_archive', 'is_archive' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_queried_object(), get_post_type_object( $cpt_name ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_queried_object(), get_post_type_object( $cpt_name ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'pre_get_posts', array( $this, 'pre_get_posts_with_type_array' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( "/$cpt_name/" );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertQueryTrue( 'is_post_type_archive', 'is_archive' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_queried_object(), get_post_type_object( 'post' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_queried_object(), get_post_type_object( 'post' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'pre_get_posts', array( $this, 'pre_get_posts_with_type_array' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsquerydatephp"></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/query/date.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/date.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/query/date.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,7 +78,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '2008-12-10 13:06:27',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_simple_year_expecting_noresults() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,7 +104,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '2007-09-24 07:17:23',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_simple_m_with_year_expecting_noresults() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -129,7 +129,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '2025-04-20 10:13:01',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_simple_m_with_yearmonth_expecting_noresults() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -154,7 +154,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '2025-04-20 10:13:01',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_simple_m_with_yearmonthday_expecting_noresults() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -179,7 +179,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '2025-04-20 10:13:01',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_simple_m_with_yearmonthdayhour_expecting_noresults() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -207,7 +207,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '2025-04-20 10:13:01',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -237,7 +237,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '2025-04-20 10:13:01',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -267,7 +267,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '2025-04-20 10:13:00',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -284,7 +284,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '2025-04-20 10:13:00',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -316,7 +316,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '2025-05-20 10:13:01',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_simple_monthnum_expecting_noresults() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -342,7 +342,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '2012-06-13 14:03:34',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_simple_w_as_in_week_expecting_noresults() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -367,7 +367,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '2007-01-22 03:49:21',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_simple_day_expecting_noresults() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -391,7 +391,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '2009-06-11 21:30:28',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_simple_hour_expecting_noresults() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -416,7 +416,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '2008-07-15 11:32:26',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_simple_minute_expecting_noresults() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -440,7 +440,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '2010-06-17 17:09:30',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_dates, wp_list_pluck( $posts, 'post_date' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_simple_second_expecting_noresults() {
</span></span></pre></div>
<a id="trunktestsphpunittestsquerydateQueryphp"></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/query/dateQuery.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/dateQuery.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/query/dateQuery.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -96,7 +96,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1, $p2 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1, $p2 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_date_query_after_array() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -141,7 +141,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p2 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p2 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_date_query_after_string() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -159,7 +159,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p3 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p3 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_date_query_after_string_inclusive() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -178,7 +178,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p2, $p3 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p2, $p3 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -207,7 +207,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p2, $p3, $p4 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p2, $p3, $p4 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -247,8 +247,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p2 ), $before_posts );
- $this->assertEquals( array( $p1 ), $after_posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p2 ), $before_posts );
+ $this->assertSame( array( $p1 ), $after_posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -331,8 +331,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p2 ), $before_posts );
- $this->assertEquals( array( $p1 ), $after_posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p2 ), $before_posts );
+ $this->assertSame( array( $p1 ), $after_posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -415,8 +415,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p2 ), $before_posts );
- $this->assertEquals( array( $p1 ), $after_posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p2 ), $before_posts );
+ $this->assertSame( array( $p1 ), $after_posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -499,8 +499,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p2 ), $before_posts );
- $this->assertEquals( array( $p1 ), $after_posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p2 ), $before_posts );
+ $this->assertSame( array( $p1 ), $after_posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -583,8 +583,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p2 ), $before_posts );
- $this->assertEquals( array( $p1 ), $after_posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p2 ), $before_posts );
+ $this->assertSame( array( $p1 ), $after_posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -667,7 +667,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1, $p2 ), $before_posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1, $p2 ), $before_posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_date_query_year() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -683,7 +683,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_date_query_month() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -699,7 +699,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_date_query_week() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -715,7 +715,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_date_query_day() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -732,7 +732,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_date_query_dayofweek() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -749,7 +749,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -769,7 +769,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_date_query_hour() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -786,7 +786,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -806,7 +806,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_date_query_minute() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -823,7 +823,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_date_query_second() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -840,7 +840,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_date_query_between_two_times() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -889,7 +889,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1, $p3 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1, $p3 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_date_query_compare_greater_than_or_equal_to() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -910,7 +910,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p2, $p3, $p4 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p2, $p3, $p4 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_date_params_monthnum_m_duplicate() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -929,7 +929,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( "MONTH( $wpdb->posts.post_date ) = 5", $this->q->request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( "MONTH( $wpdb->posts.post_date ) = 9", $this->q->request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -951,7 +951,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p2 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p2 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( "WEEK( $wpdb->posts.post_date, 1 ) = 43", $this->q->request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( "WEEK( $wpdb->posts.post_date, 1 ) = 42", $this->q->request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -992,7 +992,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_taxonomy( 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1023,7 +1023,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p2, $p3 ), wp_list_pluck( $posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p2, $p3 ), wp_list_pluck( $posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsquerygeneratePostdataphp"></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/query/generatePostdata.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/generatePostdata.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/query/generatePostdata.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -94,7 +94,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 0, $data['multipage'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 1, $data['numpages'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'Page 0' ), $data['pages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'Page 0' ), $data['pages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,7 +110,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 1, $data['multipage'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 4, $data['numpages'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $data['pages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $data['pages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -126,7 +126,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 1, $data['multipage'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 3, $data['numpages'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'Page 1', 'Page 2', 'Page 3' ), $data['pages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'Page 1', 'Page 2', 'Page 3' ), $data['pages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -140,6 +140,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = generate_postdata( $post );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'Page 0', "Page 1\nhas a line break", 'Page 2', "\nPage 3" ), $data['pages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'Page 0', "Page 1\nhas a line break", 'Page 2', "\nPage 3" ), $data['pages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsqueryisTermphp"></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/query/isTerm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/isTerm.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/query/isTerm.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -251,7 +251,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = get_term( $this->tax_id, 'testtax' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Only compare term_id because object_id may or may not be part of either value.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected->term_id, $object->term_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected->term_id, $object->term_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -295,6 +295,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = get_term( $this->tax_id, 'testtax' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Only compare term_id because object_id may or may not be part of either value.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected->term_id, $object->term_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected->term_id, $object->term_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsquerymetaQueryphp"></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/query/metaQuery.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/metaQuery.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/query/metaQuery.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -419,7 +419,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array( $p1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $query->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $query->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_meta_query_relation_or() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -672,7 +672,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array( $post_id4 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $query->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $query->posts );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $query = new WP_Query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -696,7 +696,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $query->posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $query->posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1373,7 +1373,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $posts[2], $posts[0], $posts[1] ), $query->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $posts[2], $posts[0], $posts[1] ), $query->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1418,7 +1418,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $posts[2], $posts[0], $posts[1] ), $query->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $posts[2], $posts[0], $posts[1] ), $query->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1534,10 +1534,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $query = new WP_Query( $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $query->posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $query->posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $query->posts as $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'raw', $post->filter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'raw', $post->filter );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = wp_list_pluck( $query->posts, 'ID' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( $post_id2, $post_id3 ), $posts );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1550,10 +1550,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $query = new WP_Query( $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $query->posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $query->posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $query->posts as $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'raw', $post->filter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'raw', $post->filter );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = wp_list_pluck( $query->posts, 'ID' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( $post_id, $post_id4, $post_id5 ), $posts );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1582,7 +1582,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $posts = wp_list_pluck( $posts, 'ID' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( $post_id, $post_id3 ), $posts );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1594,10 +1594,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $posts as $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'raw', $post->filter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'raw', $post->filter );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = wp_list_pluck( $posts, 'ID' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( $post_id, $post_id3 ), $posts );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1625,10 +1625,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = get_posts( $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $posts as $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'raw', $post->filter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'raw', $post->filter );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = wp_list_pluck( $posts, 'ID' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( $post_id, $post_id2 ), $posts );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1659,12 +1659,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta_value' => '0',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $q->posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $q->posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $q->posts as $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'raw', $post->filter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'raw', $post->filter );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_id, $q->posts[0]->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_id, $q->posts[0]->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = get_posts(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1672,10 +1672,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta_value' => '0',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $posts as $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'raw', $post->filter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'raw', $post->filter );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = wp_list_pluck( $posts, 'ID' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( $post_id, $post_id5 ), $posts );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1686,28 +1686,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta_value' => 0,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $posts as $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'raw', $post->filter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'raw', $post->filter );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = wp_list_pluck( $posts, 'ID' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( $post_id, $post_id5 ), $posts );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = get_posts( array( 'meta_value' => 0 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 5, count( $posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 5, count( $posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $posts as $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'raw', $post->filter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'raw', $post->filter );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = wp_list_pluck( $posts, 'ID' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( $post_id, $post_id3, $post_id4, $post_id5, $post_id6 ), $posts );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = get_posts( array( 'meta_value' => '0' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 5, count( $posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 5, count( $posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $posts as $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'raw', $post->filter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'raw', $post->filter );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = wp_list_pluck( $posts, 'ID' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( $post_id, $post_id3, $post_id4, $post_id5, $post_id6 ), $posts );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1736,7 +1736,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $posts[1], $posts[2], $posts[0] ), $q->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $posts[1], $posts[2], $posts[0] ), $q->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1779,7 +1779,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p3, $p1, $p2 ), $q->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p3, $p1, $p2 ), $q->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1815,7 +1815,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $posts[2], $posts[0], $posts[1] ), $q->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $posts[2], $posts[0], $posts[1] ), $q->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsqueryparseQueryphp"></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/query/parseQuery.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/parseQuery.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/query/parseQuery.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,7 +59,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( true, $q->query_vars['s'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertTrue( $q->query_vars['s'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsquerypostStatusphp"></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/query/postStatus.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/postStatus.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/query/postStatus.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -334,7 +334,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p ), wp_list_pluck( $q->posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p ), wp_list_pluck( $q->posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_single_post_with_nonpublic_and_private_status_should_not_be_shown_for_user_who_cannot_edit_others_posts() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -388,7 +388,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p ), wp_list_pluck( $q->posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p ), wp_list_pluck( $q->posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -438,7 +438,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p ), wp_list_pluck( $q->posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p ), wp_list_pluck( $q->posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsqueryresultsphp"></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/query/results.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/results.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/query/results.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -318,7 +318,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 9 => 'embedded-video',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_list_pluck( $posts, 'post_name' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_list_pluck( $posts, 'post_name' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_query_tag_a() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -326,10 +326,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There are 4 posts with Tag A.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 4, $posts );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'tags-a-and-c', $posts[0]->post_name );
- $this->assertEquals( 'tags-a-and-b', $posts[1]->post_name );
- $this->assertEquals( 'tag-a', $posts[2]->post_name );
- $this->assertEquals( 'tags-a-b-c', $posts[3]->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'tags-a-and-c', $posts[0]->post_name );
+ $this->assertSame( 'tags-a-and-b', $posts[1]->post_name );
+ $this->assertSame( 'tag-a', $posts[2]->post_name );
+ $this->assertSame( 'tags-a-b-c', $posts[3]->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_query_tag_b() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -337,10 +337,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There are 4 posts with Tag A.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 4, $posts );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'tags-b-and-c', $posts[0]->post_name );
- $this->assertEquals( 'tags-a-and-b', $posts[1]->post_name );
- $this->assertEquals( 'tag-b', $posts[2]->post_name );
- $this->assertEquals( 'tags-a-b-c', $posts[3]->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'tags-b-and-c', $posts[0]->post_name );
+ $this->assertSame( 'tags-a-and-b', $posts[1]->post_name );
+ $this->assertSame( 'tag-b', $posts[2]->post_name );
+ $this->assertSame( 'tags-a-b-c', $posts[3]->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -351,7 +351,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There is 1 post with Tag נ.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $posts );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'tag-%d7%a0', $posts[0]->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'tag-%d7%a0', $posts[0]->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_query_tag_id() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -360,10 +360,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There are 4 posts with Tag A.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 4, $posts );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'tags-a-and-c', $posts[0]->post_name );
- $this->assertEquals( 'tags-a-and-b', $posts[1]->post_name );
- $this->assertEquals( 'tag-a', $posts[2]->post_name );
- $this->assertEquals( 'tags-a-b-c', $posts[3]->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'tags-a-and-c', $posts[0]->post_name );
+ $this->assertSame( 'tags-a-and-b', $posts[1]->post_name );
+ $this->assertSame( 'tag-a', $posts[2]->post_name );
+ $this->assertSame( 'tags-a-b-c', $posts[3]->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_query_tag_slug__in() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -371,12 +371,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There are 4 posts with either Tag B or Tag C.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 6, $posts );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'tags-a-and-c', $posts[0]->post_name );
- $this->assertEquals( 'tags-b-and-c', $posts[1]->post_name );
- $this->assertEquals( 'tags-a-and-b', $posts[2]->post_name );
- $this->assertEquals( 'tag-c', $posts[3]->post_name );
- $this->assertEquals( 'tag-b', $posts[4]->post_name );
- $this->assertEquals( 'tags-a-b-c', $posts[5]->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'tags-a-and-c', $posts[0]->post_name );
+ $this->assertSame( 'tags-b-and-c', $posts[1]->post_name );
+ $this->assertSame( 'tags-a-and-b', $posts[2]->post_name );
+ $this->assertSame( 'tag-c', $posts[3]->post_name );
+ $this->assertSame( 'tag-b', $posts[4]->post_name );
+ $this->assertSame( 'tags-a-b-c', $posts[5]->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -387,12 +387,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There are 6 posts with either Tag A or Tag B.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 6, $posts );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'tags-a-and-c', $posts[0]->post_name );
- $this->assertEquals( 'tags-b-and-c', $posts[1]->post_name );
- $this->assertEquals( 'tags-a-and-b', $posts[2]->post_name );
- $this->assertEquals( 'tag-b', $posts[3]->post_name );
- $this->assertEquals( 'tag-a', $posts[4]->post_name );
- $this->assertEquals( 'tags-a-b-c', $posts[5]->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'tags-a-and-c', $posts[0]->post_name );
+ $this->assertSame( 'tags-b-and-c', $posts[1]->post_name );
+ $this->assertSame( 'tags-a-and-b', $posts[2]->post_name );
+ $this->assertSame( 'tag-b', $posts[3]->post_name );
+ $this->assertSame( 'tag-a', $posts[4]->post_name );
+ $this->assertSame( 'tags-a-b-c', $posts[5]->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_query_tag__not_in() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -414,7 +414,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 9 => 'many-trackbacks',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_list_pluck( $posts, 'post_name' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_list_pluck( $posts, 'post_name' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_query_tag__in_but__not_in() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -424,8 +424,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There are 4 posts with Tag A, only 2 when we exclude Tag B.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $posts );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'tags-a-and-c', $posts[0]->post_name );
- $this->assertEquals( 'tag-a', $posts[1]->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'tags-a-and-c', $posts[0]->post_name );
+ $this->assertSame( 'tag-a', $posts[1]->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -435,10 +435,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There are 4 posts with Cat A, we'll check for them by name.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 4, $posts );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'cat-a', $posts[0]->post_name );
- $this->assertEquals( 'cats-a-and-c', $posts[1]->post_name );
- $this->assertEquals( 'cats-a-and-b', $posts[2]->post_name );
- $this->assertEquals( 'cats-a-b-c', $posts[3]->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'cat-a', $posts[0]->post_name );
+ $this->assertSame( 'cats-a-and-c', $posts[1]->post_name );
+ $this->assertSame( 'cats-a-and-b', $posts[2]->post_name );
+ $this->assertSame( 'cats-a-b-c', $posts[3]->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_query_cat() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -447,10 +447,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // There are 4 posts with Cat B.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 4, $posts );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'cat-b', $posts[0]->post_name );
- $this->assertEquals( 'cats-b-and-c', $posts[1]->post_name );
- $this->assertEquals( 'cats-a-and-b', $posts[2]->post_name );
- $this->assertEquals( 'cats-a-b-c', $posts[3]->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'cat-b', $posts[0]->post_name );
+ $this->assertSame( 'cats-b-and-c', $posts[1]->post_name );
+ $this->assertSame( 'cats-a-and-b', $posts[2]->post_name );
+ $this->assertSame( 'cats-a-b-c', $posts[3]->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_query_posts_per_page() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -465,7 +465,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 5, $posts );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_list_pluck( $posts, 'post_name' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_list_pluck( $posts, 'post_name' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_query_offset() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -485,7 +485,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 10, $posts );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_list_pluck( $posts, 'post_name' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_list_pluck( $posts, 'post_name' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_query_paged() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -506,7 +506,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 10, $posts );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->q->is_paged() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_list_pluck( $posts, 'post_name' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_list_pluck( $posts, 'post_name' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_query_paged_and_posts_per_page() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -521,7 +521,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 4, $posts );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $this->q->is_paged() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_list_pluck( $posts, 'post_name' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_list_pluck( $posts, 'post_name' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -537,7 +537,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'child-one',
</span><span class="cx" style="display: block; padding: 0 10px"> 'child-two',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -554,7 +554,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'child-three',
</span><span class="cx" style="display: block; padding: 0 10px"> 'child-four',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -571,7 +571,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'child-one',
</span><span class="cx" style="display: block; padding: 0 10px"> 'child-two',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -588,7 +588,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), wp_list_pluck( $posts, 'post_title' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), wp_list_pluck( $posts, 'post_title' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -603,7 +603,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'child-three',
</span><span class="cx" style="display: block; padding: 0 10px"> 'child-four',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -630,7 +630,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // 'order=desc' does not influence the order of returned results (returns same order as 'order=asc').
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_returned_array, wp_list_pluck( $posts, 'post_title' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_returned_array, wp_list_pluck( $posts, 'post_title' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsquerysearchphp"></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/query/search.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/search.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/query/search.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -50,7 +50,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = $this->get_search_results( 'About' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_id, reset( $posts )->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_id, reset( $posts )->ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_search_terms_query_var() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -57,7 +57,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = 'This is a search term';
</span><span class="cx" style="display: block; padding: 0 10px"> $query = new WP_Query( array( 's' => 'This is a search term' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( explode( ' ', $terms ), $query->get( 'search_terms' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'search', 'term' ), $query->get( 'search_terms' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'search', 'term' ), $query->get( 'search_terms' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_filter_stopwords() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,7 +67,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'wp_search_stopwords', array( $this, 'filter_wp_search_stopwords' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( array( 'search', 'term' ), $query->get( 'search_terms' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'This', 'is', 'search', 'term' ), $query->get( 'search_terms' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'This', 'is', 'search', 'term' ), $query->get( 'search_terms' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function filter_wp_search_stopwords() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -89,13 +89,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // By default, we can use the hyphen prefix to exclude results.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $this->get_search_results( $title ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $this->get_search_results( $title ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // After we disable the feature using the filter, we should get the result.
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'wp_query_search_exclusion_prefix', '__return_false' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->get_search_results( $title );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array_pop( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post->ID, $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post->ID, $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'wp_query_search_exclusion_prefix', '__return_false' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -116,13 +116,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // By default, we should get the result.
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->get_search_results( $title );
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array_pop( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post->ID, $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post->ID, $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // After we change the prefix, the result should be excluded.
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'wp_query_search_exclusion_prefix', array( $this, 'filter_search_exclusion_prefix_octothorpe' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $found = $this->get_search_results( $title );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'wp_query_search_exclusion_prefix', array( $this, 'filter_search_exclusion_prefix_octothorpe' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function filter_search_exclusion_prefix_octothorpe() {
</span></span></pre></div>
<a id="trunktestsphpunittestsquerysetupPostdataphp"></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/query/setupPostdata.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/setupPostdata.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/query/setupPostdata.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -165,7 +165,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 0, $GLOBALS['multipage'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 1, $GLOBALS['numpages'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'Page 0' ), $GLOBALS['pages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'Page 0' ), $GLOBALS['pages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_multi_page() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -178,7 +178,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 1, $GLOBALS['multipage'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 4, $GLOBALS['numpages'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $GLOBALS['pages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $GLOBALS['pages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -194,7 +194,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 1, $GLOBALS['multipage'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 3, $GLOBALS['numpages'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'Page 1', 'Page 2', 'Page 3' ), $GLOBALS['pages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'Page 1', 'Page 2', 'Page 3' ), $GLOBALS['pages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_trim_nextpage_linebreaks() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -205,7 +205,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> setup_postdata( $post );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'Page 0', "Page 1\nhas a line break", 'Page 2', "\nPage 3" ), $GLOBALS['pages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'Page 0', "Page 1\nhas a line break", 'Page 2', "\nPage 3" ), $GLOBALS['pages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -411,7 +411,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> setup_postdata( $a_post );
</span><span class="cx" style="display: block; padding: 0 10px"> $content = get_echo( 'the_content' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_id, $GLOBALS['post']->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_id, $GLOBALS['post']->ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( '<p>global post</p>', strip_ws( $content ) );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_reset_postdata();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -427,7 +427,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> setup_postdata( $post );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $GLOBALS['pages'], $this->pages_global );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $GLOBALS['pages'], $this->pages_global );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsquerystickiesphp"></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/query/stickies.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/stickies.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/query/stickies.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,7 +40,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> self::$posts[2],
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $q->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $q->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_stickies_should_be_included_when_is_home_is_true() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,9 +48,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $q = $GLOBALS['wp_query'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$posts[2], $q->posts[0]->ID );
- $this->assertEquals( self::$posts[8], $q->posts[1]->ID );
- $this->assertEquals( self::$posts[14], $q->posts[2]->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$posts[2], $q->posts[0]->ID );
+ $this->assertSame( self::$posts[8], $q->posts[1]->ID );
+ $this->assertSame( self::$posts[14], $q->posts[2]->ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_stickies_should_not_be_included_on_pages_other_than_1() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -82,7 +82,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> self::$posts[9],
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, wp_list_pluck( $q->posts, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, wp_list_pluck( $q->posts, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_stickies_should_obey_post__not_in() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,8 +92,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $q = $GLOBALS['wp_query'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$posts[2], $q->posts[0]->ID );
- $this->assertEquals( self::$posts[14], $q->posts[1]->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$posts[2], $q->posts[0]->ID );
+ $this->assertSame( self::$posts[14], $q->posts[1]->ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( self::$posts[8], wp_list_pluck( $q->posts, 'ID' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsquerytaxQueryphp"></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/query/taxQuery.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/taxQuery.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/query/taxQuery.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1 ), $q->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1 ), $q->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_tax_query_single_query_single_term_field_name() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,7 +64,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1 ), $q->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1 ), $q->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -98,7 +98,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1 ), $q->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1 ), $q->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_tax_query_single_query_single_term_field_term_taxonomy_id() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -129,7 +129,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1 ), $q->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1 ), $q->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_tax_query_single_query_single_term_field_term_id() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -160,7 +160,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1 ), $q->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1 ), $q->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_tax_query_single_query_single_term_operator_in() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -192,7 +192,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1 ), $q->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1 ), $q->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_tax_query_single_query_single_term_operator_not_in() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -224,7 +224,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p2 ), $q->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p2 ), $q->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_tax_query_single_query_single_term_operator_and() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -256,7 +256,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p1 ), $q->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p1 ), $q->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_tax_query_single_query_multiple_terms_operator_in() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -338,7 +338,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p3 ), $q->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p3 ), $q->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -389,7 +389,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p3 ), $q->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p3 ), $q->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_tax_query_single_query_multiple_terms_operator_and() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -430,7 +430,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p2 ), $q->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p2 ), $q->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -659,7 +659,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $p2 ), $q->posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $p2 ), $q->posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_tax_query_multiple_queries_relation_or() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1025,7 +1025,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = $query->get_posts();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1060,7 +1060,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = $query->get_posts();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_tax_query_include_children() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1112,7 +1112,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 4, count( $posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 4, count( $posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = get_posts(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1130,7 +1130,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = get_posts(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1147,7 +1147,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = get_posts(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1165,7 +1165,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = get_posts(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1182,7 +1182,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = get_posts(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1200,7 +1200,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $posts ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $posts ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_tax_query_taxonomy_with_attachments() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1240,7 +1240,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $image_id ), $posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $image_id ), $posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_tax_query_no_taxonomy() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1345,7 +1345,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $posts[0], $posts[1], $posts[2] ), $results1, 'Relation: OR; Operator: AND' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $posts[0], $posts[1], $posts[2] ), $results1, 'Relation: OR; Operator: AND' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $results2 = $q->query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1372,7 +1372,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $posts[0], $posts[3] ), $results2, 'Relation: AND; Operator: IN' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $posts[0], $posts[3] ), $results2, 'Relation: AND; Operator: IN' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1493,7 +1493,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $t, $q->get( 'term_id' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $t, $q->get( 'term_id' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_taxonomy( 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1539,8 +1539,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $c, $q->get( 'cat' ) );
- $this->assertEquals( 'bar', $q->get( 'category_name' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $c, $q->get( 'cat' ) );
+ $this->assertSame( 'bar', $q->get( 'category_name' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_taxonomy( 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1586,7 +1586,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $tag, $q->get( 'tag_id' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $tag, $q->get( 'tag_id' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_taxonomy( 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsqueryvarsphp"></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/query/vars.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/vars.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/query/vars.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,7 +17,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Re-initialise any dynamically-added public query vars:
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'init' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Static public query vars:
</span></span></pre></div>
<a id="trunktestsphpunittestsqueryphp"></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/query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/query.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,10 +22,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $second_query = new WP_Query( array( 'post__in' => array( $nested_post_id ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> while ( $second_query->have_posts() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $second_query->the_post();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_the_ID(), $nested_post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_the_ID(), $nested_post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $first_query->reset_postdata();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_the_ID(), $post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_the_ID(), $post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,7 +34,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_default_query_var() {
</span><span class="cx" style="display: block; padding: 0 10px"> $query = new WP_Query;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $query->get( 'nonexistent' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $query->get( 'nonexistent' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $query->get( 'nonexistent', false ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $query->get( 'nonexistent', true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,7 +49,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( get_feed_link() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 30, get_query_var( 'posts_per_page' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 30, get_query_var( 'posts_per_page' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function filter_posts_per_page( &$query ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -519,7 +519,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'parse_query', array( $this, 'filter_parse_query_to_modify_queried_post_id' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $GLOBALS['wp_query']->is_404() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_id, $GLOBALS['wp_query']->post->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_id, $GLOBALS['wp_query']->post->ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -552,7 +552,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'parse_query', array( $this, 'filter_parse_query_to_modify_queried_post_id' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $GLOBALS['wp_query']->is_404() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_id, $GLOBALS['wp_query']->post->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_id, $GLOBALS['wp_query']->post->ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function filter_parse_query_to_modify_queried_post_id( $query ) {
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestattachmentscontrollerphp"></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/rest-api/rest-attachments-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -155,7 +155,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_parse_disposition( $header, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $header_list = array( $header );
</span><span class="cx" style="display: block; padding: 0 10px"> $parsed = WP_REST_Attachments_Controller::get_filename_from_disposition( $header_list );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $parsed );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $parsed );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_context_param() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -163,8 +163,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/media' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
- $this->assertEquals( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
+ $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Single.
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment_id = $this->factory->attachment->create_object(
</span><span class="cx" style="display: block; padding: 0 10px"> $this->test_file,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -177,8 +177,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/media/' . $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
- $this->assertEquals( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
+ $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_registered_query_params() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -187,7 +187,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $keys = array_keys( $data['endpoints'][0]['args'] );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $keys );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'after',
</span><span class="cx" style="display: block; padding: 0 10px"> 'author',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -237,7 +237,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $keys = array_keys( $data['endpoints'][0]['args'] );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $keys );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'context', 'id' ), $keys );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'context', 'id' ), $keys );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -258,7 +258,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $headers['Allow'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $headers['Allow'], 'GET' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $headers['Allow'], 'GET' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', sprintf( '/wp/v2/media/%d', $id1 ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -267,7 +267,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $headers['Allow'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $headers['Allow'], 'GET, POST, PUT, PATCH, DELETE' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $headers['Allow'], 'GET, POST, PUT, PATCH, DELETE' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -360,7 +360,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/media' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id1, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id1, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> // 'media_type' => 'video'.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'media_type', 'video' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -369,7 +369,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'media_type', 'image' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id1, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id1, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_mime_type() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -383,7 +383,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/media' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id1, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id1, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> // 'mime_type' => 'image/png'.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'mime_type', 'image/png' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -392,7 +392,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'mime_type', 'image/jpeg' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id1, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id1, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_parent() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -416,27 +416,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // All attachments.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/media' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $response->get_data() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $response->get_data() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/media' );
</span><span class="cx" style="display: block; padding: 0 10px"> // Attachments without a parent.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'parent', 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( $attachment_id2, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( $attachment_id2, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Attachments with parent=post_id.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/media' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'parent', $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( $attachment_id, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( $attachment_id, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Attachments with invalid parent.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/media' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'parent', REST_TESTS_IMPOSSIBLY_HIGH_NUMBER );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_invalid_status_param_is_error_response() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -455,7 +455,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 3, $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'rest_invalid_param', $data['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'rest_invalid_param', $data['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_private_status() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -477,9 +477,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Properly authorized users can make the request.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $attachment_id1, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $attachment_id1, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_multiple_statuses() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -510,15 +510,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Properly authorized users can make the request.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $ids = array(
</span><span class="cx" style="display: block; padding: 0 10px"> $data[0]['id'],
</span><span class="cx" style="display: block; padding: 0 10px"> $data[1]['id'],
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $ids );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $attachment_id1, $attachment_id2 ), $ids );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $attachment_id1, $attachment_id2 ), $ids );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_invalid_date() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -563,7 +563,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id2, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id2, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -580,7 +580,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_get_post_response( $response );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'image/jpeg', $data['mime_type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'image/jpeg', $data['mime_type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_sizes() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -604,10 +604,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $original_image_src = wp_get_attachment_image_src( $attachment_id, 'full' );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_image_size( 'rest-api-test' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $image_src[0], $data['media_details']['sizes']['rest-api-test']['source_url'] );
- $this->assertEquals( 'image/jpeg', $data['media_details']['sizes']['rest-api-test']['mime_type'] );
- $this->assertEquals( $original_image_src[0], $data['media_details']['sizes']['full']['source_url'] );
- $this->assertEquals( 'image/jpeg', $data['media_details']['sizes']['full']['mime_type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $image_src[0], $data['media_details']['sizes']['rest-api-test']['source_url'] );
+ $this->assertSame( 'image/jpeg', $data['media_details']['sizes']['rest-api-test']['mime_type'] );
+ $this->assertSame( $original_image_src[0], $data['media_details']['sizes']['full']['source_url'] );
+ $this->assertSame( 'image/jpeg', $data['media_details']['sizes']['full']['mime_type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_sizes_with_no_url() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -648,7 +648,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/media/' . $id1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_inherit_status_with_invalid_parent() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -664,8 +664,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( $attachment_id, $data['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( $attachment_id, $data['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_auto_status_with_invalid_parent_not_authenticated_returns_error() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -699,18 +699,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
- $this->assertEquals( 'image', $data['media_type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
+ $this->assertSame( 'image', $data['media_type'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment = get_post( $data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'My title is very cool', $data['title']['raw'] );
- $this->assertEquals( 'My title is very cool', $attachment->post_title );
- $this->assertEquals( 'This is a better caption.', $data['caption']['raw'] );
- $this->assertEquals( 'This is a better caption.', $attachment->post_excerpt );
- $this->assertEquals( 'Without a description, my attachment is descriptionless.', $data['description']['raw'] );
- $this->assertEquals( 'Without a description, my attachment is descriptionless.', $attachment->post_content );
- $this->assertEquals( 'Alt text is stored outside post schema.', $data['alt_text'] );
- $this->assertEquals( 'Alt text is stored outside post schema.', get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'My title is very cool', $data['title']['raw'] );
+ $this->assertSame( 'My title is very cool', $attachment->post_title );
+ $this->assertSame( 'This is a better caption.', $data['caption']['raw'] );
+ $this->assertSame( 'This is a better caption.', $attachment->post_excerpt );
+ $this->assertSame( 'Without a description, my attachment is descriptionless.', $data['description']['raw'] );
+ $this->assertSame( 'Without a description, my attachment is descriptionless.', $attachment->post_content );
+ $this->assertSame( 'Alt text is stored outside post schema.', $data['alt_text'] );
+ $this->assertSame( 'Alt text is stored outside post schema.', get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_item_default_filename_title() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -728,9 +728,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_header( 'Content-MD5', md5_file( $this->test_file2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'codeispoetry', $data['title']['raw'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'codeispoetry', $data['title']['raw'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_item_with_files() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -748,7 +748,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_header( 'Content-MD5', md5_file( $this->test_file ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_item_with_upload_files_role() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -766,7 +766,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_header( 'Content-MD5', md5_file( $this->test_file ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_item_empty_body() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -875,7 +875,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'alt_text', 'test alt text' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test alt text', $attachment['alt_text'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test alt text', $attachment['alt_text'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_item_unsafe_alt_text() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -887,7 +887,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'alt_text', '<script>alert(document.cookie)</script>' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $attachment['alt_text'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $attachment['alt_text'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -923,14 +923,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment = get_post( $data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'My title is very cool', $data['title']['raw'] );
- $this->assertEquals( 'My title is very cool', $attachment->post_title );
- $this->assertEquals( 'This is a better caption.', $data['caption']['raw'] );
- $this->assertEquals( 'This is a better caption.', $attachment->post_excerpt );
- $this->assertEquals( 'Without a description, my attachment is descriptionless.', $data['description']['raw'] );
- $this->assertEquals( 'Without a description, my attachment is descriptionless.', $attachment->post_content );
- $this->assertEquals( 'Alt text is stored outside post schema.', $data['alt_text'] );
- $this->assertEquals( 'Alt text is stored outside post schema.', get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'My title is very cool', $data['title']['raw'] );
+ $this->assertSame( 'My title is very cool', $attachment->post_title );
+ $this->assertSame( 'This is a better caption.', $data['caption']['raw'] );
+ $this->assertSame( 'This is a better caption.', $attachment->post_excerpt );
+ $this->assertSame( 'Without a description, my attachment is descriptionless.', $data['description']['raw'] );
+ $this->assertSame( 'Without a description, my attachment is descriptionless.', $attachment->post_content );
+ $this->assertSame( 'Alt text is stored outside post schema.', $data['alt_text'] );
+ $this->assertSame( 'Alt text is stored outside post schema.', get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item_parent() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -947,7 +947,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment = get_post( $attachment_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $original_parent, $attachment->post_parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $original_parent, $attachment->post_parent );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_parent = $this->factory->post->create( array() );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/media/' . $attachment_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -955,7 +955,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment = get_post( $attachment_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_parent, $attachment->post_parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_parent, $attachment->post_parent );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item_invalid_permissions() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1010,7 +1010,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( $name, $value );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $actual_output = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Remove <p class="attachment"> from rendered description.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1023,18 +1023,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to actual API output.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['title']['raw'], $actual_output['title']['raw'] );
- $this->assertEquals( $expected_output['title']['rendered'], trim( $actual_output['title']['rendered'] ) );
- $this->assertEquals( $expected_output['description']['raw'], $actual_output['description']['raw'] );
- $this->assertEquals( $expected_output['description']['rendered'], trim( $actual_output['description']['rendered'] ) );
- $this->assertEquals( $expected_output['caption']['raw'], $actual_output['caption']['raw'] );
- $this->assertEquals( $expected_output['caption']['rendered'], trim( $actual_output['caption']['rendered'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['title']['raw'], $actual_output['title']['raw'] );
+ $this->assertSame( $expected_output['title']['rendered'], trim( $actual_output['title']['rendered'] ) );
+ $this->assertSame( $expected_output['description']['raw'], $actual_output['description']['raw'] );
+ $this->assertSame( $expected_output['description']['rendered'], trim( $actual_output['description']['rendered'] ) );
+ $this->assertSame( $expected_output['caption']['raw'], $actual_output['caption']['raw'] );
+ $this->assertSame( $expected_output['caption']['rendered'], trim( $actual_output['caption']['rendered'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to WP internal values.
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $actual_output['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['title']['raw'], $post->post_title );
- $this->assertEquals( $expected_output['description']['raw'], $post->post_content );
- $this->assertEquals( $expected_output['caption']['raw'], $post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['title']['raw'], $post->post_title );
+ $this->assertSame( $expected_output['description']['raw'], $post->post_content );
+ $this->assertSame( $expected_output['caption']['raw'], $post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update the post.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/media/%d', $actual_output['id'] ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1042,7 +1042,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( $name, $value );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $actual_output = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Remove <p class="attachment"> from rendered description.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1055,18 +1055,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to actual API output.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['title']['raw'], $actual_output['title']['raw'] );
- $this->assertEquals( $expected_output['title']['rendered'], trim( $actual_output['title']['rendered'] ) );
- $this->assertEquals( $expected_output['description']['raw'], $actual_output['description']['raw'] );
- $this->assertEquals( $expected_output['description']['rendered'], trim( $actual_output['description']['rendered'] ) );
- $this->assertEquals( $expected_output['caption']['raw'], $actual_output['caption']['raw'] );
- $this->assertEquals( $expected_output['caption']['rendered'], trim( $actual_output['caption']['rendered'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['title']['raw'], $actual_output['title']['raw'] );
+ $this->assertSame( $expected_output['title']['rendered'], trim( $actual_output['title']['rendered'] ) );
+ $this->assertSame( $expected_output['description']['raw'], $actual_output['description']['raw'] );
+ $this->assertSame( $expected_output['description']['rendered'], trim( $actual_output['description']['rendered'] ) );
+ $this->assertSame( $expected_output['caption']['raw'], $actual_output['caption']['raw'] );
+ $this->assertSame( $expected_output['caption']['rendered'], trim( $actual_output['caption']['rendered'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to WP internal values.
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $actual_output['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['title']['raw'], $post->post_title );
- $this->assertEquals( $expected_output['description']['raw'], $post->post_content );
- $this->assertEquals( $expected_output['caption']['raw'], $post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['title']['raw'], $post->post_title );
+ $this->assertSame( $expected_output['description']['raw'], $post->post_content );
+ $this->assertSame( $expected_output['caption']['raw'], $post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public static function attachment_roundtrip_provider() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1265,7 +1265,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'DELETE', '/wp/v2/media/' . $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $request['force'] = true;
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_item_no_trash() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1345,7 +1345,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( '_fields', 'id,slug' );
</span><span class="cx" style="display: block; padding: 0 10px"> $obj = get_post( $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $endpoint->prepare_item_for_response( $obj, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'id',
</span><span class="cx" style="display: block; padding: 0 10px"> 'slug',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1359,7 +1359,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $properties = $data['schema']['properties'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 27, count( $properties ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 27, count( $properties ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'author', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'alt_text', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'caption', $properties );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1418,7 +1418,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'my_custom_int', $data['schema']['properties'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $schema, $data['schema']['properties']['my_custom_int'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $schema, $data['schema']['properties']['my_custom_int'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment_id = $this->factory->attachment->create_object(
</span><span class="cx" style="display: block; padding: 0 10px"> $this->test_file,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1506,8 +1506,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id2, $data[0]['id'] );
- $this->assertEquals( 'image/png', $data[0]['mime_type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id2, $data[0]['id'] );
+ $this->assertSame( 'image/png', $data[0]['mime_type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function additional_field_get_callback( $object, $request ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1575,10 +1575,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'content', $data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'excerpt', $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ), $data['alt_text'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ), $data['alt_text'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 'edit' === $context ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $attachment->post_excerpt, $data['caption']['raw'] );
- $this->assertEquals( $attachment->post_content, $data['description']['raw'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $attachment->post_excerpt, $data['caption']['raw'] );
+ $this->assertSame( $attachment->post_content, $data['description']['raw'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( isset( $data['caption']['raw'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( isset( $data['description']['raw'] ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1586,12 +1586,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $data['media_details'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $attachment->post_parent ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $attachment->post_parent, $data['post'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $attachment->post_parent, $data['post'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $data['post'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_get_attachment_url( $attachment->ID ), $data['source_url'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_get_attachment_url( $attachment->ID ), $data['source_url'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1721,7 +1721,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( file_get_contents( $this->test_file ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 1, self::$rest_insert_attachment_count );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 1, self::$rest_after_insert_attachment_count );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1782,8 +1782,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
- $this->assertEquals( 'Chocolate-dipped, no filling', get_post_meta( $response->get_data()['id'], 'best_cannoli', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
+ $this->assertSame( 'Chocolate-dipped, no filling', get_post_meta( $response->get_data()['id'], 'best_cannoli', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function filter_rest_insert_attachment( $attachment ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1901,7 +1901,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertErrorResponse( 'rest_image_rotation_failed', $response, 500 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, WP_Image_Editor_Mock::$spy['rotate'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( -60 ), WP_Image_Editor_Mock::$spy['rotate'][0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( -60 ), WP_Image_Editor_Mock::$spy['rotate'][0] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1934,7 +1934,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertErrorResponse( 'rest_image_crop_failed', $response, 500 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, WP_Image_Editor_Mock::$spy['crop'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 320.0, 48.0, 64.0, 24.0 ),
</span><span class="cx" style="display: block; padding: 0 10px"> WP_Image_Editor_Mock::$spy['crop'][0]
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1957,8 +1957,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $item = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
- $this->assertEquals( rest_url( '/wp/v2/media/' . $item['id'] ), $response->get_headers()['Location'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
+ $this->assertSame( rest_url( '/wp/v2/media/' . $item['id'] ), $response->get_headers()['Location'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringEndsWith( '-edited.jpg', $item['media_details']['file'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'parent_image', $item['media_details'] );
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestautosavescontrollerphp"></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/rest-api/rest-autosaves-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-autosaves-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-autosaves-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -140,7 +140,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/posts/' . self::$post_id . '/autosaves' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Single.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -147,7 +147,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/posts/' . self::$post_id . '/autosaves/' . self::$autosave_post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -157,7 +157,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $keys = array_keys( $data['endpoints'][0]['args'] );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $keys );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'context',
</span><span class="cx" style="display: block; padding: 0 10px"> 'parent',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -171,10 +171,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/autosaves' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$autosave_post_id, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$autosave_post_id, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_get_autosave_response( $data[0], $this->post_autosave );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -207,7 +207,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/autosaves/' . self::$autosave_post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_get_autosave_response( $response, $this->post_autosave );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -277,7 +277,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/autosaves/' . self::$autosave_post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->check_get_autosave_response( $response, $this->post_autosave );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -286,7 +286,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $properties = $data['schema']['properties'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 13, count( $properties ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 13, count( $properties ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'author', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'content', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'date', $properties );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -377,17 +377,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $current_post->ID, $new_data['parent'] );
- $this->assertEquals( $current_post->post_title, $new_data['title']['raw'] );
- $this->assertEquals( $current_post->post_excerpt, $new_data['excerpt']['raw'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $current_post->ID, $new_data['parent'] );
+ $this->assertSame( $current_post->post_title, $new_data['title']['raw'] );
+ $this->assertSame( $current_post->post_excerpt, $new_data['excerpt']['raw'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Updated post_content.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $current_post->post_content, $new_data['content']['raw'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $autosave_post = wp_get_post_autosave( self::$post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $autosave_data['title'], $autosave_post->post_title );
- $this->assertEquals( $autosave_data['content'], $autosave_post->post_content );
- $this->assertEquals( $autosave_data['excerpt'], $autosave_post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $autosave_data['title'], $autosave_post->post_title );
+ $this->assertSame( $autosave_data['content'], $autosave_post->post_content );
+ $this->assertSame( $autosave_data['excerpt'], $autosave_post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_autosave_draft_post_same_author() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -414,15 +414,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_id, $new_data['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_id, $new_data['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> // The draft post should be updated.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $autosave_data['content'], $new_data['content']['raw'] );
- $this->assertEquals( $autosave_data['title'], $new_data['title']['raw'] );
- $this->assertEquals( $autosave_data['content'], $post->post_content );
- $this->assertEquals( $autosave_data['title'], $post->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $autosave_data['content'], $new_data['content']['raw'] );
+ $this->assertSame( $autosave_data['title'], $new_data['title']['raw'] );
+ $this->assertSame( $autosave_data['content'], $post->post_content );
+ $this->assertSame( $autosave_data['title'], $post->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Not updated.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_data['post_excerpt'], $post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_data['post_excerpt'], $post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -453,21 +453,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $current_post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $current_post->ID, $new_data['parent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $current_post->ID, $new_data['parent'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The draft post shouldn't change.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $current_post->post_title, $post_data['post_title'] );
- $this->assertEquals( $current_post->post_content, $post_data['post_content'] );
- $this->assertEquals( $current_post->post_excerpt, $post_data['post_excerpt'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $current_post->post_title, $post_data['post_title'] );
+ $this->assertSame( $current_post->post_content, $post_data['post_content'] );
+ $this->assertSame( $current_post->post_excerpt, $post_data['post_excerpt'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $autosave_post = wp_get_post_autosave( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // No changes.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $current_post->post_title, $autosave_post->post_title );
- $this->assertEquals( $current_post->post_excerpt, $autosave_post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $current_post->post_title, $autosave_post->post_title );
+ $this->assertSame( $current_post->post_excerpt, $autosave_post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Has changes.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $autosave_data['content'], $autosave_post->post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $autosave_data['content'], $autosave_post->post_content );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -496,7 +496,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'my_custom_int', $data['schema']['properties'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $schema, $data['schema']['properties']['my_custom_int'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $schema, $data['schema']['properties']['my_custom_int'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -529,27 +529,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $autosave->post_author, $response['author'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $rendered_content = apply_filters( 'the_content', $autosave->post_content );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $rendered_content, $response['content']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $rendered_content, $response['content']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( mysql_to_rfc3339( $autosave->post_date ), $response['date'] ); //@codingStandardsIgnoreLine
- $this->assertEquals( mysql_to_rfc3339( $autosave->post_date_gmt ), $response['date_gmt'] ); //@codingStandardsIgnoreLine
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( mysql_to_rfc3339( $autosave->post_date ), $response['date'] ); //@codingStandardsIgnoreLine
+ $this->assertSame( mysql_to_rfc3339( $autosave->post_date_gmt ), $response['date_gmt'] ); //@codingStandardsIgnoreLine
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $rendered_guid = apply_filters( 'get_the_guid', $autosave->guid, $autosave->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $rendered_guid, $response['guid']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $rendered_guid, $response['guid']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $autosave->ID, $response['id'] );
- $this->assertEquals( mysql_to_rfc3339( $autosave->post_modified ), $response['modified'] ); //@codingStandardsIgnoreLine
- $this->assertEquals( mysql_to_rfc3339( $autosave->post_modified_gmt ), $response['modified_gmt'] ); //@codingStandardsIgnoreLine
- $this->assertEquals( $autosave->post_name, $response['slug'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $autosave->ID, $response['id'] );
+ $this->assertSame( mysql_to_rfc3339( $autosave->post_modified ), $response['modified'] ); //@codingStandardsIgnoreLine
+ $this->assertSame( mysql_to_rfc3339( $autosave->post_modified_gmt ), $response['modified_gmt'] ); //@codingStandardsIgnoreLine
+ $this->assertSame( $autosave->post_name, $response['slug'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $rendered_title = get_the_title( $autosave->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $rendered_title, $response['title']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $rendered_title, $response['title']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $parent = get_post( $autosave->post_parent );
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_controller = new WP_REST_Posts_Controller( $parent->post_type );
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_object = get_post_type_object( $parent->post_type );
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_base = ! empty( $parent_object->rest_base ) ? $parent_object->rest_base : $parent_object->name;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( rest_url( '/wp/v2/' . $parent_base . '/' . $autosave->post_parent ), $links['parent'][0]['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( rest_url( '/wp/v2/' . $parent_base . '/' . $autosave->post_parent ), $links['parent'][0]['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_sets_up_postdata() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -560,8 +560,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post();
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_post_id = wp_is_post_revision( $post->ID );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post->ID, self::$autosave_post_id );
- $this->assertEquals( $parent_post_id, self::$post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post->ID, self::$autosave_post_id );
+ $this->assertSame( $parent_post_id, self::$post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item_draft_page_with_parent() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -580,8 +580,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$child_draft_page_id, $data['id'] );
- $this->assertEquals( self::$parent_page_id, $data['parent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$child_draft_page_id, $data['id'] );
+ $this->assertSame( self::$parent_page_id, $data['parent'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_schema_validation_is_applied() {
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestblockdirectorycontrollerphp"></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/rest-api/rest-block-directory-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-block-directory-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-block-directory-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,8 +60,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/block-directory/search' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
- $this->assertEquals( array( 'view' ), $data['endpoints'][0]['args']['context']['enum'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
+ $this->assertSame( array( 'view' ), $data['endpoints'][0]['args']['context']['enum'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,7 +75,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = rest_do_request( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $result->as_error() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $result->status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $result->status );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -116,8 +116,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Should produce a 200 status with an empty array.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->status );
- $this->assertEquals( array(), $data );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->status );
+ $this->assertSame( array(), $data );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -166,7 +166,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'humanized_updated' => sprintf( '%s ago', human_time_diff( strtotime( $plugin['last_updated'] ) ) ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $response->get_data() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $response->get_data() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -181,7 +181,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check endpoints
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'GET' ), $data['endpoints'][0]['methods'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'GET' ), $data['endpoints'][0]['methods'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['endpoints'][0]['args']['term']['required'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $properties = $data['schema']['properties'];
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestblockrenderercontrollerphp"></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/rest-api/rest-block-renderer-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -335,7 +335,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 400, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 400, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -356,7 +356,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 400, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 400, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -381,10 +381,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'context', 'edit' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'attributes', array() );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $defaults, json_decode( $data['rendered'], true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $defaults, json_decode( $data['rendered'], true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals(
</span><span class="cx" style="display: block; padding: 0 10px"> json_decode( $block_type->render( $defaults ) ),
</span><span class="cx" style="display: block; padding: 0 10px"> json_decode( $data['rendered'] )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -416,10 +416,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'context', 'edit' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'attributes', $attributes );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_attributes, json_decode( $data['rendered'], true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_attributes, json_decode( $data['rendered'], true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals(
</span><span class="cx" style="display: block; padding: 0 10px"> json_decode( $block_type->render( $attributes ), true ),
</span><span class="cx" style="display: block; padding: 0 10px"> json_decode( $data['rendered'], true )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -451,10 +451,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'context', 'edit' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'attributes', $attributes );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<p>Alternate content.</p>', $data['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<p>Alternate content.</p>', $data['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'pre_render_block', $pre_render_filter );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -474,7 +474,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Test without post ID.
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( empty( $data['rendered'] ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -483,10 +483,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'post_id', self::$post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_title, $data['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_title, $data['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -504,7 +504,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( compact( 'attributes' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $string_attribute, $response->get_data()['rendered'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -578,7 +578,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'context', 'edit' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'attributes', $attributes );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $expected, json_decode( $data['rendered'], true ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -601,14 +601,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'name', 'context', 'attributes', 'post_id' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array_keys( $data['endpoints'][0]['args'] )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'object', $data['endpoints'][0]['args']['attributes']['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'object', $data['endpoints'][0]['args']['attributes']['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'schema', $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'rendered-block', $data['schema']['title'] );
- $this->assertEquals( 'object', $data['schema']['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'rendered-block', $data['schema']['title'] );
+ $this->assertSame( 'object', $data['schema']['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->arrayHasKey( 'rendered', $data['schema']['properties'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->arrayHasKey( 'string', $data['schema']['properties']['rendered']['type'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'edit' ), $data['schema']['properties']['rendered']['context'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'edit' ), $data['schema']['properties']['rendered']['context'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestblocktypecontrollerphp"></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/rest-api/rest-block-type-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-block-type-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-block-type-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -91,14 +91,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/block-types' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
- $this->assertEquals( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
+ $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Single.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/block-types/fake/test' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
- $this->assertEquals( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
+ $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -230,14 +230,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/block-types/' . $block_type );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $block_type, $data['name'] );
- $this->assertEquals( '1', $data['title'] );
- $this->assertEquals( '1', $data['description'] );
- $this->assertEquals( null, $data['icon'] );
- $this->assertEquals( null, $data['editor_script'] );
- $this->assertEquals( null, $data['script'] );
- $this->assertEquals( null, $data['editor_style'] );
- $this->assertEquals( null, $data['style'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $block_type, $data['name'] );
+ $this->assertSame( '1', $data['title'] );
+ $this->assertSame( '1', $data['description'] );
+ $this->assertNull( $data['icon'] );
+ $this->assertNull( $data['editor_script'] );
+ $this->assertNull( $data['script'] );
+ $this->assertNull( $data['editor_style'] );
+ $this->assertNull( $data['style'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array(), $data['provides_context'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array(), $data['attributes'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'invalid_uses_context' ), $data['uses_context'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -245,10 +245,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'invalid_parent' ), $data['parent'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array(), $data['supports'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array(), $data['styles'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( null, $data['example'] );
- $this->assertEquals( null, $data['category'] );
- $this->assertEquals( null, $data['textdomain'] );
- $this->assertFalse( false, $data['is_dynamic'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $data['example'] );
+ $this->assertNull( $data['category'] );
+ $this->assertNull( $data['textdomain'] );
+ $this->assertFalse( $data['is_dynamic'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -281,14 +281,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/block-types/' . $block_type );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $block_type, $data['name'] );
- $this->assertEquals( '', $data['title'] );
- $this->assertEquals( '', $data['description'] );
- $this->assertEquals( null, $data['icon'] );
- $this->assertEquals( null, $data['editor_script'] );
- $this->assertEquals( null, $data['script'] );
- $this->assertEquals( null, $data['editor_style'] );
- $this->assertEquals( null, $data['style'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $block_type, $data['name'] );
+ $this->assertSame( '', $data['title'] );
+ $this->assertSame( '', $data['description'] );
+ $this->assertNull( $data['icon'] );
+ $this->assertNull( $data['editor_script'] );
+ $this->assertNull( $data['script'] );
+ $this->assertNull( $data['editor_style'] );
+ $this->assertNull( $data['style'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array(), $data['attributes'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array(), $data['provides_context'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array(), $data['uses_context'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -296,11 +296,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array(), $data['parent'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array(), $data['supports'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array(), $data['styles'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( null, $data['example'] );
- $this->assertEquals( null, $data['category'] );
- $this->assertEquals( null, $data['example'] );
- $this->assertEquals( null, $data['textdomain'] );
- $this->assertFalse( false, $data['is_dynamic'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $data['example'] );
+ $this->assertNull( $data['category'] );
+ $this->assertNull( $data['example'] );
+ $this->assertNull( $data['textdomain'] );
+ $this->assertFalse( $data['is_dynamic'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -408,7 +408,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'context', 'edit' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( '_fields', 'name' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $endpoint->prepare_item_for_response( $block_type, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'name',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -427,8 +427,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function check_block_type_object( $block_type, $data, $links ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Test data.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $data['attributes'], $block_type->get_attributes() );
- $this->assertEquals( $data['is_dynamic'], $block_type->is_dynamic() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $data['attributes'], $block_type->get_attributes() );
+ $this->assertSame( $data['is_dynamic'], $block_type->is_dynamic() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $extra_fields = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'name',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -452,13 +452,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $extra_fields as $extra_field ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $block_type->$extra_field ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $data[ $extra_field ], $block_type->$extra_field );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $data[ $extra_field ], $block_type->$extra_field );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test links.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( rest_url( 'wp/v2/block-types' ), $links['collection'][0]['href'] );
- $this->assertEquals( rest_url( 'wp/v2/block-types/' . $block_type->name ), $links['self'][0]['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( rest_url( 'wp/v2/block-types' ), $links['collection'][0]['href'] );
+ $this->assertSame( rest_url( 'wp/v2/block-types/' . $block_type->name ), $links['self'][0]['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $block_type->is_dynamic() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'https://api.w.org/render-block', $links );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestblockscontrollerphp"></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/rest-api/rest-blocks-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-blocks-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-blocks-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -133,7 +133,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_status, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_status, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -141,7 +141,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/blocks/' . self::$post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_status, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_status, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -165,12 +165,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_status, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_status, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'DELETE', '/wp/v2/blocks/' . $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_status, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_status, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,12 +186,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_status, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_status, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'DELETE', '/wp/v2/blocks/' . self::$post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_status, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_status, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -212,13 +212,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'raw' => 'My cool block',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $data['title']
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'raw' => '<!-- wp:paragraph --><p>Hello!</p><!-- /wp:paragraph -->',
</span><span class="cx" style="display: block; padding: 0 10px"> 'protected' => false,
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestcategoriescontrollerphp"></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/rest-api/rest-categories-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-categories-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-categories-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,7 +117,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/categories' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px"> // Single.
</span><span class="cx" style="display: block; padding: 0 10px"> $category1 = $this->factory->category->create( array( 'name' => 'Season 5' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -124,7 +124,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/categories/' . $category1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -134,7 +134,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $keys = array_keys( $data['endpoints'][0]['args'] );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $keys );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'context',
</span><span class="cx" style="display: block; padding: 0 10px"> 'exclude',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -183,15 +183,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'hide_empty', true );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
- $this->assertEquals( 'Season 5', $data[0]['name'] );
- $this->assertEquals( 'The Be Sharps', $data[1]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
+ $this->assertSame( 'Season 5', $data[0]['name'] );
+ $this->assertSame( 'The Be Sharps', $data[1]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Confirm the empty category "Uncategorized" category appears.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'hide_empty', 'false' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_categories, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_categories, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_parent_zero_arg() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -215,7 +215,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'parent', 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -223,7 +223,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'parent' => 0,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $categories = get_terms( 'category', $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( count( $categories ), count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( count( $categories ), count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_parent_zero_arg_string() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -247,7 +247,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'parent', '0' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -255,7 +255,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'parent' => 0,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $categories = get_terms( 'category', $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( count( $categories ), count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( count( $categories ), count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_by_parent_non_found() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -265,10 +265,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'parent', $parent1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $data );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $data );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_invalid_page() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -291,15 +291,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'include', array( $id2, $id1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
- $this->assertEquals( $id1, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
+ $this->assertSame( $id1, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // 'orderby' => 'include'.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'include' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
- $this->assertEquals( $id2, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
+ $this->assertSame( $id2, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_exclude_query() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -337,10 +337,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'order', 'desc' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'per_page', 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( 'Uncategorized', $data[0]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( 'Uncategorized', $data[0]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/categories' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'name' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -347,10 +347,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'order', 'asc' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'per_page', 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
- $this->assertEquals( 'Apple', $data[0]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
+ $this->assertSame( 'Apple', $data[0]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_orderby_id() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -361,21 +361,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Defaults to 'orderby' => 'name', 'order' => 'asc'.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/categories' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Apple', $data[0]['name'] );
- $this->assertEquals( 'Banana', $data[1]['name'] );
- $this->assertEquals( 'Cantaloupe', $data[2]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Apple', $data[0]['name'] );
+ $this->assertSame( 'Banana', $data[1]['name'] );
+ $this->assertSame( 'Cantaloupe', $data[2]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // 'orderby' => 'id', with default 'order' => 'asc'.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/categories' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'id' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Category 0', $data[1]['name'] );
- $this->assertEquals( 'Category 1', $data[2]['name'] );
- $this->assertEquals( 'Category 2', $data[3]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Category 0', $data[1]['name'] );
+ $this->assertSame( 'Category 1', $data[2]['name'] );
+ $this->assertSame( 'Category 2', $data[3]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // 'orderby' => 'id', 'order' => 'desc'.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/categories' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -383,10 +383,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'order', 'desc' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( 'Banana', $data[0]['name'] );
- $this->assertEquals( 'Apple', $data[1]['name'] );
- $this->assertEquals( 'Cantaloupe', $data[2]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( 'Banana', $data[0]['name'] );
+ $this->assertSame( 'Apple', $data[1]['name'] );
+ $this->assertSame( 'Cantaloupe', $data[2]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_orderby_slugs() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -399,10 +399,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'slug', array( 'taco', 'burrito', 'chalupa' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( 'taco', $data[0]['slug'] );
- $this->assertEquals( 'burrito', $data[1]['slug'] );
- $this->assertEquals( 'chalupa', $data[2]['slug'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( 'taco', $data[0]['slug'] );
+ $this->assertSame( 'burrito', $data[1]['slug'] );
+ $this->assertSame( 'chalupa', $data[2]['slug'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected function post_with_categories() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -436,14 +436,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/categories' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'post', $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check ordered by name by default.
</span><span class="cx" style="display: block; padding: 0 10px"> $names = wp_list_pluck( $data, 'name' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'DC', 'Image', 'Marvel' ), $names );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'DC', 'Image', 'Marvel' ), $names );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_post_ordered_by_description() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -454,22 +454,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'post', $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'description' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $names = wp_list_pluck( $data, 'name' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'Image', 'Marvel', 'DC' ), $names, 'Terms should be ordered by description' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'Image', 'Marvel', 'DC' ), $names, 'Terms should be ordered by description' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Flip the order.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'order', 'desc' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $names = wp_list_pluck( $data, 'name' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'DC', 'Marvel', 'Image' ), $names, 'Terms should be reverse-ordered by description' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'DC', 'Marvel', 'Image' ), $names, 'Terms should be reverse-ordered by description' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_post_ordered_by_id() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -479,12 +479,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'post', $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'id' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $names = wp_list_pluck( $data, 'name' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'DC', 'Marvel', 'Image' ), $names );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'DC', 'Marvel', 'Image' ), $names );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_custom_tax_post_args() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -515,11 +515,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/batman' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'post', $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
- $this->assertEquals( 'Cape', $data[0]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
+ $this->assertSame( 'Cape', $data[0]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_search_args() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -533,17 +533,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/categories' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'search', 'App' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( 'Apple', $data[0]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( 'Apple', $data[0]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/categories' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'search', 'Garbage' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_slug_arg() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -553,10 +553,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/categories' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'slug', 'apple' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( 'Apple', $data[0]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( 'Apple', $data[0]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_terms_parent_arg() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -572,8 +572,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'parent', $category1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( 'Child', $data[0]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( 'Child', $data[0]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_terms_invalid_parent_arg() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -617,8 +617,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/categories' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_categories, $headers['X-WP-Total'] );
- $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_categories, $headers['X-WP-Total'] );
+ $this->assertSame( $total_pages, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 10, $response->get_data() );
</span><span class="cx" style="display: block; padding: 0 10px"> $next_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -637,8 +637,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'page', 3 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_categories, $headers['X-WP-Total'] );
- $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_categories, $headers['X-WP-Total'] );
+ $this->assertSame( $total_pages, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 10, $response->get_data() );
</span><span class="cx" style="display: block; padding: 0 10px"> $prev_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -660,8 +660,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'page', $total_pages );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_categories, $headers['X-WP-Total'] );
- $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_categories, $headers['X-WP-Total'] );
+ $this->assertSame( $total_pages, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $response->get_data() );
</span><span class="cx" style="display: block; padding: 0 10px"> $prev_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -677,8 +677,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'page', 100 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_categories, $headers['X-WP-Total'] );
- $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_categories, $headers['X-WP-Total'] );
+ $this->assertSame( $total_pages, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 0, $response->get_data() );
</span><span class="cx" style="display: block; padding: 0 10px"> $prev_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -697,8 +697,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'per_page', 100 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$total_categories, $headers['X-WP-Total'] );
- $this->assertEquals( 1, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$total_categories, $headers['X-WP-Total'] );
+ $this->assertSame( 1, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( self::$total_categories, $response->get_data() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/categories' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -706,8 +706,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'per_page', 100 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$total_categories, $headers['X-WP-Total'] );
- $this->assertEquals( 1, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$total_categories, $headers['X-WP-Total'] );
+ $this->assertSame( 1, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 0, $response->get_data() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -807,13 +807,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'description', 'This term is so awesome.' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'slug', 'so-awesome' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '/wp/v2/categories/' . $data['id'], $headers['Location'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'My Awesome Term', $data['name'] );
- $this->assertEquals( 'This term is so awesome.', $data['description'] );
- $this->assertEquals( 'so-awesome', $data['slug'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'My Awesome Term', $data['name'] );
+ $this->assertSame( 'This term is so awesome.', $data['description'] );
+ $this->assertSame( 'so-awesome', $data['slug'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -828,10 +828,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'name', 'Existing' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 400, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 400, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'term_exists', $data['code'] );
- $this->assertEquals( $existing_id, (int) $data['data']['term_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'term_exists', $data['code'] );
+ $this->assertSame( $existing_id, (int) $data['data']['term_id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_term( $existing_id, 'category' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -880,9 +880,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'name', 'My Awesome Term' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'parent', $parent['term_id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $parent['term_id'], $data['parent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $parent['term_id'], $data['parent'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_item_invalid_parent() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -906,9 +906,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'name', 'My Awesome Term' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'parent', $parent );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $parent, $data['parent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $parent, $data['parent'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -935,13 +935,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'New Name', $data['name'] );
- $this->assertEquals( 'New Description', $data['description'] );
- $this->assertEquals( 'new-slug', $data['slug'] );
- $this->assertEquals( 'just meta', $data['meta']['test_single'] );
- $this->assertEquals( 'category-specific meta', $data['meta']['test_cat_single'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'New Name', $data['name'] );
+ $this->assertSame( 'New Description', $data['description'] );
+ $this->assertSame( 'new-slug', $data['slug'] );
+ $this->assertSame( 'just meta', $data['meta']['test_single'] );
+ $this->assertSame( 'category-specific meta', $data['meta']['test_cat_single'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( isset( $data['meta']['test_tag_meta'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -983,10 +983,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/categories/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'parent', $parent->term_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $parent->term_id, $data['parent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $parent->term_id, $data['parent'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item_remove_parent() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1005,15 +1005,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'category'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $old_parent_term->term_id, $term->parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $old_parent_term->term_id, $term->parent );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/categories/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'parent', $new_parent_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_parent_id, $data['parent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_parent_id, $data['parent'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item_invalid_parent() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1035,10 +1035,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'DELETE', '/wp/v2/categories/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'force', true );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['deleted'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Deleted Category', $data['previous']['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Deleted Category', $data['previous']['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_item_no_trash() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1096,7 +1096,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( '_fields', 'id,name' );
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term( 1, 'category' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $endpoint->prepare_item_for_response( $term, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'id',
</span><span class="cx" style="display: block; padding: 0 10px"> 'name',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1119,10 +1119,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_taxonomy_term( $term, $data, $response->get_links() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $data['parent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $data['parent'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $links = $response->get_links();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( rest_url( 'wp/v2/categories/1' ), $links['up'][0]['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( rest_url( 'wp/v2/categories/1' ), $links['up'][0]['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_schema() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1130,7 +1130,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $properties = $data['schema']['properties'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 9, count( $properties ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 9, count( $properties ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'id', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'count', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'description', $properties );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1140,7 +1140,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'parent', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'slug', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'taxonomy', $properties );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array_keys( get_taxonomies() ), $properties['taxonomy']['enum'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array_keys( get_taxonomies() ), $properties['taxonomy']['enum'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_additional_field_registration() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1166,7 +1166,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'my_custom_int', $data['schema']['properties'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $schema, $data['schema']['properties']['my_custom_int'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $schema, $data['schema']['properties']['my_custom_int'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $category_id = $this->factory->category->create();
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/categories/' . $category_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1189,31 +1189,31 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected function check_get_taxonomy_terms_response( $response ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $args = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'hide_empty' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $categories = get_terms( 'category', $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( count( $categories ), count( $data ) );
- $this->assertEquals( $categories[0]->term_id, $data[0]['id'] );
- $this->assertEquals( $categories[0]->name, $data[0]['name'] );
- $this->assertEquals( $categories[0]->slug, $data[0]['slug'] );
- $this->assertEquals( $categories[0]->taxonomy, $data[0]['taxonomy'] );
- $this->assertEquals( $categories[0]->description, $data[0]['description'] );
- $this->assertEquals( $categories[0]->count, $data[0]['count'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( count( $categories ), count( $data ) );
+ $this->assertSame( $categories[0]->term_id, $data[0]['id'] );
+ $this->assertSame( $categories[0]->name, $data[0]['name'] );
+ $this->assertSame( $categories[0]->slug, $data[0]['slug'] );
+ $this->assertSame( $categories[0]->taxonomy, $data[0]['taxonomy'] );
+ $this->assertSame( $categories[0]->description, $data[0]['description'] );
+ $this->assertSame( $categories[0]->count, $data[0]['count'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected function check_taxonomy_term( $term, $data, $links ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $term->term_id, $data['id'] );
- $this->assertEquals( $term->name, $data['name'] );
- $this->assertEquals( $term->slug, $data['slug'] );
- $this->assertEquals( $term->description, $data['description'] );
- $this->assertEquals( get_term_link( $term ), $data['link'] );
- $this->assertEquals( $term->count, $data['count'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $term->term_id, $data['id'] );
+ $this->assertSame( $term->name, $data['name'] );
+ $this->assertSame( $term->slug, $data['slug'] );
+ $this->assertSame( $term->description, $data['description'] );
+ $this->assertSame( get_term_link( $term ), $data['link'] );
+ $this->assertSame( $term->count, $data['count'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $taxonomy = get_taxonomy( $term->taxonomy );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $taxonomy->hierarchical ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $term->parent, $data['parent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $term->parent, $data['parent'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( isset( $term->parent ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1231,12 +1231,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( $relations, array_keys( $links ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'wp/v2/taxonomies/' . $term->taxonomy, $links['about'][0]['href'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( add_query_arg( 'categories', $term->term_id, rest_url( 'wp/v2/posts' ) ), $links['https://api.w.org/post_type'][0]['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( add_query_arg( 'categories', $term->term_id, rest_url( 'wp/v2/posts' ) ), $links['https://api.w.org/post_type'][0]['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected function check_get_taxonomy_term_response( $response ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $category = get_term( 1, 'category' );
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestcommentscontrollerphp"></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/rest-api/rest-comments-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -172,14 +172,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
- $this->assertEquals( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
+ $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Single.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/comments/' . self::$approved_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
- $this->assertEquals( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
+ $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_registered_query_params() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -188,7 +188,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $keys = array_keys( $data['endpoints'][0]['args'] );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $keys );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'after',
</span><span class="cx" style="display: block; padding: 0 10px"> 'author',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -220,7 +220,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'per_page', self::$per_page );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comments = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( self::$total_comments, $comments );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -244,7 +244,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'post', self::$password_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $collection_data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( in_array( $password_comment, wp_list_pluck( $collection_data, 'id' ), true ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -267,7 +267,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'password', 'toomanysecrets' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $collection_data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( in_array( $password_comment, wp_list_pluck( $collection_data, 'id' ), true ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -307,7 +307,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $collection_data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( in_array( $password_comment, wp_list_pluck( $collection_data, 'id' ), true ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -326,7 +326,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $collection_data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( in_array( $password_comment, wp_list_pluck( $collection_data, 'id' ), true ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -345,7 +345,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $collection_data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( in_array( $private_comment, wp_list_pluck( $collection_data, 'id' ), true ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -364,7 +364,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $collection_data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( in_array( $private_comment, wp_list_pluck( $collection_data, 'id' ), true ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -383,7 +383,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $collection_data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( in_array( $comment_id, wp_list_pluck( $collection_data, 'id' ), true ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -404,7 +404,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $collection_data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( in_array( $comment_id, wp_list_pluck( $collection_data, 'id' ), true ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -429,7 +429,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'post', 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $comments = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $comments );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -449,7 +449,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'context', 'edit' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_for_post() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -464,7 +464,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comments = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $comments );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -488,15 +488,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'include', array( $id2, $id1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
- $this->assertEquals( $id1, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
+ $this->assertSame( $id1, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // 'orderby' => 'include'.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'include' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
- $this->assertEquals( $id2, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
+ $this->assertSame( $id2, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Invalid 'orderby' should error.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'invalid' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -581,13 +581,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Order defaults to 'desc'.
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // 'order' => 'asc'.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'order', 'asc' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$approved_id, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$approved_id, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // 'order' => 'asc,id' should error.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'order', 'asc,id' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -626,7 +626,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'author', self::$author_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $comments = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $comments );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -633,7 +633,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Multiple authors are supported.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'author', array( self::$author_id, self::$subscriber_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $comments = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $comments );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -678,7 +678,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'per_page', self::$per_page );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'author_exclude', self::$author_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $comments = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( $total_comments - 1, $comments );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -687,7 +687,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'per_page', self::$per_page );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'author_exclude', array( self::$author_id, self::$subscriber_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $comments = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( $total_comments - 2, $comments );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -800,7 +800,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_comments_pagination_headers() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -813,8 +813,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_comments, $headers['X-WP-Total'] );
- $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_comments, $headers['X-WP-Total'] );
+ $this->assertSame( $total_pages, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $next_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'page' => 2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -836,8 +836,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'page', 3 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_comments, $headers['X-WP-Total'] );
- $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_comments, $headers['X-WP-Total'] );
+ $this->assertSame( $total_pages, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $prev_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'page' => 2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -858,8 +858,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'page', $total_pages );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_comments, $headers['X-WP-Total'] );
- $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_comments, $headers['X-WP-Total'] );
+ $this->assertSame( $total_pages, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $prev_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'page' => $total_pages - 1,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -874,7 +874,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'page', 100 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_comments, $headers['X-WP-Total'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_comments, $headers['X-WP-Total'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $prev_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -920,7 +920,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $comment2, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $comment2, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -927,7 +927,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/comments/%d', self::$approved_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_comment_data( $data, 'view', $response->get_links() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -944,7 +944,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_comment_data( $data, 'edit', $response->get_links() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -959,7 +959,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( '_fields', 'id,status' );
</span><span class="cx" style="display: block; padding: 0 10px"> $obj = get_comment( self::$approved_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $endpoint->prepare_item_for_response( $obj, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'id',
</span><span class="cx" style="display: block; padding: 0 10px"> 'status',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -981,7 +981,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( self::$approved_id );
</span><span class="cx" style="display: block; padding: 0 10px"> // Ignore the subdomain, since get_avatar_url() randomly sets
</span><span class="cx" style="display: block; padding: 0 10px"> // the Gravatar server when building the URL string.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( substr( get_avatar_url( $comment->comment_author_email ), 9 ), substr( $data['author_avatar_urls'][96], 9 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( substr( get_avatar_url( $comment->comment_author_email ), 9 ), substr( $data['author_avatar_urls'][96], 9 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_comment_invalid_id() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1043,7 +1043,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/comments/%d', self::$hold_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_comment_with_children_link() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1066,7 +1066,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/comments/%s', $comment_id_1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'children', $response->get_links() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1081,7 +1081,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/comments/%s', $comment_id_1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'children', $response->get_links() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1117,7 +1117,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'password', 'toomanysecrets' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1137,13 +1137,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_comment_data( $data, 'edit', $response->get_links() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'hold', $data['status'] );
- $this->assertEquals( '2014-11-07T10:14:25', $data['date'] );
- $this->assertEquals( self::$post_id, $data['post'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'hold', $data['status'] );
+ $this->assertSame( '2014-11-07T10:14:25', $data['date'] );
+ $this->assertSame( self::$post_id, $data['post'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function comment_dates_provider() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1212,17 +1212,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'timezone_string', '' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $data['id'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $results['date'], $data['date'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $results['date'], $data['date'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $comment_date = str_replace( 'T', ' ', $results['date'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $comment_date, $comment->comment_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $comment_date, $comment->comment_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $results['date_gmt'], $data['date_gmt'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $results['date_gmt'], $data['date_gmt'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $comment_date_gmt = str_replace( 'T', ' ', $results['date_gmt'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $comment_date_gmt, $comment->comment_date_gmt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $comment_date_gmt, $comment->comment_date_gmt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_item_using_accepted_content_raw_value() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1243,11 +1243,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $new_comment = get_comment( $data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $params['content']['raw'], $new_comment->comment_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $params['content']['raw'], $new_comment->comment_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_item_error_from_filter() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1443,11 +1443,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->add_header( 'content-type', 'application/json' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $subscriber_id, $data['author'] );
- $this->assertEquals( '127.0.0.1', $data['author_ip'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $subscriber_id, $data['author'] );
+ $this->assertSame( '127.0.0.1', $data['author_ip'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_comment_without_type() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1470,10 +1470,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'comment', $data['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'comment', $data['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment_id = $data['id'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1482,7 +1482,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $collection->set_param( 'post', $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $collection_response = rest_get_server()->dispatch( $collection );
</span><span class="cx" style="display: block; padding: 0 10px"> $collection_data = $collection_response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $comment_id, $collection_data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $comment_id, $collection_data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1559,16 +1559,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user_id, $data['author'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user_id, $data['author'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check author data matches.
</span><span class="cx" style="display: block; padding: 0 10px"> $author = get_user_by( 'id', $user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $author->display_name, $comment->comment_author );
- $this->assertEquals( $author->user_email, $comment->comment_author_email );
- $this->assertEquals( $author->user_url, $comment->comment_author_url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $author->display_name, $comment->comment_author );
+ $this->assertSame( $author->user_email, $comment->comment_author_email );
+ $this->assertSame( $author->user_url, $comment->comment_author_url );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_comment_other_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1588,12 +1588,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$subscriber_id, $data['author'] );
- $this->assertEquals( 'Homer Jay Simpson', $data['author_name'] );
- $this->assertEquals( 'chunkylover53@aol.com', $data['author_email'] );
- $this->assertEquals( 'http://compuglobalhypermeganet.com', $data['author_url'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$subscriber_id, $data['author'] );
+ $this->assertSame( 'Homer Jay Simpson', $data['author_name'] );
+ $this->assertSame( 'chunkylover53@aol.com', $data['author_email'] );
+ $this->assertSame( 'http://compuglobalhypermeganet.com', $data['author_url'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_comment_other_user_without_permission() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1678,12 +1678,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'approved', $data['status'] );
- $this->assertEquals( '139.130.4.5', $data['author_ip'] );
- $this->assertEquals( 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36', $data['author_user_agent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'approved', $data['status'] );
+ $this->assertSame( '139.130.4.5', $data['author_ip'] );
+ $this->assertSame( 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36', $data['author_user_agent'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_comment_user_agent_header() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1703,12 +1703,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_comment = get_comment( $data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Mozilla/4.0 (compatible; MSIE 5.5; AOL 4.0; Windows 95)', $new_comment->comment_agent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Mozilla/4.0 (compatible; MSIE 5.5; AOL 4.0; Windows 95)', $new_comment->comment_agent );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_comment_author_ip() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1729,7 +1729,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $new_comment = get_comment( $data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '127.0.0.3', $new_comment->comment_author_IP );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '127.0.0.3', $new_comment->comment_author_IP );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_comment_invalid_author_IP() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1790,7 +1790,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $new_comment = get_comment( $data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '127.0.0.2', $new_comment->comment_author_IP );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '127.0.0.2', $new_comment->comment_author_IP );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_comment_no_post_id() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1957,7 +1957,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 409, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 409, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_comment_closed() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1978,7 +1978,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_comment_require_login() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1990,9 +1990,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'post', self::$post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'rest_comment_login_required', $data['code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'rest_comment_login_required', $data['code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_item_invalid_author() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2051,7 +2051,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $params = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post' => self::$post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2066,7 +2066,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 400, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 400, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function anonymous_comments_callback_null() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2229,7 +2229,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->add_header( 'content-type', 'application/json' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2253,20 +2253,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $updated = get_comment( self::$approved_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $params['content'], $comment['content']['raw'] );
- $this->assertEquals( $params['author'], $comment['author'] );
- $this->assertEquals( $params['author_name'], $comment['author_name'] );
- $this->assertEquals( $params['author_url'], $comment['author_url'] );
- $this->assertEquals( $params['author_email'], $comment['author_email'] );
- $this->assertEquals( $params['author_ip'], $comment['author_ip'] );
- $this->assertEquals( $params['post'], $comment['post'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $params['content'], $comment['content']['raw'] );
+ $this->assertSame( $params['author'], $comment['author'] );
+ $this->assertSame( $params['author_name'], $comment['author_name'] );
+ $this->assertSame( $params['author_url'], $comment['author_url'] );
+ $this->assertSame( $params['author_email'], $comment['author_email'] );
+ $this->assertSame( $params['author_ip'], $comment['author_ip'] );
+ $this->assertSame( $params['post'], $comment['post'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( mysql_to_rfc3339( $updated->comment_date ), $comment['date'] );
- $this->assertEquals( '2014-11-07T10:14:25', $comment['date'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( mysql_to_rfc3339( $updated->comment_date ), $comment['date'] );
+ $this->assertSame( '2014-11-07T10:14:25', $comment['date'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2290,17 +2290,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'timezone_string', '' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $data['id'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $results['date'], $data['date'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $results['date'], $data['date'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $comment_date = str_replace( 'T', ' ', $results['date'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $comment_date, $comment->comment_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $comment_date, $comment->comment_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $results['date_gmt'], $data['date_gmt'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $results['date_gmt'], $data['date_gmt'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $comment_date_gmt = str_replace( 'T', ' ', $results['date_gmt'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $comment_date_gmt, $comment->comment_date_gmt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $comment_date_gmt, $comment->comment_date_gmt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item_no_content() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2313,7 +2313,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Sending a request without content is fine.
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Sending a request with empty comment is not fine.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'author_email', 'yetanother@email.com' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2333,10 +2333,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Run twice to make sure that the update still succeeds
</span><span class="cx" style="display: block; padding: 0 10px"> // even if no DB rows are updated.
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_comment_status() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2358,11 +2358,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $updated = get_comment( $comment_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'approved', $comment['status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'approved', $comment['status'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1, $updated->comment_approved );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2386,13 +2386,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $updated = get_comment( $comment_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'approved', $comment['status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'approved', $comment['status'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1, $updated->comment_approved );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'some content', $updated->comment_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'some content', $updated->comment_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_comment_date_gmt() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2408,12 +2408,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $updated = get_comment( self::$approved_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $params['date_gmt'], $comment['date_gmt'] );
- $this->assertEquals( $params['date_gmt'], mysql_to_rfc3339( $updated->comment_date_gmt ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $params['date_gmt'], $comment['date_gmt'] );
+ $this->assertSame( $params['date_gmt'], mysql_to_rfc3339( $updated->comment_date_gmt ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_comment_author_email_only() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2432,7 +2432,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_comment_empty_author_name() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2452,7 +2452,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_comment_author_name_only() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2471,7 +2471,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_comment_empty_author_email() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2491,7 +2491,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_comment_author_email_too_short() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2544,11 +2544,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $updated = get_comment( self::$approved_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $params['content']['raw'], $updated->comment_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $params['content']['raw'], $updated->comment_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item_invalid_date() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2639,14 +2639,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body( wp_json_encode( $params ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $updated = get_comment( self::$approved_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $params['content'], $updated->comment_content );
- $this->assertEquals( self::$post_id, $comment['post'] );
- $this->assertEquals( '2019-10-07T23:14:25', $comment['date'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $params['content'], $updated->comment_content );
+ $this->assertSame( self::$post_id, $comment['post'] );
+ $this->assertSame( '2019-10-07T23:14:25', $comment['date'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_comment_private_post_invalid_permission() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2694,7 +2694,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Check if comment 1 does not have the child link.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/comments/%s', $comment_id_1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'children', $response->get_links() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Change the comment parent.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2702,12 +2702,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'parent', $comment_id_1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'content', rand_str() );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check if comment 1 now has the child link.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/comments/%s', $comment_id_1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'children', $response->get_links() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2829,22 +2829,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( $name, $value );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $actual_output = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to actual API output.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $actual_output['content'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'raw', $actual_output['content'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['content']['raw'], $actual_output['content']['raw'] );
- $this->assertEquals( $expected_output['content']['rendered'], trim( $actual_output['content']['rendered'] ) );
- $this->assertEquals( $expected_output['author_name'], $actual_output['author_name'] );
- $this->assertEquals( $expected_output['author_user_agent'], $actual_output['author_user_agent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['content']['raw'], $actual_output['content']['raw'] );
+ $this->assertSame( $expected_output['content']['rendered'], trim( $actual_output['content']['rendered'] ) );
+ $this->assertSame( $expected_output['author_name'], $actual_output['author_name'] );
+ $this->assertSame( $expected_output['author_user_agent'], $actual_output['author_user_agent'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to WP internal values.
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $actual_output['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['content']['raw'], $comment->comment_content );
- $this->assertEquals( $expected_output['author_name'], $comment->comment_author );
- $this->assertEquals( $expected_output['author_user_agent'], $comment->comment_agent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['content']['raw'], $comment->comment_content );
+ $this->assertSame( $expected_output['author_name'], $comment->comment_author );
+ $this->assertSame( $expected_output['author_user_agent'], $comment->comment_agent );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update the comment.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', $actual_output['id'] ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2855,26 +2855,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // See https://core.trac.wordpress.org/ticket/38700
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'author_ip', '127.0.0.2' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $actual_output = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to actual API output.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['content']['raw'], $actual_output['content']['raw'] );
- $this->assertEquals( $expected_output['content']['rendered'], trim( $actual_output['content']['rendered'] ) );
- $this->assertEquals( $expected_output['author_name'], $actual_output['author_name'] );
- $this->assertEquals( $expected_output['author_user_agent'], $actual_output['author_user_agent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['content']['raw'], $actual_output['content']['raw'] );
+ $this->assertSame( $expected_output['content']['rendered'], trim( $actual_output['content']['rendered'] ) );
+ $this->assertSame( $expected_output['author_name'], $actual_output['author_name'] );
+ $this->assertSame( $expected_output['author_user_agent'], $actual_output['author_user_agent'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to WP internal values.
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $actual_output['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['content']['raw'], $comment->comment_content );
- $this->assertEquals( $expected_output['author_name'], $comment->comment_author );
- $this->assertEquals( $expected_output['author_user_agent'], $comment->comment_agent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['content']['raw'], $comment->comment_content );
+ $this->assertSame( $expected_output['author_name'], $comment->comment_author );
+ $this->assertSame( $expected_output['author_user_agent'], $comment->comment_agent );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_comment_roundtrip_as_editor() {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( ! is_multisite(), current_user_can( 'unfiltered_html' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( ! is_multisite(), current_user_can( 'unfiltered_html' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->verify_comment_roundtrip(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'content' => '\o/ ¯\_(ツ)_/¯',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2988,10 +2988,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'DELETE', sprintf( '/wp/v2/comments/%d', $comment_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'force', 'false' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'trash', $data['status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'trash', $data['status'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_item_skip_trash() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3009,7 +3009,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request['force'] = true;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['deleted'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $data['previous']['post'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3028,7 +3028,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'DELETE', sprintf( '/wp/v2/comments/%d', $comment_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertErrorResponse( 'rest_already_trashed', $response, 410 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3072,12 +3072,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'DELETE', sprintf( '/wp/v2/comments/%s', $child_comment ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify children link is gone.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/comments/%s', $comment_id_1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'children', $response->get_links() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3086,7 +3086,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $properties = $data['schema']['properties'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 17, count( $properties ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 17, count( $properties ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'id', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'author', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'author_avatar_urls', $properties );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3105,11 +3105,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'status', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'type', $properties );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $properties['parent']['default'] );
- $this->assertEquals( 0, $properties['post']['default'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $properties['parent']['default'] );
+ $this->assertSame( 0, $properties['post']['default'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( true, $properties['link']['readonly'] );
- $this->assertEquals( true, $properties['type']['readonly'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertTrue( $properties['link']['readonly'] );
+ $this->assertTrue( $properties['type']['readonly'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_schema_show_avatar() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3147,7 +3147,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'my_custom_int', $data['schema']['properties'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $schema, $data['schema']['properties']['my_custom_int'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $schema, $data['schema']['properties']['my_custom_int'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/comments/' . self::$approved_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3238,12 +3238,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $comment->comment_post_ID, $data['post'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $comment->comment_parent, $data['parent'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $comment->user_id, $data['author'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $comment->comment_author, $data['author_name'] );
- $this->assertEquals( $comment->comment_author_url, $data['author_url'] );
- $this->assertEquals( wpautop( $comment->comment_content ), $data['content']['rendered'] );
- $this->assertEquals( mysql_to_rfc3339( $comment->comment_date ), $data['date'] );
- $this->assertEquals( mysql_to_rfc3339( $comment->comment_date_gmt ), $data['date_gmt'] );
- $this->assertEquals( get_comment_link( $comment ), $data['link'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $comment->comment_author, $data['author_name'] );
+ $this->assertSame( $comment->comment_author_url, $data['author_url'] );
+ $this->assertSame( wpautop( $comment->comment_content ), $data['content']['rendered'] );
+ $this->assertSame( mysql_to_rfc3339( $comment->comment_date ), $data['date'] );
+ $this->assertSame( mysql_to_rfc3339( $comment->comment_date_gmt ), $data['date_gmt'] );
+ $this->assertSame( get_comment_link( $comment ), $data['link'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'author_avatar_urls', $data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3255,10 +3255,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'edit' === $context ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $comment->comment_author_email, $data['author_email'] );
- $this->assertEquals( $comment->comment_author_IP, $data['author_ip'] );
- $this->assertEquals( $comment->comment_agent, $data['author_user_agent'] );
- $this->assertEquals( $comment->comment_content, $data['content']['raw'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $comment->comment_author_email, $data['author_email'] );
+ $this->assertSame( $comment->comment_author_IP, $data['author_ip'] );
+ $this->assertSame( $comment->comment_agent, $data['author_user_agent'] );
+ $this->assertSame( $comment->comment_content, $data['content']['raw'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'edit' !== $context ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3293,6 +3293,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/comments/' . $comment_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestcontrollerphp"></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/rest-api/rest-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -106,35 +106,35 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check sanitize testing.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> false,
</span><span class="cx" style="display: block; padding: 0 10px"> rest_sanitize_request_arg( 'false', $this->request, 'someboolean' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> false,
</span><span class="cx" style="display: block; padding: 0 10px"> rest_sanitize_request_arg( '0', $this->request, 'someboolean' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> false,
</span><span class="cx" style="display: block; padding: 0 10px"> rest_sanitize_request_arg( 0, $this->request, 'someboolean' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> false,
</span><span class="cx" style="display: block; padding: 0 10px"> rest_sanitize_request_arg( 'FALSE', $this->request, 'someboolean' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> true,
</span><span class="cx" style="display: block; padding: 0 10px"> rest_sanitize_request_arg( 'true', $this->request, 'someboolean' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> true,
</span><span class="cx" style="display: block; padding: 0 10px"> rest_sanitize_request_arg( '1', $this->request, 'someboolean' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> true,
</span><span class="cx" style="display: block; padding: 0 10px"> rest_sanitize_request_arg( 1, $this->request, 'someboolean' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> true,
</span><span class="cx" style="display: block; padding: 0 10px"> rest_sanitize_request_arg( 'TRUE', $this->request, 'someboolean' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -225,7 +225,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_endpoint_args_for_item_schema_description() {
</span><span class="cx" style="display: block; padding: 0 10px"> $controller = new WP_REST_Test_Controller();
</span><span class="cx" style="display: block; padding: 0 10px"> $args = $controller->get_endpoint_args_for_item_schema();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'A pretty string.', $args['somestring']['description'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'A pretty string.', $args['somestring']['description'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( isset( $args['someinteger']['description'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -235,7 +235,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $args = $controller->get_endpoint_args_for_item_schema();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $args['someargoptions']['required'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '__return_true', $args['someargoptions']['sanitize_callback'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '__return_true', $args['someargoptions']['sanitize_callback'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_endpoint_args_for_item_schema_default_value() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -244,7 +244,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args = $controller->get_endpoint_args_for_item_schema();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a', $args['somedefault']['default'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a', $args['somedefault']['default'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -285,7 +285,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $controller = new WP_REST_Test_Controller();
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/testroute' );
</span><span class="cx" style="display: block; padding: 0 10px"> $fields = $controller->get_fields_for_response( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'somestring',
</span><span class="cx" style="display: block; padding: 0 10px"> 'someinteger',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -305,7 +305,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( '_fields', $param );
</span><span class="cx" style="display: block; padding: 0 10px"> $fields = $controller->get_fields_for_response( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $fields );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $fields );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_get_fields_for_response() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -536,7 +536,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $controller->prepare_item_for_response( array(), $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_filter_response_fields( $response, rest_get_server(), $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $response->get_data() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $response->get_data() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function register_nested_rest_field_get_callback() {
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestpagescontrollerphp"></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/rest-api/rest-pages-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-pages-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-pages-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,15 +49,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/pages' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
- $this->assertEquals( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
+ $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Single.
</span><span class="cx" style="display: block; padding: 0 10px"> $page_id = $this->factory->post->create( array( 'post_type' => 'page' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/pages/' . $page_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
- $this->assertEquals( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
+ $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_registered_query_params() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -66,7 +66,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $keys = array_keys( $data['endpoints'][0]['args'] );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $keys );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'after',
</span><span class="cx" style="display: block; padding: 0 10px"> 'author',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -107,8 +107,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/pages' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( $id1, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( $id1, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_parent_query() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,14 +130,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/pages' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Filter to parent.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'parent', $id1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( $id2, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( $id2, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Invalid 'parent' should error.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'parent', 'some-slug' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -177,13 +177,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/pages' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 4, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 4, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Filter to parents.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'parent', array( $id1, $id3 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( $id2, $id4 ), wp_list_pluck( $data, 'id' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -206,14 +206,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/pages' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Filter to parent.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'parent_exclude', $id1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( $id1, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( $id1, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Invalid 'parent_exclude' should error.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'parent_exclude', 'some-slug' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -268,10 +268,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'menu_order' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id1, $data[0]['id'] );
- $this->assertEquals( $id4, $data[1]['id'] );
- $this->assertEquals( $id2, $data[2]['id'] );
- $this->assertEquals( $id3, $data[3]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id1, $data[0]['id'] );
+ $this->assertSame( $id4, $data[1]['id'] );
+ $this->assertSame( $id2, $data[2]['id'] );
+ $this->assertSame( $id3, $data[3]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Invalid 'menu_order' should error.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/pages' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -322,7 +322,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $draft_id, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $draft_id, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_invalid_date() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -358,7 +358,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post2, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post2, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -369,7 +369,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = $this->factory->post->create();
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/pages/' . $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -390,8 +390,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $new_post = get_post( $data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'page-my-test-template.php', $data['template'] );
- $this->assertEquals( 'page-my-test-template.php', get_page_template_slug( $new_post->ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'page-my-test-template.php', $data['template'] );
+ $this->assertSame( 'page-my-test-template.php', get_page_template_slug( $new_post->ID ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_page_with_parent() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -411,7 +411,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $links = $response->get_links();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'up', $links );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -418,8 +418,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $new_post = get_post( $data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $page_id, $data['parent'] );
- $this->assertEquals( $page_id, $new_post->post_parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $page_id, $data['parent'] );
+ $this->assertSame( $page_id, $new_post->post_parent );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_page_with_invalid_parent() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -454,10 +454,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'force', 'false' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Deleted page', $data['title']['raw'] );
- $this->assertEquals( 'trash', $data['status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Deleted page', $data['title']['raw'] );
+ $this->assertSame( 'trash', $data['status'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_prepare_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -478,7 +478,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( '_fields', 'id,slug' );
</span><span class="cx" style="display: block; padding: 0 10px"> $obj = get_post( $page_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $endpoint->prepare_item_for_response( $obj, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'id',
</span><span class="cx" style="display: block; padding: 0 10px"> 'slug',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -504,16 +504,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 8, $headers['X-WP-Total'] );
- $this->assertEquals( 2, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 8, $headers['X-WP-Total'] );
+ $this->assertSame( 2, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $all_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 4, count( $all_data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 4, count( $all_data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $all_data as $post ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'page', $post['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'page', $post['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -537,7 +537,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $new_data['menu_order'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $new_data['menu_order'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_page_menu_order_to_zero() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -561,7 +561,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $new_data['menu_order'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $new_data['menu_order'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_page_parent_non_zero() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -584,7 +584,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $page_id1, $new_data['parent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $page_id1, $new_data['parent'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_page_parent_zero() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -608,7 +608,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $new_data['parent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $new_data['parent'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_page_with_password() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -623,9 +623,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $data['content']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $data['content']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['content']['protected'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $data['excerpt']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $data['excerpt']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['excerpt']['protected'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -645,9 +645,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wpautop( $page->post_content ), $data['content']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wpautop( $page->post_content ), $data['content']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['content']['protected'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wpautop( $page->post_excerpt ), $data['excerpt']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wpautop( $page->post_excerpt ), $data['excerpt']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['excerpt']['protected'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -679,9 +679,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/pages/%d', $page_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $data['content']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $data['content']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['content']['protected'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $data['excerpt']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $data['excerpt']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['excerpt']['protected'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -690,7 +690,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $properties = $data['schema']['properties'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 24, count( $properties ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 24, count( $properties ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'author', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'comment_status', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'content', $properties );
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestpluginscontrollerphp"></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/rest-api/rest-plugins-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-plugins-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-plugins-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -107,14 +107,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', self::BASE );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
- $this->assertEquals( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
+ $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Single.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', self::BASE . '/' . self::PLUGIN );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
- $this->assertEquals( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
+ $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,7 +125,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$super_admin );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( self::BASE );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $items = wp_list_filter( $response->get_data(), array( 'plugin' => self::PLUGIN ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -209,7 +209,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_logged_out() {
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( self::BASE );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -245,7 +245,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( self::BASE );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -258,7 +258,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( self::BASE );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $items = wp_list_filter( $response->get_data(), array( 'plugin' => self::PLUGIN ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 0, $items );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -273,7 +273,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( self::BASE );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $items = wp_list_filter( $response->get_data(), array( 'plugin' => self::PLUGIN ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $items );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -290,7 +290,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$super_admin );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( self::BASE );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $items = wp_list_filter( $response->get_data(), array( 'plugin' => self::PLUGIN ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $items );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -305,7 +305,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$super_admin );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( self::BASE . '/' . self::PLUGIN );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->check_get_plugin_data( $response->get_data() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -314,7 +314,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_logged_out() {
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( self::BASE . '/' . self::PLUGIN );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -323,7 +323,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_insufficient_permissions() {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$subscriber_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( self::BASE . '/' . self::PLUGIN );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -350,7 +350,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( self::BASE . '/' . self::PLUGIN );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -359,7 +359,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_invalid_plugin() {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$super_admin );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( self::BASE . '/' . self::PLUGIN );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -378,8 +378,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $response->as_error() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
- $this->assertEquals( 'Link Manager', $response->get_data()['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
+ $this->assertSame( 'Link Manager', $response->get_data()['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -403,8 +403,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $response->as_error() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
- $this->assertEquals( 'Link Manager', $response->get_data()['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
+ $this->assertSame( 'Link Manager', $response->get_data()['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_plugin_active( 'link-manager/link-manager.php' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -477,8 +477,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $response->as_error() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
- $this->assertEquals( 'Link Manager', $response->get_data()['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
+ $this->assertSame( 'Link Manager', $response->get_data()['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_plugin_active_for_network( 'link-manager/link-manager.php' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -490,7 +490,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( array( 'slug' => 'link-manager' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -502,7 +502,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( array( 'slug' => 'link-manager' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -561,7 +561,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', self::BASE . '/' . self::PLUGIN );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -571,7 +571,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', self::BASE . '/' . self::PLUGIN );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -583,7 +583,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', self::BASE . '/' . self::PLUGIN );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -611,7 +611,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( array( 'status' => 'active' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_plugin_active( self::PLUGIN_FILE ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -657,7 +657,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( array( 'status' => 'network-active' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_plugin_active_for_network( self::PLUGIN_FILE ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -674,7 +674,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( array( 'status' => 'network-active' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_plugin_active_for_network( self::PLUGIN_FILE ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -705,7 +705,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( array( 'status' => 'network-active' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_plugin_active_for_network( self::PLUGIN_FILE ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -721,7 +721,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( array( 'status' => 'active' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_plugin_active( self::PLUGIN_FILE ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -739,7 +739,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $response->as_error() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_plugin_active( self::PLUGIN_FILE ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -771,7 +771,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( array( 'status' => 'inactive' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_plugin_inactive( self::PLUGIN_FILE ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -804,7 +804,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( array( 'status' => 'inactive' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_plugin_inactive( self::PLUGIN_FILE ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -836,9 +836,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotWPError( $response->as_error() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $response->get_data()['deleted'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::PLUGIN, $response->get_data()['previous']['plugin'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::PLUGIN, $response->get_data()['previous']['plugin'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFileNotExists( WP_PLUGIN_DIR . '/' . self::PLUGIN_FILE );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -849,7 +849,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'DELETE', self::BASE . '/' . self::PLUGIN );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -861,7 +861,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'DELETE', self::BASE . '/' . self::PLUGIN );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -920,7 +920,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_get_plugin_data( $response->get_data() );
</span><span class="cx" style="display: block; padding: 0 10px"> $links = $response->get_links();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'self', $links );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( rest_url( self::BASE . '/' . self::PLUGIN ), $links['self'][0]['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( rest_url( self::BASE . '/' . self::PLUGIN ), $links['self'][0]['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -937,7 +937,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $endpoint = new WP_REST_Plugins_Controller();
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $endpoint->prepare_item_for_response( $item, new WP_REST_Request( 'GET', self::BASE . '/' . self::PLUGIN ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'network-active', $response->get_data()['status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'network-active', $response->get_data()['status'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -989,19 +989,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $network_only Whether the plugin is network only.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function check_get_plugin_data( $data, $network_only = false ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test-plugin/test-plugin', $data['plugin'] );
- $this->assertEquals( '1.5.4', $data['version'] );
- $this->assertEquals( 'inactive', $data['status'] );
- $this->assertEquals( 'Test Plugin', $data['name'] );
- $this->assertEquals( 'https://wordpress.org/plugins/test-plugin/', $data['plugin_uri'] );
- $this->assertEquals( 'WordPress.org', $data['author'] );
- $this->assertEquals( 'https://wordpress.org/', $data['author_uri'] );
- $this->assertEquals( "My 'Cool' Plugin", $data['description']['raw'] );
- $this->assertEquals( 'My ‘Cool’ Plugin <cite>By <a href="https://wordpress.org/">WordPress.org</a>.</cite>', $data['description']['rendered'] );
- $this->assertEquals( $network_only, $data['network_only'] );
- $this->assertEquals( '5.6.0', $data['requires_php'] );
- $this->assertEquals( '5.4.0', $data['requires_wp'] );
- $this->assertEquals( 'test-plugin', $data['textdomain'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test-plugin/test-plugin', $data['plugin'] );
+ $this->assertSame( '1.5.4', $data['version'] );
+ $this->assertSame( 'inactive', $data['status'] );
+ $this->assertSame( 'Test Plugin', $data['name'] );
+ $this->assertSame( 'https://wordpress.org/plugins/test-plugin/', $data['plugin_uri'] );
+ $this->assertSame( 'WordPress.org', $data['author'] );
+ $this->assertSame( 'https://wordpress.org/', $data['author_uri'] );
+ $this->assertSame( "My 'Cool' Plugin", $data['description']['raw'] );
+ $this->assertSame( 'My ‘Cool’ Plugin <cite>By <a href="https://wordpress.org/">WordPress.org</a>.</cite>', $data['description']['rendered'] );
+ $this->assertSame( $network_only, $data['network_only'] );
+ $this->assertSame( '5.6.0', $data['requires_php'] );
+ $this->assertSame( '5.4.0', $data['requires_wp'] );
+ $this->assertSame( 'test-plugin', $data['textdomain'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestpostmetafieldsphp"></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/rest-api/rest-post-meta-fields.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-post-meta-fields.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-post-meta-fields.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -267,7 +267,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/posts/%d', self::$post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'meta', $data );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -274,7 +274,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'test_single', $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'testvalue', $meta['test_single'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'testvalue', $meta['test_single'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -285,7 +285,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/posts/%d', self::$post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -297,7 +297,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_post_meta( self::$post_id, 'test_multi', 'value2' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'value1', $meta['test_multi'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -312,7 +312,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/posts/%d', self::$post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -327,7 +327,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/posts/%d', self::$post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -342,7 +342,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/posts/%d', self::$post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -389,7 +389,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/posts/%d', self::$post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -404,7 +404,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'test_bool', $meta );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'boolean', $meta['test_bool'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( true, $meta['test_bool'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertTrue( $meta['test_bool'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_value_custom_name() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -413,7 +413,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/posts/%d', self::$post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'meta', $data );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -420,7 +420,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'new_name', $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'janet', $meta['new_name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'janet', $meta['new_name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -442,17 +442,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( self::$post_id, 'test_single', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test_value', $meta[0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test_value', $meta[0] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'test_single', $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test_value', $meta['test_single'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test_value', $meta['test_single'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -461,7 +461,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_set_duplicate_single_value() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Start with an existing metakey and value.
</span><span class="cx" style="display: block; padding: 0 10px"> $values = update_post_meta( self::$post_id, 'test_single', 'test_value' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test_value', get_post_meta( self::$post_id, 'test_single', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test_value', get_post_meta( self::$post_id, 'test_single', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->grant_write_permission();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -474,16 +474,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( self::$post_id, 'test_single', true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test_value', $meta );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test_value', $meta );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'test_single', $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test_value', $meta['test_single'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test_value', $meta['test_single'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -592,12 +592,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( self::$post_id, 'test_multi', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'val1', $meta[0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'val1', $meta[0] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add another value.
</span><span class="cx" style="display: block; padding: 0 10px"> $data = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -608,7 +608,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( self::$post_id, 'test_multi', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -636,7 +636,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( self::$post_id, 'test_multi', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -743,7 +743,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $data['meta']['my_meta_key'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $data['meta']['my_meta_key'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_set_value_csv() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -769,7 +769,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 1, 2, 3 ), $data['meta']['my_meta_key'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 1, 2, 3 ), $data['meta']['my_meta_key'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -841,7 +841,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( self::$post_id, 'test_custom_schema', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -870,7 +870,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( self::$post_id, 'test_custom_schema_multi', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -886,7 +886,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( self::$post_id, 'test_custom_schema_multi', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -914,17 +914,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( self::$post_id, 'test_custom_name', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'janet', $meta[0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'janet', $meta[0] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'new_name', $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'janet', $meta['new_name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'janet', $meta['new_name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_set_value_custom_name_multiple() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -943,12 +943,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( self::$post_id, 'test_custom_name_multi', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'janet', $meta[0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'janet', $meta[0] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add another value.
</span><span class="cx" style="display: block; padding: 0 10px"> $data = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -959,7 +959,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( self::$post_id, 'test_custom_name_multi', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -991,11 +991,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The meta value should not have changed.
</span><span class="cx" style="display: block; padding: 0 10px"> $current_value = get_post_meta( self::$post_id, 'test_single', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'So I tied an onion to my belt, which was the style at the time.', $current_value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'So I tied an onion to my belt, which was the style at the time.', $current_value );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure the post title update was not processed.
</span><span class="cx" style="display: block; padding: 0 10px"> $post_updated = get_post( self::$post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_original->post_title, $post_updated->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_original->post_title, $post_updated->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1020,17 +1020,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The meta value should not have changed.
</span><span class="cx" style="display: block; padding: 0 10px"> $current_value = get_post_meta( self::$post_id, 'test_single', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Now, to take the ferry cost a nickel, and in those days, nickels had pictures of bumblebees on them.', $current_value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Now, to take the ferry cost a nickel, and in those days, nickels had pictures of bumblebees on them.', $current_value );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure the post content update was not processed.
</span><span class="cx" style="display: block; padding: 0 10px"> $post_updated = get_post( self::$post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_original->post_content, $post_updated->post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_original->post_content, $post_updated->post_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_remove_multi_value_db_error() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_post_meta( self::$post_id, 'test_multi', 'val1' );
</span><span class="cx" style="display: block; padding: 0 10px"> $values = get_post_meta( self::$post_id, 'test_multi', false );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'val1' ), $values );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'val1' ), $values );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->grant_write_permission();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1061,7 +1061,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_value() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_post_meta( self::$post_id, 'test_single', 'val1' );
</span><span class="cx" style="display: block; padding: 0 10px"> $current = get_post_meta( self::$post_id, 'test_single', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'val1', $current );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'val1', $current );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->grant_write_permission();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1074,7 +1074,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( self::$post_id, 'test_single', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $meta );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1086,7 +1086,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_value_blocked() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_post_meta( self::$post_id, 'test_bad_auth', 'val1' );
</span><span class="cx" style="display: block; padding: 0 10px"> $current = get_post_meta( self::$post_id, 'test_bad_auth', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'val1', $current );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'val1', $current );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->grant_write_permission();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1102,7 +1102,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertErrorResponse( 'rest_cannot_delete', $response, 403 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( self::$post_id, 'test_bad_auth', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'val1', $meta );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'val1', $meta );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1111,7 +1111,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_value_db_error() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_post_meta( self::$post_id, 'test_single', 'val1' );
</span><span class="cx" style="display: block; padding: 0 10px"> $current = get_post_meta( self::$post_id, 'test_single', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'val1', $current );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'val1', $current );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->grant_write_permission();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1140,7 +1140,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_value_custom_name() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_post_meta( self::$post_id, 'test_custom_name', 'janet' );
</span><span class="cx" style="display: block; padding: 0 10px"> $current = get_post_meta( self::$post_id, 'test_custom_name', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'janet', $current );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'janet', $current );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->grant_write_permission();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1153,7 +1153,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( self::$post_id, 'test_custom_name', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $meta );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1170,15 +1170,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $meta_schema = $schema['properties']['meta']['properties'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'test_single', $meta_schema );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'string', $meta_schema['test_single']['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'string', $meta_schema['test_single']['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'test_multi', $meta_schema );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'array', $meta_schema['test_multi']['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'array', $meta_schema['test_multi']['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'items', $meta_schema['test_multi'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'string', $meta_schema['test_multi']['items']['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'string', $meta_schema['test_multi']['items']['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'test_custom_schema', $meta_schema );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'number', $meta_schema['test_custom_schema']['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'number', $meta_schema['test_custom_schema']['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'test_no_rest', $meta_schema );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'test_rest_disabled', $meta_schema );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1206,7 +1206,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/%s/%d', $endpoint, $post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1220,7 +1220,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $meta_key, $data['meta'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_value, $data['meta'][ $meta_key ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_value, $data['meta'][ $meta_key ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( $meta_key, $data['meta'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1267,13 +1267,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $can_write ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( get_post_meta( $post_id, $meta_key, $single ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'meta', $data );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1285,9 +1285,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_value = array( $expected_value );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_value, get_post_meta( $post_id, $meta_key, $single ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_value, get_post_meta( $post_id, $meta_key, $single ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $meta_key, $data['meta'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_value, $data['meta'][ $meta_key ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_value, $data['meta'][ $meta_key ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( get_post_meta( $post_id, $meta_key, $single ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( $meta_key, $data['meta'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1332,7 +1332,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_update_value_return_success_with_same_value() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1359,7 +1359,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'test\'slashed\'key', $data['meta'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Hello', $data['meta']['test\'slashed\'key'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Hello', $data['meta']['test\'slashed\'key'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1403,11 +1403,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'object', $data['meta'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'project', $data['meta']['object'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'WordPress', $data['meta']['object']['project'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'WordPress', $data['meta']['object']['project'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( self::$post_id, 'object', true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'project', $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'WordPress', $meta['project'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'WordPress', $meta['project'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1458,10 +1458,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $data['meta']['object'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'project', $data['meta']['object'][0] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'WordPress', $data['meta']['object'][0]['project'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'WordPress', $data['meta']['object'][0]['project'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'project', $data['meta']['object'][1] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bbPress', $data['meta']['object'][1]['project'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bbPress', $data['meta']['object'][1]['project'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( self::$post_id, 'object' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1468,10 +1468,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $meta );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'project', $meta[0] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'WordPress', $meta[0]['project'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'WordPress', $meta[0]['project'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'project', $meta[1] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bbPress', $meta[1]['project'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bbPress', $meta[1]['project'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1510,10 +1510,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'list', $data['meta'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'WordPress', 'bbPress' ), $data['meta']['list'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'WordPress', 'bbPress' ), $data['meta']['list'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( self::$post_id, 'list', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'WordPress', 'bbPress' ), $meta );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'WordPress', 'bbPress' ), $meta );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1581,7 +1581,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'list_of_objects', $data['meta'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $data['meta']['list_of_objects'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'version' => '5.2',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1595,7 +1595,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data['meta']['list_of_objects'][0]
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'version' => '4.9',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1609,7 +1609,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $meta );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'version' => '5.2',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1623,7 +1623,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $meta[0]
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'version' => '4.9',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1703,7 +1703,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'object', $data['meta'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $data['meta']['object'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'project' => 'bbPress' ), $data['meta']['object'][0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'project' => 'bbPress' ), $data['meta']['object'][0] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $data['meta']['object'][1] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1739,7 +1739,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'object', $data['meta'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'project' => 'WordPress' ), $data['meta']['object'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'project' => 'WordPress' ), $data['meta']['object'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1781,7 +1781,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 500, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 500, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1827,7 +1827,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 500, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 500, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1868,7 +1868,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 400, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 400, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1912,10 +1912,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( $value, $response->get_data()['meta']['object'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( $value, $response->get_data()['meta']['object'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, get_post_meta( self::$post_id, 'object', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, get_post_meta( self::$post_id, 'object', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1961,7 +1961,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 400, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 400, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2088,19 +2088,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'object', $data['meta'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $data['meta']['object'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'project' => 'WordPress' ), $data['meta']['object'][0] );
- $this->assertEquals( array( 'project' => 'BuddyPress' ), $data['meta']['object'][1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'project' => 'WordPress' ), $data['meta']['object'][0] );
+ $this->assertSame( array( 'project' => 'BuddyPress' ), $data['meta']['object'][1] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( self::$post_id, 'object' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'project' => 'WordPress' ), $meta[0] );
- $this->assertEquals( array( 'project' => 'BuddyPress' ), $meta[1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'project' => 'WordPress' ), $meta[0] );
+ $this->assertSame( array( 'project' => 'BuddyPress' ), $meta[1] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2141,19 +2141,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'list', $data['meta'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $data['meta']['list'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'WordPress', 'bbPress' ), $data['meta']['list'][0] );
- $this->assertEquals( array( 'BuddyPress' ), $data['meta']['list'][1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'WordPress', 'bbPress' ), $data['meta']['list'][0] );
+ $this->assertSame( array( 'BuddyPress' ), $data['meta']['list'][1] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_post_meta( self::$post_id, 'list' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'WordPress', 'bbPress' ), $meta[0] );
- $this->assertEquals( array( 'BuddyPress' ), $meta[1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'WordPress', 'bbPress' ), $meta[0] );
+ $this->assertSame( array( 'BuddyPress' ), $meta[1] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2191,10 +2191,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'WordCamp' ), $data['meta']['list'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'WordCamp' ), $data['meta']['list'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2234,10 +2234,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'project' => 'WordCamp' ), $data['meta']['object'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'project' => 'WordCamp' ), $data['meta']['object'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2332,7 +2332,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2358,7 +2358,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( self::$post_id, 'items', array( '1', '2', '3' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( new WP_REST_Request( 'GET', sprintf( '/wp/v2/posts/%d', self::$post_id ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 1, 2, 3 ), $response->get_data()['meta']['items'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 1, 2, 3 ), $response->get_data()['meta']['items'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/posts/%d', self::$post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2370,7 +2370,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( array( 1, 2, 3 ), get_post_meta( self::$post_id, 'items', true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2407,7 +2407,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( array( 1, 2, 3 ), get_post_meta( self::$post_id, 'items', true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2444,7 +2444,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( array( 1, 2, 3 ), get_post_meta( self::$post_id, 'items', true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2480,7 +2480,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2507,7 +2507,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( self::$post_id, 'items', array( '1', '0' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( new WP_REST_Request( 'GET', sprintf( '/wp/v2/posts/%d', self::$post_id ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( true, false ), $response->get_data()['meta']['items'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( true, false ), $response->get_data()['meta']['items'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/posts/%d', self::$post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2519,7 +2519,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( array( true, false ), get_post_meta( self::$post_id, 'items', true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2556,7 +2556,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( array( true, false ), get_post_meta( self::$post_id, 'items', true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2593,7 +2593,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( array( true, false ), get_post_meta( self::$post_id, 'items', true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2630,7 +2630,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( array( false, true ), get_post_meta( self::$post_id, 'items', true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2665,8 +2665,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( '0', get_post_meta( self::$post_id, 'boolean', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( '0', get_post_meta( self::$post_id, 'boolean', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2698,8 +2698,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( array( 2, 3 ), $response->get_data()['meta']['multi_integer'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( array( 2, 3 ), $response->get_data()['meta']['multi_integer'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_metadata_by_mid( 'post', $mid1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotFalse( get_metadata_by_mid( 'post', $mid2 ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2735,7 +2735,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( array( 0 ), $response->get_data()['meta']['multi_boolean'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_metadata_by_mid( 'post', $mid1 ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2783,8 +2783,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'a' => 'anaconda' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'a' => 'alpaca' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2815,7 +2815,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/posts/%d', self::$post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'meta', $data );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2822,7 +2822,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $meta_key, $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $meta[ $meta_key ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $meta[ $meta_key ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_get_default_data() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2981,7 +2981,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_do_request( '/wp/v2/posts/' . self::$post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Hello World', $response->get_data()['meta']['greeting'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Hello World', $response->get_data()['meta']['greeting'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2993,7 +2993,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $schema = $response->get_data()['schema']['properties']['meta']['properties']['with_default'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'default', $schema );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Goodnight Moon', $schema['default'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Goodnight Moon', $schema['default'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestpoststatusescontrollerphp"></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/rest-api/rest-post-statuses-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-post-statuses-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-post-statuses-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,13 +22,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/statuses' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'embed', 'view', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px"> // Single.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/statuses/publish' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'embed', 'view', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,8 +38,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $statuses = get_post_stati( array( 'public' => true ), 'objects' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( 'publish', $data['publish']['slug'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( 'publish', $data['publish']['slug'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_logged_in() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -50,7 +50,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 6, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 6, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'publish',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -106,7 +106,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** Post statuses can't be created */
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/statuses' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,7 +113,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** Post statuses can't be updated */
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/statuses/draft' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -120,7 +120,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** Post statuses can't be deleted */
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'DELETE', '/wp/v2/statuses/draft' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_prepare_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -139,7 +139,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'context', 'edit' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( '_fields', 'id,name' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $endpoint->prepare_item_for_response( $obj, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> // 'id' doesn't exist in this context.
</span><span class="cx" style="display: block; padding: 0 10px"> 'name',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -153,7 +153,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $properties = $data['schema']['properties'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 8, count( $properties ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 8, count( $properties ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'name', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'private', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'protected', $properties );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -189,7 +189,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'my_custom_int', $data['schema']['properties'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $schema, $data['schema']['properties']['my_custom_int'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $schema, $data['schema']['properties']['my_custom_int'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/statuses/publish' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -205,13 +205,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected function check_post_status_obj( $status_obj, $data, $links ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $status_obj->label, $data['name'] );
- $this->assertEquals( $status_obj->private, $data['private'] );
- $this->assertEquals( $status_obj->protected, $data['protected'] );
- $this->assertEquals( $status_obj->public, $data['public'] );
- $this->assertEquals( $status_obj->publicly_queryable, $data['queryable'] );
- $this->assertEquals( $status_obj->show_in_admin_all_list, $data['show_in_list'] );
- $this->assertEquals( $status_obj->name, $data['slug'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $status_obj->label, $data['name'] );
+ $this->assertSame( $status_obj->private, $data['private'] );
+ $this->assertSame( $status_obj->protected, $data['protected'] );
+ $this->assertSame( $status_obj->public, $data['public'] );
+ $this->assertSame( $status_obj->publicly_queryable, $data['queryable'] );
+ $this->assertSame( $status_obj->show_in_admin_all_list, $data['show_in_list'] );
+ $this->assertSame( $status_obj->name, $data['slug'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'archives',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -218,11 +218,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array_keys( $links )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $status_obj->date_floating, $data['date_floating'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $status_obj->date_floating, $data['date_floating'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected function check_post_status_object_response( $response ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $obj = get_post_status_object( 'publish' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_post_status_obj( $obj, $data, $response->get_links() );
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestposttypescontrollerphp"></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/rest-api/rest-post-types-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-post-types-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-post-types-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,13 +22,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/types' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px"> // Single.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/types/post' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,10 +38,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $post_types = get_post_types( array( 'show_in_rest' => true ), 'objects' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( count( $post_types ), count( $data ) );
- $this->assertEquals( $post_types['post']->name, $data['post']['slug'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( count( $post_types ), count( $data ) );
+ $this->assertSame( $post_types['post']->name, $data['post']['slug'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->check_post_type_obj( 'view', $post_types['post'], $data['post'], $data['post']['_links'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_types['page']->name, $data['page']['slug'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_types['page']->name, $data['page']['slug'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->check_post_type_obj( 'view', $post_types['page'], $data['page'], $data['page']['_links'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( isset( $data['revision'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,7 +59,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_post_type_object_response( 'view', $response );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'category', 'post_tag' ), $data['taxonomies'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'category', 'post_tag' ), $data['taxonomies'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_page() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,7 +67,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_post_type_object_response( 'view', $response, 'page' );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $data['taxonomies'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $data['taxonomies'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_invalid_type() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -97,7 +97,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** Post types can't be created */
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/types' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,7 +104,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** Post types can't be updated */
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/types/post' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -111,7 +111,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** Post types can't be deleted */
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'DELETE', '/wp/v2/types/post' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_prepare_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,7 +130,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'context', 'edit' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( '_fields', 'id,name' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $endpoint->prepare_item_for_response( $obj, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> // 'id' doesn't exist in this context.
</span><span class="cx" style="display: block; padding: 0 10px"> 'name',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -144,7 +144,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $properties = $data['schema']['properties'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, count( $properties ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, count( $properties ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'capabilities', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'description', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'hierarchical', $properties );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -182,7 +182,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'my_custom_int', $data['schema']['properties'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $schema, $data['schema']['properties']['my_custom_int'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $schema, $data['schema']['properties']['my_custom_int'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/types/post' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -198,25 +198,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected function check_post_type_obj( $context, $post_type_obj, $data, $links ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_type_obj->label, $data['name'] );
- $this->assertEquals( $post_type_obj->name, $data['slug'] );
- $this->assertEquals( $post_type_obj->description, $data['description'] );
- $this->assertEquals( $post_type_obj->hierarchical, $data['hierarchical'] );
- $this->assertEquals( $post_type_obj->rest_base, $data['rest_base'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_type_obj->label, $data['name'] );
+ $this->assertSame( $post_type_obj->name, $data['slug'] );
+ $this->assertSame( $post_type_obj->description, $data['description'] );
+ $this->assertSame( $post_type_obj->hierarchical, $data['hierarchical'] );
+ $this->assertSame( $post_type_obj->rest_base, $data['rest_base'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $links = test_rest_expand_compact_links( $links );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( rest_url( 'wp/v2/types' ), $links['collection'][0]['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( rest_url( 'wp/v2/types' ), $links['collection'][0]['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'https://api.w.org/items', $links );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'edit' === $context ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_type_obj->cap, $data['capabilities'] );
- $this->assertEquals( $post_type_obj->labels, $data['labels'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_type_obj->cap, $data['capabilities'] );
+ $this->assertSame( $post_type_obj->labels, $data['labels'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( in_array( $post_type_obj->name, array( 'post', 'page' ), true ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $viewable = true;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $viewable = is_post_type_viewable( $post_type_obj );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $viewable, $data['viewable'] );
- $this->assertEquals( get_all_post_type_supports( $post_type_obj->name ), $data['supports'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $viewable, $data['viewable'] );
+ $this->assertSame( get_all_post_type_supports( $post_type_obj->name ), $data['supports'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( isset( $data['capabilities'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( isset( $data['viewable'] ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -226,7 +226,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected function check_post_type_object_response( $context, $response, $post_type = 'post' ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $obj = get_post_type_object( $post_type );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_post_type_obj( $context, $obj, $data, $response->get_links() );
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestpostscontrollerphp"></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/rest-api/rest-posts-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -129,7 +129,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_clause = str_replace( '{posts}', $wpdb->posts, $pattern );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $this->posts_clauses );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_clause, $wpdb->remove_placeholder_escape( $this->posts_clauses[0][ $clause ] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_clause, $wpdb->remove_placeholder_escape( $this->posts_clauses[0][ $clause ] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function assertPostsOrderedBy( $pattern ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -154,14 +154,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
- $this->assertEquals( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
+ $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Single.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/posts/' . self::$post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
- $this->assertEquals( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
+ $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_registered_query_params() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -170,7 +170,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $keys = array_keys( $data['endpoints'][0]['args'] );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $keys );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'after',
</span><span class="cx" style="display: block; padding: 0 10px"> 'author',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -204,7 +204,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $keys = array_keys( $data['endpoints'][0]['args'] );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $keys );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'context', 'id', 'password' ), $keys );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'context', 'id', 'password' ), $keys );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -217,7 +217,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $headers['Allow'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $headers['Allow'], 'GET' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $headers['Allow'], 'GET' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -227,7 +227,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $headers['Allow'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $headers['Allow'], 'GET, POST, PUT, PATCH, DELETE' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $headers['Allow'], 'GET, POST, PUT, PATCH, DELETE' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -252,7 +252,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $response->get_data() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_author_query() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -265,16 +265,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'per_page', self::$per_page );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( $total_posts, count( $response->get_data() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( $total_posts, count( $response->get_data() ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Limit to editor and author.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'author', array( self::$editor_id, self::$author_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( self::$editor_id, self::$author_id ), wp_list_pluck( $data, 'author' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Limit to editor.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -281,10 +281,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'author', self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( self::$editor_id, $data[0]['author'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( self::$editor_id, $data[0]['author'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_author_exclude_query() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -297,8 +297,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'per_page', self::$per_page );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( $total_posts, count( $response->get_data() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( $total_posts, count( $response->get_data() ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Exclude editor and author.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -305,9 +305,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'per_page', self::$per_page );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'author_exclude', array( self::$editor_id, self::$author_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_posts - 2, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_posts - 2, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( self::$editor_id, $data[0]['author'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( self::$author_id, $data[0]['author'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -316,9 +316,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'per_page', self::$per_page );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'author_exclude', self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_posts - 1, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_posts - 1, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( self::$editor_id, $data[0]['author'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( self::$editor_id, $data[1]['author'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -349,8 +349,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'include', array( $id1, $id2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
- $this->assertEquals( $id2, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
+ $this->assertSame( $id2, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertPostsOrderedBy( '{posts}.post_date DESC' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // 'orderby' => 'include'.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -357,8 +357,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'include' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
- $this->assertEquals( $id1, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
+ $this->assertSame( $id1, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertPostsOrderedBy( "FIELD({posts}.ID,$id1,$id2)" );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Invalid 'include' should error.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -395,10 +395,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( self::$author_id, $data[0]['author'] );
- $this->assertEquals( self::$editor_id, $data[1]['author'] );
- $this->assertEquals( self::$editor_id, $data[2]['author'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( self::$author_id, $data[0]['author'] );
+ $this->assertSame( self::$editor_id, $data[1]['author'] );
+ $this->assertSame( self::$editor_id, $data[2]['author'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertPostsOrderedBy( '{posts}.post_author DESC' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -419,10 +419,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( $id1, $data[0]['id'] );
- $this->assertEquals( $id3, $data[1]['id'] );
- $this->assertEquals( $id2, $data[2]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( $id1, $data[0]['id'] );
+ $this->assertSame( $id3, $data[1]['id'] );
+ $this->assertSame( $id2, $data[2]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertPostsOrderedBy( '{posts}.post_modified DESC' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -455,12 +455,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( $id3, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( $id3, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Check ordering. Default ORDER is DESC.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id1, $data[0]['parent'] );
- $this->assertEquals( 0, $data[1]['parent'] );
- $this->assertEquals( 0, $data[2]['parent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id1, $data[0]['parent'] );
+ $this->assertSame( 0, $data[1]['parent'] );
+ $this->assertSame( 0, $data[2]['parent'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertPostsOrderedBy( '{posts}.post_parent DESC' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -507,14 +507,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'per_page', self::$per_page );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_posts, count( $response->get_data() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_posts, count( $response->get_data() ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'search', 'Search Result' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( 'Search Result', $data[0]['title']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( 'Search Result', $data[0]['title']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_slug_query() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -534,10 +534,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'slug', 'apple' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( 'Apple', $data[0]['title']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( 'Apple', $data[0]['title']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_multiple_slugs_array_query() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -563,15 +563,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'slug', array( 'banana', 'peach' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $titles = array(
</span><span class="cx" style="display: block; padding: 0 10px"> $data[0]['title']['rendered'],
</span><span class="cx" style="display: block; padding: 0 10px"> $data[1]['title']['rendered'],
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $titles );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'Banana', 'Peach' ), $titles );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'Banana', 'Peach' ), $titles );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_multiple_slugs_string_query() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -597,15 +597,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'slug', 'apple,banana' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $titles = array(
</span><span class="cx" style="display: block; padding: 0 10px"> $data[0]['title']['rendered'],
</span><span class="cx" style="display: block; padding: 0 10px"> $data[1]['title']['rendered'],
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $titles );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'Apple', 'Banana' ), $titles );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'Apple', 'Banana' ), $titles );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_status_query() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -617,8 +617,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'per_page', self::$per_page );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'status', 'publish' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( self::$total_posts, count( $response->get_data() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( self::$total_posts, count( $response->get_data() ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'status', 'draft' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -630,8 +630,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'status', 'draft' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( 1, count( $response->get_data() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( 1, count( $response->get_data() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_multiple_statuses_string_query() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -646,15 +646,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'status', 'draft,private' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $statuses = array(
</span><span class="cx" style="display: block; padding: 0 10px"> $data[0]['status'],
</span><span class="cx" style="display: block; padding: 0 10px"> $data[1]['status'],
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $statuses );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'draft', 'private' ), $statuses );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'draft', 'private' ), $statuses );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_multiple_statuses_array_query() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -669,15 +669,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'status', array( 'draft', 'pending' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $statuses = array(
</span><span class="cx" style="display: block; padding: 0 10px"> $data[0]['status'],
</span><span class="cx" style="display: block; padding: 0 10px"> $data[1]['status'],
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $statuses );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'draft', 'pending' ), $statuses );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'draft', 'pending' ), $statuses );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_multiple_statuses_one_invalid_query() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -724,7 +724,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $all_data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $all_data as $post ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -765,7 +765,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'title' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Apple Sauce', $data[0]['title']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Apple Sauce', $data[0]['title']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertPostsOrderedBy( '{posts}.post_title DESC' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // 'order' => 'asc'.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -772,7 +772,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'order', 'asc' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Apple Cobbler', $data[0]['title']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Apple Cobbler', $data[0]['title']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertPostsOrderedBy( '{posts}.post_title ASC' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // 'order' => 'asc,id' should error.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -826,9 +826,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Default ORDER is DESC.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id3, $data[0]['id'] );
- $this->assertEquals( $id2, $data[1]['id'] );
- $this->assertEquals( $id1, $data[2]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id3, $data[0]['id'] );
+ $this->assertSame( $id2, $data[1]['id'] );
+ $this->assertSame( $id1, $data[2]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertPostsOrderedBy( '{posts}.ID DESC' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -856,8 +856,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Default ORDER is DESC.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'xyz', $data[0]['slug'] );
- $this->assertEquals( 'abc', $data[1]['slug'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'xyz', $data[0]['slug'] );
+ $this->assertSame( 'abc', $data[1]['slug'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertPostsOrderedBy( '{posts}.post_name DESC' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -880,9 +880,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'taco', $data[0]['slug'] );
- $this->assertEquals( 'chalupa', $data[1]['slug'] );
- $this->assertEquals( 'burrito', $data[2]['slug'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'taco', $data[0]['slug'] );
+ $this->assertSame( 'chalupa', $data[1]['slug'] );
+ $this->assertSame( 'burrito', $data[2]['slug'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_with_orderby_relevance() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -905,11 +905,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'relevance' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'search', 'relevant' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id1, $data[0]['id'] );
- $this->assertEquals( $id2, $data[1]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id1, $data[0]['id'] );
+ $this->assertSame( $id2, $data[1]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertPostsOrderedBy( '{posts}.post_title LIKE \'%relevant%\' DESC, {posts}.post_date DESC' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -933,11 +933,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'relevance' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'search', 'relevant content' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id1, $data[0]['id'] );
- $this->assertEquals( $id2, $data[1]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id1, $data[0]['id'] );
+ $this->assertSame( $id2, $data[1]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertPostsOrderedBy( '(CASE WHEN {posts}.post_title LIKE \'%relevant content%\' THEN 1 WHEN {posts}.post_title LIKE \'%relevant%\' AND {posts}.post_title LIKE \'%content%\' THEN 2 WHEN {posts}.post_title LIKE \'%relevant%\' OR {posts}.post_title LIKE \'%content%\' THEN 3 WHEN {posts}.post_excerpt LIKE \'%relevant content%\' THEN 4 WHEN {posts}.post_content LIKE \'%relevant content%\' THEN 5 ELSE 6 END), {posts}.post_date DESC' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -983,7 +983,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id1, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id1, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_tags_exclude_query() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1004,9 +1004,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( $total_posts - 1, $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id4, $data[0]['id'] );
- $this->assertEquals( $id3, $data[1]['id'] );
- $this->assertEquals( $id2, $data[2]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id4, $data[0]['id'] );
+ $this->assertSame( $id3, $data[1]['id'] );
+ $this->assertSame( $id2, $data[2]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_tags_and_categories_query() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1052,8 +1052,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id2, $data[0]['id'] );
- $this->assertEquals( $id1, $data[1]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id2, $data[0]['id'] );
+ $this->assertSame( $id1, $data[1]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_tags_and_categories_exclude_query() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1073,7 +1073,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id2, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id2, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'tags_exclude', array( 'my-tag' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1108,9 +1108,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( $total_posts - 1, $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id4, $data[0]['id'] );
- $this->assertEquals( $id2, $data[1]['id'] );
- $this->assertEquals( $id1, $data[2]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id4, $data[0]['id'] );
+ $this->assertSame( $id2, $data[1]['id'] );
+ $this->assertSame( $id1, $data[2]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1122,9 +1122,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'include', self::$post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $response->get_data() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$post_id, $response->get_data()[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$post_id, $response->get_data()[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_sticky() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1141,7 +1141,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $post = $posts[0];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id2, $post['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id2, $post['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'sticky', 'nothanks' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1179,7 +1179,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $post = $posts[0];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id1, $post['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id1, $post['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertPostsWhere( " AND {posts}.ID IN ($id1) AND {posts}.post_type = 'post' AND (({posts}.post_status = 'publish'))" );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1236,7 +1236,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $post = $posts[0];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id1, $post['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id1, $post['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertPostsWhere( " AND {posts}.ID NOT IN ($id2) AND {posts}.post_type = 'post' AND (({posts}.post_status = 'publish'))" );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1301,8 +1301,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_posts, $headers['X-WP-Total'] );
- $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_posts, $headers['X-WP-Total'] );
+ $this->assertSame( $total_pages, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $next_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'page' => 2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1320,8 +1320,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'page', 3 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_posts, $headers['X-WP-Total'] );
- $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_posts, $headers['X-WP-Total'] );
+ $this->assertSame( $total_pages, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $prev_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'page' => 2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1342,8 +1342,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'page', $total_pages );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_posts, $headers['X-WP-Total'] );
- $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_posts, $headers['X-WP-Total'] );
+ $this->assertSame( $total_pages, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $prev_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'page' => $total_pages - 1,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1371,8 +1371,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_posts, $headers['X-WP-Total'] );
- $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_posts, $headers['X-WP-Total'] );
+ $this->assertSame( $total_pages, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $prev_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'per_page' => 5,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1415,7 +1415,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $draft_id, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $draft_id, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1438,9 +1438,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $private_post_id, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $private_post_id, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_invalid_per_page() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1487,7 +1487,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post2, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post2, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_all_post_formats() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1497,7 +1497,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $formats = array_values( get_post_format_slugs() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $formats, $data['schema']['properties']['format']['enum'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $formats, $data['schema']['properties']['format']['enum'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1513,23 +1513,23 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $links = $response->get_links();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( rest_url( '/wp/v2/posts/' . self::$post_id ), $links['self'][0]['href'] );
- $this->assertEquals( rest_url( '/wp/v2/posts' ), $links['collection'][0]['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( rest_url( '/wp/v2/posts/' . self::$post_id ), $links['self'][0]['href'] );
+ $this->assertSame( rest_url( '/wp/v2/posts' ), $links['collection'][0]['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'embeddable', $links['self'][0]['attributes'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( rest_url( '/wp/v2/types/' . get_post_type( self::$post_id ) ), $links['about'][0]['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( rest_url( '/wp/v2/types/' . get_post_type( self::$post_id ) ), $links['about'][0]['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $replies_url = rest_url( '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px"> $replies_url = add_query_arg( 'post', self::$post_id, $replies_url );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $replies_url, $links['replies'][0]['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $replies_url, $links['replies'][0]['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( rest_url( '/wp/v2/posts/' . self::$post_id . '/revisions' ), $links['version-history'][0]['href'] );
- $this->assertEquals( 0, $links['version-history'][0]['attributes']['count'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( rest_url( '/wp/v2/posts/' . self::$post_id . '/revisions' ), $links['version-history'][0]['href'] );
+ $this->assertSame( 0, $links['version-history'][0]['attributes']['count'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( isset( $links['predecessor-version'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $attachments_url = rest_url( '/wp/v2/media' );
</span><span class="cx" style="display: block; padding: 0 10px"> $attachments_url = add_query_arg( 'parent', self::$post_id, $attachments_url );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $attachments_url, $links['https://api.w.org/attachment'][0]['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $attachments_url, $links['https://api.w.org/attachment'][0]['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $term_links = $links['https://api.w.org/term'];
</span><span class="cx" style="display: block; padding: 0 10px"> $tag_link = null;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1549,10 +1549,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $format_link );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $tags_url = add_query_arg( 'post', self::$post_id, rest_url( '/wp/v2/tags' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $tags_url, $tag_link['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $tags_url, $tag_link['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $category_url = add_query_arg( 'post', self::$post_id, rest_url( '/wp/v2/categories' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $category_url, $cat_link['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $category_url, $cat_link['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_links_predecessor() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1570,11 +1570,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $links = $response->get_links();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( rest_url( '/wp/v2/posts/' . self::$post_id . '/revisions' ), $links['version-history'][0]['href'] );
- $this->assertEquals( 1, $links['version-history'][0]['attributes']['count'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( rest_url( '/wp/v2/posts/' . self::$post_id . '/revisions' ), $links['version-history'][0]['href'] );
+ $this->assertSame( 1, $links['version-history'][0]['attributes']['count'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( rest_url( '/wp/v2/posts/' . self::$post_id . '/revisions/' . $revision_1->ID ), $links['predecessor-version'][0]['href'] );
- $this->assertEquals( $revision_1->ID, $links['predecessor-version'][0]['attributes']['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( rest_url( '/wp/v2/posts/' . self::$post_id . '/revisions/' . $revision_1->ID ), $links['predecessor-version'][0]['href'] );
+ $this->assertSame( $revision_1->ID, $links['predecessor-version'][0]['attributes']['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_links_no_author() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1591,7 +1591,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/posts/%d', self::$post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $links = $response->get_links();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( rest_url( '/wp/v2/users/' . self::$author_id ), $links['author'][0]['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( rest_url( '/wp/v2/users/' . self::$author_id ), $links['author'][0]['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_post_draft_status_not_authenicated() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1672,9 +1672,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_get_post_response( $response, 'view' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $data['content']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $data['content']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['content']['protected'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $data['excerpt']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $data['excerpt']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['excerpt']['protected'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1696,9 +1696,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_get_post_response( $response, 'view' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wpautop( $post->post_content ), $data['content']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wpautop( $post->post_content ), $data['content']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['content']['protected'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wpautop( $post->post_excerpt ), $data['excerpt']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wpautop( $post->post_excerpt ), $data['excerpt']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['excerpt']['protected'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1731,9 +1731,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_get_post_response( $response, 'view' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $data['content']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $data['content']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['content']['protected'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $data['excerpt']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $data['excerpt']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['excerpt']['protected'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1811,7 +1811,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/posts/%d', self::$post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Private status.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_post(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1823,7 +1823,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/posts/%d', self::$post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_prepare_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1845,7 +1845,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( '_fields', 'id,slug' );
</span><span class="cx" style="display: block; padding: 0 10px"> $obj = get_post( self::$post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $endpoint->prepare_item_for_response( $obj, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'id',
</span><span class="cx" style="display: block; padding: 0 10px"> 'slug',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1878,7 +1878,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'the_content', $filter_content );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'id' => self::$post_id,
</span><span class="cx" style="display: block; padding: 0 10px"> 'content' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1914,7 +1914,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'the_content', $filter_content );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'id' => $post->ID,
</span><span class="cx" style="display: block; padding: 0 10px"> 'content' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2029,17 +2029,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'timezone_string', '' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $data['id'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $results['date'], $data['date'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $results['date'], $data['date'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_date = str_replace( 'T', ' ', $results['date'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_date, $post->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_date, $post->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $results['date_gmt'], $data['date_gmt'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $results['date_gmt'], $data['date_gmt'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_date_gmt = str_replace( 'T', ' ', $results['date_gmt'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_date_gmt, $post->post_date_gmt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_date_gmt, $post->post_date_gmt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2070,8 +2070,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'theme_post_templates', array( $this, 'filter_theme_post_templates' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'post-my-test-template.php', $data['template'] );
- $this->assertEquals( 'post-my-test-template.php', $post_template );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'post-my-test-template.php', $data['template'] );
+ $this->assertSame( 'post-my-test-template.php', $post_template );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2113,8 +2113,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $post_template = get_page_template_slug( get_post( $data['id'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $data['template'] );
- $this->assertEquals( '', $post_template );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $data['template'] );
+ $this->assertSame( '', $post_template );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_create_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2160,11 +2160,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0000-00-00 00:00:00', $post->post_date_gmt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0000-00-00 00:00:00', $post->post_date_gmt );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( '0000-00-00T00:00:00', $data['date_gmt'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_create_post_response( $response );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2185,9 +2185,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( true, $new_data['sticky'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertTrue( $new_data['sticky'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $new_data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( true, is_sticky( $post->ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertTrue( is_sticky( $post->ID ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_post_sticky_as_contributor() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2250,14 +2250,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $new_post = get_post( $data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'draft', $data['status'] );
- $this->assertEquals( 'draft', $new_post->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'draft', $data['status'] );
+ $this->assertSame( 'draft', $new_post->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Confirm dates are shimmed for gmt_offset.
</span><span class="cx" style="display: block; padding: 0 10px"> $post_modified_gmt = gmdate( 'Y-m-d H:i:s', strtotime( $new_post->post_modified ) + ( get_option( 'gmt_offset' ) * 3600 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $post_date_gmt = gmdate( 'Y-m-d H:i:s', strtotime( $new_post->post_date ) + ( get_option( 'gmt_offset' ) * 3600 ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( mysql_to_rfc3339( $post_modified_gmt ), $data['modified_gmt'] );
- $this->assertEquals( mysql_to_rfc3339( $post_date_gmt ), $data['date_gmt'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( mysql_to_rfc3339( $post_modified_gmt ), $data['modified_gmt'] );
+ $this->assertSame( mysql_to_rfc3339( $post_date_gmt ), $data['date_gmt'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_post_private() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2274,8 +2274,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $new_post = get_post( $data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'private', $data['status'] );
- $this->assertEquals( 'private', $new_post->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'private', $data['status'] );
+ $this->assertSame( 'private', $new_post->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_post_private_without_permission() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2350,8 +2350,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $new_post = get_post( $data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'gallery', $data['format'] );
- $this->assertEquals( 'gallery', get_post_format( $new_post->ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'gallery', $data['format'] );
+ $this->assertSame( 'gallery', get_post_format( $new_post->ID ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_post_with_standard_format() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2368,7 +2368,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $new_post = get_post( $data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'standard', $data['format'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'standard', $data['format'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_post_format( $new_post->ID ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2403,10 +2403,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'link', $data['format'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'link', $data['format'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_update_post_with_featured_media() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2433,8 +2433,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $new_post = get_post( $data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->attachment_id, $data['featured_media'] );
- $this->assertEquals( $this->attachment_id, (int) get_post_thumbnail_id( $new_post->ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->attachment_id, $data['featured_media'] );
+ $this->assertSame( $this->attachment_id, (int) get_post_thumbnail_id( $new_post->ID ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/posts/' . $new_post->ID );
</span><span class="cx" style="display: block; padding: 0 10px"> $params = $this->set_post_data(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2445,8 +2445,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $data['featured_media'] );
- $this->assertEquals( 0, (int) get_post_thumbnail_id( $new_post->ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $data['featured_media'] );
+ $this->assertSame( 0, (int) get_post_thumbnail_id( $new_post->ID ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_post_invalid_author() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2492,7 +2492,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'testing', $data['password'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'testing', $data['password'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_post_with_falsey_password() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2508,7 +2508,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0', $data['password'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0', $data['password'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_post_with_empty_string_password_and_sticky() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2524,9 +2524,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $data['password'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $data['password'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_post_with_password_and_sticky_fails() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2560,8 +2560,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $new_post = get_post( $data['id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $time = gmmktime( 2, 0, 0, 1, 1, 2010 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2010-01-01T02:00:00', $data['date'] );
- $this->assertEquals( $time, strtotime( $new_post->post_date ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2010-01-01T02:00:00', $data['date'] );
+ $this->assertSame( $time, strtotime( $new_post->post_date ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_post_custom_date_with_timezone() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2580,11 +2580,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_post = get_post( $data['id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $time = gmmktime( 12, 0, 0, 1, 1, 2010 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2010-01-01T12:00:00', $data['date'] );
- $this->assertEquals( '2010-01-01T12:00:00', $data['modified'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2010-01-01T12:00:00', $data['date'] );
+ $this->assertSame( '2010-01-01T12:00:00', $data['modified'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $time, strtotime( $new_post->post_date ) );
- $this->assertEquals( $time, strtotime( $new_post->post_modified ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $time, strtotime( $new_post->post_date ) );
+ $this->assertSame( $time, strtotime( $new_post->post_modified ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_post_with_db_error() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2652,7 +2652,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "Rob O'Rourke's Diary", $data['title']['raw'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "Rob O'Rourke's Diary", $data['title']['raw'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_post_with_categories() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2673,7 +2673,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $category['term_id'] ), $data['categories'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $category['term_id'] ), $data['categories'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_post_with_categories_as_csv() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2692,7 +2692,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $category['term_id'], $category2['term_id'] ), $data['categories'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $category['term_id'], $category2['term_id'] ), $data['categories'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_post_with_invalid_categories() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2711,7 +2711,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $data['categories'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $data['categories'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2757,14 +2757,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_update_post_response( $response );
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$post_id, $new_data['id'] );
- $this->assertEquals( $params['title'], $new_data['title']['raw'] );
- $this->assertEquals( $params['content'], $new_data['content']['raw'] );
- $this->assertEquals( $params['excerpt'], $new_data['excerpt']['raw'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$post_id, $new_data['id'] );
+ $this->assertSame( $params['title'], $new_data['title']['raw'] );
+ $this->assertSame( $params['content'], $new_data['content']['raw'] );
+ $this->assertSame( $params['excerpt'], $new_data['excerpt']['raw'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( self::$post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $params['title'], $post->post_title );
- $this->assertEquals( $params['content'], $post->post_content );
- $this->assertEquals( $params['excerpt'], $post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $params['title'], $post->post_title );
+ $this->assertSame( $params['content'], $post->post_content );
+ $this->assertSame( $params['excerpt'], $post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item_no_change() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2795,14 +2795,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_update_post_response( $response );
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$post_id, $new_data['id'] );
- $this->assertEquals( $params['title'], $new_data['title']['raw'] );
- $this->assertEquals( $params['content'], $new_data['content']['raw'] );
- $this->assertEquals( $params['excerpt'], $new_data['excerpt']['raw'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$post_id, $new_data['id'] );
+ $this->assertSame( $params['title'], $new_data['title']['raw'] );
+ $this->assertSame( $params['content'], $new_data['content']['raw'] );
+ $this->assertSame( $params['excerpt'], $new_data['excerpt']['raw'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( self::$post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $params['title'], $post->post_title );
- $this->assertEquals( $params['content'], $post->post_content );
- $this->assertEquals( $params['excerpt'], $post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $params['title'], $post->post_title );
+ $this->assertSame( $params['content'], $post->post_content );
+ $this->assertSame( $params['excerpt'], $post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2837,8 +2837,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify the post is set to the future date.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_data['date_gmt'], $future_date );
- $this->assertEquals( $new_data['date'], $future_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_data['date_gmt'], $future_date );
+ $this->assertSame( $new_data['date'], $future_date );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $new_data['date_gmt'], $new_data['modified_gmt'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $new_data['date'], $new_data['modified'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2858,11 +2858,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify the date field values are reset in the API response.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_update_post_response( $response );
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_data['date_gmt'], $new_data['date'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_data['date_gmt'], $new_data['date'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $new_data['date_gmt'], $future_date );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id, 'ARRAY_A' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post['post_date_gmt'], '0000-00-00 00:00:00' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post['post_date_gmt'], '0000-00-00 00:00:00' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $new_data['date_gmt'], $future_date );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $new_data['date'], $future_date );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2878,14 +2878,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_update_post_response( $response );
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$post_id, $new_data['id'] );
- $this->assertEquals( $params['title']['raw'], $new_data['title']['raw'] );
- $this->assertEquals( $params['content']['raw'], $new_data['content']['raw'] );
- $this->assertEquals( $params['excerpt']['raw'], $new_data['excerpt']['raw'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$post_id, $new_data['id'] );
+ $this->assertSame( $params['title']['raw'], $new_data['title']['raw'] );
+ $this->assertSame( $params['content']['raw'], $new_data['content']['raw'] );
+ $this->assertSame( $params['excerpt']['raw'], $new_data['excerpt']['raw'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( self::$post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $params['title']['raw'], $post->post_title );
- $this->assertEquals( $params['content']['raw'], $post->post_content );
- $this->assertEquals( $params['excerpt']['raw'], $post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $params['title']['raw'], $post->post_title );
+ $this->assertSame( $params['content']['raw'], $post->post_content );
+ $this->assertSame( $params['excerpt']['raw'], $post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_post_without_extra_params() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2968,8 +2968,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $new_post = get_post( $data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'gallery', $data['format'] );
- $this->assertEquals( 'gallery', get_post_format( $new_post->ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'gallery', $data['format'] );
+ $this->assertSame( 'gallery', get_post_format( $new_post->ID ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_post_with_standard_format() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2986,7 +2986,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $new_post = get_post( $data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'standard', $data['format'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'standard', $data['format'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_post_format( $new_post->ID ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3021,10 +3021,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'link', $data['format'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'link', $data['format'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_post_ignore_readonly() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3047,12 +3047,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $new_post = get_post( $data['id'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_content, $data['content']['raw'] );
- $this->assertEquals( $new_content, $new_post->post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_content, $data['content']['raw'] );
+ $this->assertSame( $new_content, $new_post->post_content );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The modified date should equal the current time.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( gmdate( 'Y-m-d', strtotime( mysql_to_rfc3339( $expected_modified ) ) ), gmdate( 'Y-m-d', strtotime( $data['modified'] ) ) );
- $this->assertEquals( gmdate( 'Y-m-d', strtotime( $expected_modified ) ), gmdate( 'Y-m-d', strtotime( $new_post->post_modified ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( gmdate( 'Y-m-d', strtotime( mysql_to_rfc3339( $expected_modified ) ) ), gmdate( 'Y-m-d', strtotime( $data['modified'] ) ) );
+ $this->assertSame( gmdate( 'Y-m-d', strtotime( $expected_modified ) ), gmdate( 'Y-m-d', strtotime( $new_post->post_modified ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3076,17 +3076,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'timezone_string', '' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $data['id'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $results['date'], $data['date'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $results['date'], $data['date'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_date = str_replace( 'T', ' ', $results['date'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_date, $post->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_date, $post->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $results['date_gmt'], $data['date_gmt'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $results['date_gmt'], $data['date_gmt'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_date_gmt = str_replace( 'T', ' ', $results['date_gmt'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_date_gmt, $post->post_date_gmt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_date_gmt, $post->post_date_gmt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_post_with_invalid_date() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3144,29 +3144,29 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_delete( $post_id, 'posts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post->post_date, '2016-02-23 12:00:00' );
- $this->assertEquals( $post->post_date_gmt, '0000-00-00 00:00:00' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post->post_date, '2016-02-23 12:00:00' );
+ $this->assertSame( $post->post_date_gmt, '0000-00-00 00:00:00' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/posts/%d', $post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2016-02-23T12:00:00', $data['date'] );
- $this->assertEquals( '2016-02-23T18:00:00', $data['date_gmt'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2016-02-23T12:00:00', $data['date'] );
+ $this->assertSame( '2016-02-23T18:00:00', $data['date_gmt'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/posts/%d', $post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'date', '2016-02-23T13:00:00' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2016-02-23T13:00:00', $data['date'] );
- $this->assertEquals( '2016-02-23T19:00:00', $data['date_gmt'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2016-02-23T13:00:00', $data['date'] );
+ $this->assertSame( '2016-02-23T19:00:00', $data['date_gmt'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post->post_date, '2016-02-23 13:00:00' );
- $this->assertEquals( $post->post_date_gmt, '2016-02-23 19:00:00' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post->post_date, '2016-02-23 13:00:00' );
+ $this->assertSame( $post->post_date_gmt, '2016-02-23 19:00:00' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'timezone_string', '' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3184,9 +3184,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'sample-slug', $new_data['slug'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'sample-slug', $new_data['slug'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $new_data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'sample-slug', $post->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'sample-slug', $post->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_post_slug_accented_chars() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3202,9 +3202,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test-accented-charaecters', $new_data['slug'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test-accented-charaecters', $new_data['slug'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $new_data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test-accented-charaecters', $post->post_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test-accented-charaecters', $post->post_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_post_sticky() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3220,9 +3220,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( true, $new_data['sticky'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertTrue( $new_data['sticky'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $new_data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( true, is_sticky( $post->ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertTrue( is_sticky( $post->ID ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Updating another field shouldn't change sticky status.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/posts/%d', self::$post_id ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3235,9 +3235,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( true, $new_data['sticky'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertTrue( $new_data['sticky'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $new_data['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( true, is_sticky( $post->ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertTrue( is_sticky( $post->ID ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_post_excerpt() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3252,7 +3252,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'An Excerpt', $new_data['excerpt']['raw'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'An Excerpt', $new_data['excerpt']['raw'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_post_empty_excerpt() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3267,7 +3267,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $new_data['excerpt']['raw'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $new_data['excerpt']['raw'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_post_content() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3282,7 +3282,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Some Content', $new_data['content']['raw'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Some Content', $new_data['content']['raw'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_post_empty_content() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3297,7 +3297,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $new_data['content']['raw'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $new_data['content']['raw'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_post_with_empty_password() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3319,7 +3319,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $data['password'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $data['password'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_post_with_password_and_sticky_fails() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3389,7 +3389,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "Rob O'Rourke's Diary", $new_data['title']['raw'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "Rob O'Rourke's Diary", $new_data['title']['raw'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_post_with_categories() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3409,7 +3409,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $category['term_id'] ), $new_data['categories'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $category['term_id'] ), $new_data['categories'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $categories_path = '';
</span><span class="cx" style="display: block; padding: 0 10px"> $links = $response->get_links();
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $links['https://api.w.org/term'] as $link ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3426,7 +3426,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Test Category', $data[0]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Test Category', $data[0]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_post_with_empty_categories() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3445,7 +3445,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $new_data['categories'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $new_data['categories'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3499,8 +3499,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $post_template = get_page_template_slug( get_post( $data['id'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'post-my-test-template.php', $data['template'] );
- $this->assertEquals( 'post-my-test-template.php', $post_template );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'post-my-test-template.php', $data['template'] );
+ $this->assertSame( 'post-my-test-template.php', $post_template );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3530,8 +3530,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $post_template = get_page_template_slug( get_post( $data['id'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $data['template'] );
- $this->assertEquals( '', $post_template );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $data['template'] );
+ $this->assertSame( '', $post_template );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3554,13 +3554,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $post_template = get_page_template_slug( get_post( $data['id'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'post-my-invalid-template.php', $post_template );
- $this->assertEquals( 'post-my-invalid-template.php', $data['template'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'post-my-invalid-template.php', $post_template );
+ $this->assertSame( 'post-my-invalid-template.php', $data['template'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function verify_post_roundtrip( $input = array(), $expected_output = array() ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3570,22 +3570,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( $name, $value );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $actual_output = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to actual API output.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['title']['raw'], $actual_output['title']['raw'] );
- $this->assertEquals( $expected_output['title']['rendered'], trim( $actual_output['title']['rendered'] ) );
- $this->assertEquals( $expected_output['content']['raw'], $actual_output['content']['raw'] );
- $this->assertEquals( $expected_output['content']['rendered'], trim( $actual_output['content']['rendered'] ) );
- $this->assertEquals( $expected_output['excerpt']['raw'], $actual_output['excerpt']['raw'] );
- $this->assertEquals( $expected_output['excerpt']['rendered'], trim( $actual_output['excerpt']['rendered'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['title']['raw'], $actual_output['title']['raw'] );
+ $this->assertSame( $expected_output['title']['rendered'], trim( $actual_output['title']['rendered'] ) );
+ $this->assertSame( $expected_output['content']['raw'], $actual_output['content']['raw'] );
+ $this->assertSame( $expected_output['content']['rendered'], trim( $actual_output['content']['rendered'] ) );
+ $this->assertSame( $expected_output['excerpt']['raw'], $actual_output['excerpt']['raw'] );
+ $this->assertSame( $expected_output['excerpt']['rendered'], trim( $actual_output['excerpt']['rendered'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to WP internal values.
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $actual_output['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['title']['raw'], $post->post_title );
- $this->assertEquals( $expected_output['content']['raw'], $post->post_content );
- $this->assertEquals( $expected_output['excerpt']['raw'], $post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['title']['raw'], $post->post_title );
+ $this->assertSame( $expected_output['content']['raw'], $post->post_content );
+ $this->assertSame( $expected_output['excerpt']['raw'], $post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update the post.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/posts/%d', $actual_output['id'] ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3593,22 +3593,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( $name, $value );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $actual_output = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to actual API output.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['title']['raw'], $actual_output['title']['raw'] );
- $this->assertEquals( $expected_output['title']['rendered'], trim( $actual_output['title']['rendered'] ) );
- $this->assertEquals( $expected_output['content']['raw'], $actual_output['content']['raw'] );
- $this->assertEquals( $expected_output['content']['rendered'], trim( $actual_output['content']['rendered'] ) );
- $this->assertEquals( $expected_output['excerpt']['raw'], $actual_output['excerpt']['raw'] );
- $this->assertEquals( $expected_output['excerpt']['rendered'], trim( $actual_output['excerpt']['rendered'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['title']['raw'], $actual_output['title']['raw'] );
+ $this->assertSame( $expected_output['title']['rendered'], trim( $actual_output['title']['rendered'] ) );
+ $this->assertSame( $expected_output['content']['raw'], $actual_output['content']['raw'] );
+ $this->assertSame( $expected_output['content']['rendered'], trim( $actual_output['content']['rendered'] ) );
+ $this->assertSame( $expected_output['excerpt']['raw'], $actual_output['excerpt']['raw'] );
+ $this->assertSame( $expected_output['excerpt']['rendered'], trim( $actual_output['excerpt']['rendered'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to WP internal values.
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $actual_output['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['title']['raw'], $post->post_title );
- $this->assertEquals( $expected_output['content']['raw'], $post->post_content );
- $this->assertEquals( $expected_output['excerpt']['raw'], $post->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['title']['raw'], $post->post_title );
+ $this->assertSame( $expected_output['content']['raw'], $post->post_content );
+ $this->assertSame( $expected_output['excerpt']['raw'], $post->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public static function post_roundtrip_provider() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3806,10 +3806,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'force', 'false' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Deleted post', $data['title']['raw'] );
- $this->assertEquals( 'trash', $data['status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Deleted post', $data['title']['raw'] );
+ $this->assertSame( 'trash', $data['status'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_item_skip_trash() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3821,7 +3821,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request['force'] = true;
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['deleted'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $data['previous'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3834,7 +3834,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'DELETE', sprintf( '/wp/v2/posts/%d', $post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertErrorResponse( 'rest_already_trashed', $response, 410 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3889,7 +3889,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $properties = $data['schema']['properties'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 26, count( $properties ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 26, count( $properties ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'author', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'comment_status', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'content', $properties );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3968,7 +3968,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'type',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_keys, $keys );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_keys, $keys );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_post_edit_context_properties() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4009,7 +4009,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'type',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_keys, $keys );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_keys, $keys );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_post_embed_context_properties() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4031,7 +4031,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'type',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_keys, $keys );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_keys, $keys );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_status_array_enum_args() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4040,10 +4040,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $list_posts_args = $data['routes']['/wp/v2/posts']['endpoints'][0]['args'];
</span><span class="cx" style="display: block; padding: 0 10px"> $status_arg = $list_posts_args['status'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'array', $status_arg['type'] );
- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'array', $status_arg['type'] );
+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'type' => 'string',
</del><span class="cx" style="display: block; padding: 0 10px"> 'enum' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'publish',
</span><span class="cx" style="display: block; padding: 0 10px"> 'future',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4059,6 +4058,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'request-completed',
</span><span class="cx" style="display: block; padding: 0 10px"> 'any',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'type' => 'string',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $status_arg['items']
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4088,7 +4088,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'my_custom_int', $data['schema']['properties'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $schema, $data['schema']['properties']['my_custom_int'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $schema, $data['schema']['properties']['my_custom_int'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4571,7 +4571,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'context', 'edit' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'permalink_template', $data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'generated_slug', $data );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4595,9 +4595,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'context', 'edit' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( $expected_permalink_template, $data['permalink_template'] );
- $this->assertEquals( 'permalink-template', $data['generated_slug'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( $expected_permalink_template, $data['permalink_template'] );
+ $this->assertSame( 'permalink-template', $data['generated_slug'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Neither 'permalink_template' and 'generated_slug' are expected for context=view.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4604,7 +4604,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'context', 'view' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'permalink_template', $data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'generated_slug', $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4625,7 +4625,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0000-00-00 00:00:00', $post->post_date_gmt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0000-00-00 00:00:00', $post->post_date_gmt );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $get = new WP_REST_Request( 'GET', "/wp/v2/posts/{$post->ID}" );
</span><span class="cx" style="display: block; padding: 0 10px"> $get->set_query_params( array( 'context' => 'edit' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4642,7 +4642,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( strtotime( $get_body['date'] ), strtotime( $body['date'] ), 'The dates should be equal', 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( strtotime( $get_body['date_gmt'] ), strtotime( $body['date_gmt'] ), 'The dates should be equal', 2 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0000-00-00 00:00:00', get_post( $post->ID )->post_date_gmt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0000-00-00 00:00:00', get_post( $post->ID )->post_date_gmt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4661,7 +4661,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0000-00-00 00:00:00', $post->post_date_gmt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0000-00-00 00:00:00', $post->post_date_gmt );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $get = new WP_REST_Request( 'GET', "/wp/v2/posts/{$post->ID}" );
</span><span class="cx" style="display: block; padding: 0 10px"> $get->set_query_params( array( 'context' => 'edit' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4702,7 +4702,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0000-00-00 00:00:00', $post->post_date_gmt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0000-00-00 00:00:00', $post->post_date_gmt );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $get = new WP_REST_Request( 'GET', "/wp/v2/posts/{$post->ID}" );
</span><span class="cx" style="display: block; padding: 0 10px"> $get->set_query_params( array( 'context' => 'edit' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4859,7 +4859,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $properties = $data['schema']['properties']['content']['properties'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'new_prop', $properties );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'new_context' ), $properties['new_prop']['context'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'new_context' ), $properties['new_prop']['context'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestrequestvalidationphp"></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/rest-api/rest-request-validation.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-request-validation.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-request-validation.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,13 +26,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 1, $request, 'minmaxrange' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'minmaxrange must be between 2 (inclusive) and 10 (inclusive)', $ret->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'minmaxrange must be between 2 (inclusive) and 10 (inclusive)', $ret->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 2, $request, 'minmaxrange' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $ret );
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 10, $request, 'minmaxrange' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $ret );
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 11, $request, 'minmaxrange' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'minmaxrange must be between 2 (inclusive) and 10 (inclusive)', $ret->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'minmaxrange must be between 2 (inclusive) and 10 (inclusive)', $ret->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_validate_within_min_max_range_min_exclusive() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,9 +51,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 1, $request, 'minmaxrange' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'minmaxrange must be between 2 (exclusive) and 10 (inclusive)', $ret->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'minmaxrange must be between 2 (exclusive) and 10 (inclusive)', $ret->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 2, $request, 'minmaxrange' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'minmaxrange must be between 2 (exclusive) and 10 (inclusive)', $ret->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'minmaxrange must be between 2 (exclusive) and 10 (inclusive)', $ret->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 3, $request, 'minmaxrange' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $ret );
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 9, $request, 'minmaxrange' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -61,7 +61,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 10, $request, 'minmaxrange' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $ret );
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 11, $request, 'minmaxrange' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'minmaxrange must be between 2 (exclusive) and 10 (inclusive)', $ret->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'minmaxrange must be between 2 (exclusive) and 10 (inclusive)', $ret->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_validate_within_min_max_range_max_exclusive() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -80,7 +80,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 1, $request, 'minmaxrange' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'minmaxrange must be between 2 (inclusive) and 10 (exclusive)', $ret->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'minmaxrange must be between 2 (inclusive) and 10 (exclusive)', $ret->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 2, $request, 'minmaxrange' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $ret );
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 3, $request, 'minmaxrange' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -88,9 +88,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 9, $request, 'minmaxrange' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $ret );
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 10, $request, 'minmaxrange' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'minmaxrange must be between 2 (inclusive) and 10 (exclusive)', $ret->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'minmaxrange must be between 2 (inclusive) and 10 (exclusive)', $ret->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 11, $request, 'minmaxrange' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'minmaxrange must be between 2 (inclusive) and 10 (exclusive)', $ret->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'minmaxrange must be between 2 (inclusive) and 10 (exclusive)', $ret->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_validate_within_min_max_range_both_exclusive() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,17 +110,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 1, $request, 'minmaxrange' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'minmaxrange must be between 2 (exclusive) and 10 (exclusive)', $ret->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'minmaxrange must be between 2 (exclusive) and 10 (exclusive)', $ret->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 2, $request, 'minmaxrange' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'minmaxrange must be between 2 (exclusive) and 10 (exclusive)', $ret->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'minmaxrange must be between 2 (exclusive) and 10 (exclusive)', $ret->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 3, $request, 'minmaxrange' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $ret );
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 9, $request, 'minmaxrange' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $ret );
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 10, $request, 'minmaxrange' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'minmaxrange must be between 2 (exclusive) and 10 (exclusive)', $ret->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'minmaxrange must be between 2 (exclusive) and 10 (exclusive)', $ret->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 11, $request, 'minmaxrange' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'minmaxrange must be between 2 (exclusive) and 10 (exclusive)', $ret->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'minmaxrange must be between 2 (exclusive) and 10 (exclusive)', $ret->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_validate_greater_than_min_inclusive() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,7 +137,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 1, $request, 'greaterthanmin' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'greaterthanmin must be greater than or equal to 2', $ret->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'greaterthanmin must be greater than or equal to 2', $ret->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 2, $request, 'greaterthanmin' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $ret );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -157,9 +157,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 1, $request, 'greaterthanmin' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'greaterthanmin must be greater than 2', $ret->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'greaterthanmin must be greater than 2', $ret->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 2, $request, 'greaterthanmin' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'greaterthanmin must be greater than 2', $ret->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'greaterthanmin must be greater than 2', $ret->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 3, $request, 'greaterthanmin' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $ret );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -178,7 +178,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 11, $request, 'lessthanmax' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'lessthanmax must be less than or equal to 10', $ret->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'lessthanmax must be less than or equal to 10', $ret->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 10, $request, 'lessthanmax' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $ret );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -198,9 +198,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 11, $request, 'lessthanmax' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'lessthanmax must be less than 10', $ret->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'lessthanmax must be less than 10', $ret->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 10, $request, 'lessthanmax' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'lessthanmax must be less than 10', $ret->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'lessthanmax must be less than 10', $ret->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $ret = rest_validate_request_arg( 9, $request, 'lessthanmax' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $ret );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestrequestphp"></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/rest-api/rest-request.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-request.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-request.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,7 +23,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->request->set_header( 'Content-Type', $value );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, $this->request->get_header( 'Content-Type' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, $this->request->get_header( 'Content-Type' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_header_missing() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_remove_header() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->request->add_header( 'Test-Header', 'value' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'value', $this->request->get_header( 'Test-Header' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'value', $this->request->get_header( 'Test-Header' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->request->remove_header( 'Test-Header' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $this->request->get_header( 'Test-Header' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,8 +45,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->request->add_header( 'Accept', $value1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->request->add_header( 'Accept', $value2 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value1 . ',' . $value2, $this->request->get_header( 'Accept' ) );
- $this->assertEquals( array( $value1, $value2 ), $this->request->get_header_as_array( 'Accept' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value1 . ',' . $value2, $this->request->get_header( 'Accept' ) );
+ $this->assertSame( array( $value1, $value2 ), $this->request->get_header_as_array( 'Accept' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public static function header_provider() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -66,7 +66,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $expected Expected canonicalized version.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_header_canonicalization( $original, $expected ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $this->request->canonicalize_header_name( $original ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $this->request->canonicalize_header_name( $original ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public static function content_type_provider() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -96,10 +96,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->request->set_header( 'Content-Type', $header );
</span><span class="cx" style="display: block; padding: 0 10px"> $parsed = $this->request->get_content_type();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, $parsed['value'] );
- $this->assertEquals( $type, $parsed['type'] );
- $this->assertEquals( $subtype, $parsed['subtype'] );
- $this->assertEquals( $parameters, $parsed['parameters'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, $parsed['value'] );
+ $this->assertSame( $type, $parsed['type'] );
+ $this->assertSame( $subtype, $parsed['subtype'] );
+ $this->assertSame( $parameters, $parsed['parameters'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected function request_with_parameters() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -144,7 +144,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->request->set_method( 'GET' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that query takes precedence.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'query', $this->request->get_param( 'source' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'query', $this->request->get_param( 'source' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that the correct arguments are parsed (and that falling through
</span><span class="cx" style="display: block; padding: 0 10px"> // the stack works).
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -165,7 +165,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->request->set_attributes( array( 'accept_json' => true ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that POST takes precedence.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'body', $this->request->get_param( 'source' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'body', $this->request->get_param( 'source' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that the correct arguments are parsed (and that falling through
</span><span class="cx" style="display: block; padding: 0 10px"> // the stack works).
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,7 +186,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->request->set_attributes( array( 'accept_json' => true ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that JSON takes precedence.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'json', $this->request->get_param( 'source' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'json', $this->request->get_param( 'source' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that the correct arguments are parsed (and that falling through
</span><span class="cx" style="display: block; padding: 0 10px"> // the stack works).
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -208,7 +208,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->request->set_body( '{ this is not json }' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that JSON is ignored.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'body', $this->request->get_param( 'source' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'body', $this->request->get_param( 'source' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that the correct arguments are parsed (and that falling through
</span><span class="cx" style="display: block; padding: 0 10px"> // the stack works).
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -252,7 +252,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->request->set_body_params( array() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->request->set_body( http_build_query( $data ) );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $data as $key => $expected_value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_value, $this->request->get_param( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_value, $this->request->get_param( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -274,7 +274,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->request->set_body( wp_json_encode( $data ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $data as $key => $expected_value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_value, $this->request->get_param( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_value, $this->request->get_param( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -296,7 +296,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->request->set_body( wp_json_encode( $data ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $data as $key => $expected_value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_value, $this->request->get_param( $key ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_value, $this->request->get_param( $key ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -307,12 +307,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'source' => 'body',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'has_default_params' => true,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'has_url_params' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'has_query_params' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'has_body_params' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'has_default_params' => true,
</del><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $this->request->get_params() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $this->request->get_params() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_parameter_merging_with_numeric_keys() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -326,7 +326,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '1' => 'hello',
</span><span class="cx" style="display: block; padding: 0 10px"> '2' => 'goodbye',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $this->request->get_params() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $this->request->get_params() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_sanitize_params() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -352,8 +352,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->request->sanitize_params();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 123, $this->request->get_param( 'someinteger' ) );
- $this->assertEquals( 0, $this->request->get_param( 'somestring' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 123, $this->request->get_param( 'someinteger' ) );
+ $this->assertSame( 0, $this->request->get_param( 'somestring' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_sanitize_params_error() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -378,7 +378,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $valid = $this->request->sanitize_params();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $valid );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'rest_invalid_param', $valid->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'rest_invalid_param', $valid->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_sanitize_params_with_null_callback() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -439,7 +439,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $valid = $this->request->has_valid_params();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $valid );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'rest_missing_callback_param', $valid->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'rest_missing_callback_param', $valid->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_has_valid_params_required_flag_multiple() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -459,7 +459,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $valid = $this->request->has_valid_params();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $valid );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'rest_missing_callback_param', $valid->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'rest_missing_callback_param', $valid->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $valid->get_error_data( 'rest_missing_callback_param' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -487,7 +487,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $valid = $this->request->has_valid_params();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $valid );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'rest_invalid_param', $valid->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'rest_invalid_param', $valid->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_has_valid_params_json_error() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -496,9 +496,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $valid = $this->request->has_valid_params();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $valid );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'rest_invalid_json', $valid->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'rest_invalid_json', $valid->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $valid->get_error_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( JSON_ERROR_SYNTAX, $data['json_error_code'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( JSON_ERROR_SYNTAX, $data['json_error_code'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -534,7 +534,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $valid = $this->request->has_valid_params();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $valid );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'rest_invalid_param', $valid->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'rest_invalid_param', $valid->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $valid->get_error_data( 'rest_invalid_param' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -567,8 +567,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $valid );
</span><span class="cx" style="display: block; padding: 0 10px"> $error_data = $valid->get_error_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'someinteger', 'someotherparams' ), array_keys( $error_data['params'] ) );
- $this->assertEquals( 'This is not valid!', $error_data['params']['someotherparams'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'someinteger', 'someotherparams' ), array_keys( $error_data['params'] ) );
+ $this->assertSame( 'This is not valid!', $error_data['params']['someotherparams'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function _return_wp_error_on_validate_callback() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -594,10 +594,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_from_url( $permalink_structure, $original_url ) {
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'permalink_structure', $permalink_structure );
</span><span class="cx" style="display: block; padding: 0 10px"> $url = add_query_arg( 'foo', 'bar', rest_url( '/wp/v2/posts/1' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $original_url, $url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $original_url, $url );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request = WP_REST_Request::from_url( $url );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_REST_Request', $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/wp/v2/posts/1', $request->get_route() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/wp/v2/posts/1', $request->get_route() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -623,7 +623,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_set_param() {
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request();
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'param', 'value' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'value', $request->get_param( 'param' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'value', $request->get_param( 'param' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_set_param_follows_parameter_order() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -637,15 +637,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'value', $request->get_param( 'param' ) );
- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'value', $request->get_param( 'param' ) );
+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'param' => 'value' ),
</span><span class="cx" style="display: block; padding: 0 10px"> $request->get_json_params()
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'param', 'new_value' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'new_value', $request->get_param( 'param' ) );
- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'new_value', $request->get_param( 'param' ) );
+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'param' => 'new_value' ),
</span><span class="cx" style="display: block; padding: 0 10px"> $request->get_json_params()
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -672,10 +672,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'param', 'new_value' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'new_value', $request->get_param( 'param' ) );
- $this->assertEquals( array(), $request->get_body_params() );
- $this->assertEquals( array( 'param' => 'new_value' ), $request->get_json_params() );
- $this->assertEquals( array( 'param' => 'new_value' ), $request->get_query_params() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'new_value', $request->get_param( 'param' ) );
+ $this->assertSame( array(), $request->get_body_params() );
+ $this->assertSame( array( 'param' => 'new_value' ), $request->get_json_params() );
+ $this->assertSame( array( 'param' => 'new_value' ), $request->get_query_params() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -704,12 +704,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'param_query', 'new_value' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'new_value', $request->get_param( 'param_query' ) );
- $this->assertEquals( array(), $request->get_body_params() );
- $this->assertEquals( array( 'param_body' => 'value_body' ), $request->get_json_params() );
- $this->assertEquals( array( 'param_query' => 'new_value' ), $request->get_query_params() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'new_value', $request->get_param( 'param_query' ) );
+ $this->assertSame( array(), $request->get_body_params() );
+ $this->assertSame( array( 'param_body' => 'value_body' ), $request->get_json_params() );
+ $this->assertSame( array( 'param_query' => 'new_value' ), $request->get_query_params() );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Verify the default wasn't overwritten.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $original_defaults, $request->get_default_params() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $original_defaults, $request->get_default_params() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -733,10 +733,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'param', null );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( null, $request->get_param( 'param' ) );
- $this->assertEquals( array(), $request->get_body_params() );
- $this->assertEquals( array( 'param' => null ), $request->get_json_params() );
- $this->assertEquals( array( 'param' => null ), $request->get_query_params() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $request->get_param( 'param' ) );
+ $this->assertSame( array(), $request->get_body_params() );
+ $this->assertSame( array( 'param' => null ), $request->get_json_params() );
+ $this->assertSame( array( 'param' => null ), $request->get_query_params() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -760,10 +760,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'param', 'new_value' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'new_value', $request->get_param( 'param' ) );
- $this->assertEquals( array(), $request->get_body_params() );
- $this->assertEquals( array( 'param' => 'new_value' ), $request->get_json_params() );
- $this->assertEquals( array( 'param' => 'new_value' ), $request->get_query_params() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'new_value', $request->get_param( 'param' ) );
+ $this->assertSame( array(), $request->get_body_params() );
+ $this->assertSame( array( 'param' => 'new_value' ), $request->get_json_params() );
+ $this->assertSame( array( 'param' => 'new_value' ), $request->get_query_params() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -777,6 +777,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'param', 'value' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $request->has_param( 'param' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'value', $request->get_param( 'param' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'value', $request->get_param( 'param' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestrevisionscontrollerphp"></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/rest-api/rest-revisions-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-revisions-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-revisions-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,13 +110,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/posts/' . self::$post_id . '/revisions' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px"> // Single.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/posts/' . self::$post_id . '/revisions/' . $this->revision_1->ID );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,17 +125,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( $this->total_revisions, $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Reverse chronology.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->revision_id3, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->revision_id3, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->check_get_revision_response( $data[0], $this->revision_3 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->revision_id2, $data[1]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->revision_id2, $data[1]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->check_get_revision_response( $data[1], $this->revision_2 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->revision_id1, $data[2]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->revision_id1, $data[2]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->check_get_revision_response( $data[2], $this->revision_1 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -168,7 +168,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions/' . $this->revision_id1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->check_get_revision_response( $response, $this->revision_1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $fields = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'author',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -262,7 +262,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'DELETE', '/wp/v2/posts/' . self::$post_id . '/revisions/' . $this->revision_id1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'force', true );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( get_post( $this->revision_id1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -308,7 +308,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions/' . $this->revision_id1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->check_get_revision_response( $response, $this->revision_1 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -320,7 +320,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( '_fields', 'id,slug' );
</span><span class="cx" style="display: block; padding: 0 10px"> $revision = get_post( $this->revision_id1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $endpoint->prepare_item_for_response( $revision, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'id',
</span><span class="cx" style="display: block; padding: 0 10px"> 'slug',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -334,7 +334,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $properties = $data['schema']['properties'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 12, count( $properties ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 12, count( $properties ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'author', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'content', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'date', $properties );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -386,7 +386,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'my_custom_int', $data['schema']['properties'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $schema, $data['schema']['properties']['my_custom_int'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $schema, $data['schema']['properties']['my_custom_int'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -419,30 +419,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $revision->post_author, $response['author'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $rendered_content = apply_filters( 'the_content', $revision->post_content );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $rendered_content, $response['content']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $rendered_content, $response['content']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( mysql_to_rfc3339( $revision->post_date ), $response['date'] );
- $this->assertEquals( mysql_to_rfc3339( $revision->post_date_gmt ), $response['date_gmt'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( mysql_to_rfc3339( $revision->post_date ), $response['date'] );
+ $this->assertSame( mysql_to_rfc3339( $revision->post_date_gmt ), $response['date_gmt'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $rendered_excerpt = apply_filters( 'the_excerpt', apply_filters( 'get_the_excerpt', $revision->post_excerpt, $revision ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $rendered_excerpt, $response['excerpt']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $rendered_excerpt, $response['excerpt']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $rendered_guid = apply_filters( 'get_the_guid', $revision->guid, $revision->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $rendered_guid, $response['guid']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $rendered_guid, $response['guid']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $revision->ID, $response['id'] );
- $this->assertEquals( mysql_to_rfc3339( $revision->post_modified ), $response['modified'] );
- $this->assertEquals( mysql_to_rfc3339( $revision->post_modified_gmt ), $response['modified_gmt'] );
- $this->assertEquals( $revision->post_name, $response['slug'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $revision->ID, $response['id'] );
+ $this->assertSame( mysql_to_rfc3339( $revision->post_modified ), $response['modified'] );
+ $this->assertSame( mysql_to_rfc3339( $revision->post_modified_gmt ), $response['modified_gmt'] );
+ $this->assertSame( $revision->post_name, $response['slug'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $rendered_title = get_the_title( $revision->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $rendered_title, $response['title']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $rendered_title, $response['title']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $parent = get_post( $revision->post_parent );
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_controller = new WP_REST_Posts_Controller( $parent->post_type );
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_object = get_post_type_object( $parent->post_type );
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_base = ! empty( $parent_object->rest_base ) ? $parent_object->rest_base : $parent_object->name;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( rest_url( '/wp/v2/' . $parent_base . '/' . $revision->post_parent ), $links['parent'][0]['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( rest_url( '/wp/v2/' . $parent_base . '/' . $revision->post_parent ), $links['parent'][0]['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_sets_up_postdata() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -453,8 +453,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post();
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_post_id = wp_is_post_revision( $post->ID );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post->ID, $this->revision_id1 );
- $this->assertEquals( $parent_post_id, self::$post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post->ID, $this->revision_id1 );
+ $this->assertSame( $parent_post_id, self::$post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestschemasanitizationphp"></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/rest-api/rest-schema-sanitization.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-schema-sanitization.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-schema-sanitization.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,7 +16,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'number',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1, rest_sanitize_value_from_schema( 1, $schema ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1.10, rest_sanitize_value_from_schema( '1.10', $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1.10, rest_sanitize_value_from_schema( '1.10', $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1, rest_sanitize_value_from_schema( '1abc', $schema ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, rest_sanitize_value_from_schema( 'abc', $schema ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, rest_sanitize_value_from_schema( array(), $schema ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,11 +26,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $schema = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'integer',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, rest_sanitize_value_from_schema( 1, $schema ) );
- $this->assertEquals( 1, rest_sanitize_value_from_schema( '1.10', $schema ) );
- $this->assertEquals( 1, rest_sanitize_value_from_schema( '1abc', $schema ) );
- $this->assertEquals( 0, rest_sanitize_value_from_schema( 'abc', $schema ) );
- $this->assertEquals( 0, rest_sanitize_value_from_schema( array(), $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, rest_sanitize_value_from_schema( 1, $schema ) );
+ $this->assertSame( 1, rest_sanitize_value_from_schema( '1.10', $schema ) );
+ $this->assertSame( 1, rest_sanitize_value_from_schema( '1abc', $schema ) );
+ $this->assertSame( 0, rest_sanitize_value_from_schema( 'abc', $schema ) );
+ $this->assertSame( 0, rest_sanitize_value_from_schema( array(), $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_type_string() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,10 +37,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $schema = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'string',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Hello', rest_sanitize_value_from_schema( 'Hello', $schema ) );
- $this->assertEquals( '1.10', rest_sanitize_value_from_schema( '1.10', $schema ) );
- $this->assertEquals( '1.1', rest_sanitize_value_from_schema( 1.1, $schema ) );
- $this->assertEquals( '1', rest_sanitize_value_from_schema( 1, $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Hello', rest_sanitize_value_from_schema( 'Hello', $schema ) );
+ $this->assertSame( '1.10', rest_sanitize_value_from_schema( '1.10', $schema ) );
+ $this->assertSame( '1.1', rest_sanitize_value_from_schema( 1.1, $schema ) );
+ $this->assertSame( '1', rest_sanitize_value_from_schema( 1, $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_type_boolean() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,13 +47,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $schema = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'boolean',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( true, rest_sanitize_value_from_schema( '1', $schema ) );
- $this->assertEquals( true, rest_sanitize_value_from_schema( 'true', $schema ) );
- $this->assertEquals( true, rest_sanitize_value_from_schema( '100', $schema ) );
- $this->assertEquals( true, rest_sanitize_value_from_schema( 1, $schema ) );
- $this->assertEquals( false, rest_sanitize_value_from_schema( '0', $schema ) );
- $this->assertEquals( false, rest_sanitize_value_from_schema( 'false', $schema ) );
- $this->assertEquals( false, rest_sanitize_value_from_schema( 0, $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertTrue( rest_sanitize_value_from_schema( '1', $schema ) );
+ $this->assertTrue( rest_sanitize_value_from_schema( 'true', $schema ) );
+ $this->assertTrue( rest_sanitize_value_from_schema( '100', $schema ) );
+ $this->assertTrue( rest_sanitize_value_from_schema( 1, $schema ) );
+ $this->assertFalse( rest_sanitize_value_from_schema( '0', $schema ) );
+ $this->assertFalse( rest_sanitize_value_from_schema( 'false', $schema ) );
+ $this->assertFalse( rest_sanitize_value_from_schema( 0, $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_format_email() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -61,9 +61,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'string',
</span><span class="cx" style="display: block; padding: 0 10px"> 'format' => 'email',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'email@example.com', rest_sanitize_value_from_schema( 'email@example.com', $schema ) );
- $this->assertEquals( 'a@b.c', rest_sanitize_value_from_schema( 'a@b.c', $schema ) );
- $this->assertEquals( 'invalid', rest_sanitize_value_from_schema( 'invalid', $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'email@example.com', rest_sanitize_value_from_schema( 'email@example.com', $schema ) );
+ $this->assertSame( 'a@b.c', rest_sanitize_value_from_schema( 'a@b.c', $schema ) );
+ $this->assertSame( 'invalid', rest_sanitize_value_from_schema( 'invalid', $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_format_ip() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,9 +72,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'format' => 'ip',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '127.0.0.1', rest_sanitize_value_from_schema( '127.0.0.1', $schema ) );
- $this->assertEquals( 'hello', rest_sanitize_value_from_schema( 'hello', $schema ) );
- $this->assertEquals( '2001:DB8:0:0:8:800:200C:417A', rest_sanitize_value_from_schema( '2001:DB8:0:0:8:800:200C:417A', $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '127.0.0.1', rest_sanitize_value_from_schema( '127.0.0.1', $schema ) );
+ $this->assertSame( 'hello', rest_sanitize_value_from_schema( 'hello', $schema ) );
+ $this->assertSame( '2001:DB8:0:0:8:800:200C:417A', rest_sanitize_value_from_schema( '2001:DB8:0:0:8:800:200C:417A', $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -85,9 +85,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'string',
</span><span class="cx" style="display: block; padding: 0 10px"> 'format' => 'hex-color',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '#000000', rest_sanitize_value_from_schema( '#000000', $schema ) );
- $this->assertEquals( '#FFF', rest_sanitize_value_from_schema( '#FFF', $schema ) );
- $this->assertEquals( '', rest_sanitize_value_from_schema( 'WordPress', $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '#000000', rest_sanitize_value_from_schema( '#000000', $schema ) );
+ $this->assertSame( '#FFF', rest_sanitize_value_from_schema( '#FFF', $schema ) );
+ $this->assertSame( '', rest_sanitize_value_from_schema( 'WordPress', $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -98,9 +98,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'string',
</span><span class="cx" style="display: block; padding: 0 10px"> 'format' => 'uuid',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '44', rest_sanitize_value_from_schema( 44, $schema ) );
- $this->assertEquals( 'hello', rest_sanitize_value_from_schema( 'hello', $schema ) );
- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '44', rest_sanitize_value_from_schema( 44, $schema ) );
+ $this->assertSame( 'hello', rest_sanitize_value_from_schema( 'hello', $schema ) );
+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> '123e4567-e89b-12d3-a456-426655440000',
</span><span class="cx" style="display: block; padding: 0 10px"> rest_sanitize_value_from_schema( '123e4567-e89b-12d3-a456-426655440000', $schema )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -151,8 +151,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'string',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'ribs', 'brisket' ), rest_sanitize_value_from_schema( array( 'ribs', 'brisket' ), $schema ) );
- $this->assertEquals( array( 'coleslaw' ), rest_sanitize_value_from_schema( array( 'coleslaw' ), $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'ribs', 'brisket' ), rest_sanitize_value_from_schema( array( 'ribs', 'brisket' ), $schema ) );
+ $this->assertSame( array( 'coleslaw' ), rest_sanitize_value_from_schema( array( 'coleslaw' ), $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_type_array_with_enum_as_csv() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -163,9 +163,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'string',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'ribs', 'chicken' ), rest_sanitize_value_from_schema( 'ribs,chicken', $schema ) );
- $this->assertEquals( array( 'chicken', 'coleslaw' ), rest_sanitize_value_from_schema( 'chicken,coleslaw', $schema ) );
- $this->assertEquals( array( 'chicken', 'coleslaw' ), rest_sanitize_value_from_schema( 'chicken,coleslaw,', $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'ribs', 'chicken' ), rest_sanitize_value_from_schema( 'ribs,chicken', $schema ) );
+ $this->assertSame( array( 'chicken', 'coleslaw' ), rest_sanitize_value_from_schema( 'chicken,coleslaw', $schema ) );
+ $this->assertSame( array( 'chicken', 'coleslaw' ), rest_sanitize_value_from_schema( 'chicken,coleslaw,', $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_type_array_is_associative() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -175,7 +175,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'string',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( '1', '2' ),
</span><span class="cx" style="display: block; padding: 0 10px"> rest_sanitize_value_from_schema(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -289,7 +289,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $schema
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'a' => array() ), rest_sanitize_value_from_schema( array( 'a' => null ), $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'a' => array() ), rest_sanitize_value_from_schema( array( 'a' => null ), $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_type_object_stdclass() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -308,7 +308,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 42961
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_type_object_accepts_empty_string() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), rest_sanitize_value_from_schema( '', array( 'type' => 'object' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), rest_sanitize_value_from_schema( '', array( 'type' => 'object' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_type_unknown() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -317,9 +317,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $schema = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'lalala',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Best lyrics', rest_sanitize_value_from_schema( 'Best lyrics', $schema ) );
- $this->assertEquals( 1.10, rest_sanitize_value_from_schema( 1.10, $schema ) );
- $this->assertEquals( 1, rest_sanitize_value_from_schema( 1, $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Best lyrics', rest_sanitize_value_from_schema( 'Best lyrics', $schema ) );
+ $this->assertSame( 1.10, rest_sanitize_value_from_schema( 1.10, $schema ) );
+ $this->assertSame( 1, rest_sanitize_value_from_schema( 1, $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_no_type() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -328,9 +328,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $schema = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => null,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Nothing', rest_sanitize_value_from_schema( 'Nothing', $schema ) );
- $this->assertEquals( 1.10, rest_sanitize_value_from_schema( 1.10, $schema ) );
- $this->assertEquals( 1, rest_sanitize_value_from_schema( 1, $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Nothing', rest_sanitize_value_from_schema( 'Nothing', $schema ) );
+ $this->assertSame( 1.10, rest_sanitize_value_from_schema( 1.10, $schema ) );
+ $this->assertSame( 1, rest_sanitize_value_from_schema( 1, $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_nullable_date() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -340,8 +340,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( rest_sanitize_value_from_schema( null, $schema ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2019-09-19T18:00:00', rest_sanitize_value_from_schema( '2019-09-19T18:00:00', $schema ) );
- $this->assertEquals( 'lalala', rest_sanitize_value_from_schema( 'lalala', $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '2019-09-19T18:00:00', rest_sanitize_value_from_schema( '2019-09-19T18:00:00', $schema ) );
+ $this->assertSame( 'lalala', rest_sanitize_value_from_schema( 'lalala', $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -352,8 +352,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'array',
</span><span class="cx" style="display: block; padding: 0 10px"> 'format' => 'hex-color',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( '#fff' ), rest_sanitize_value_from_schema( '#fff', $schema ) );
- $this->assertEquals( array( '#qrst' ), rest_sanitize_value_from_schema( '#qrst', $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( '#fff' ), rest_sanitize_value_from_schema( '#fff', $schema ) );
+ $this->assertSame( array( '#qrst' ), rest_sanitize_value_from_schema( '#qrst', $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -364,8 +364,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->setExpectedIncorrectUsage( 'rest_sanitize_value_from_schema' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $schema = array( 'format' => 'hex-color' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '#abc', rest_sanitize_value_from_schema( '#abc', $schema ) );
- $this->assertEquals( '', rest_sanitize_value_from_schema( '#jkl', $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '#abc', rest_sanitize_value_from_schema( '#abc', $schema ) );
+ $this->assertSame( '', rest_sanitize_value_from_schema( '#jkl', $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -378,8 +378,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'format' => 'hex-color',
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'str',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '#abc', rest_sanitize_value_from_schema( '#abc', $schema ) );
- $this->assertEquals( '', rest_sanitize_value_from_schema( '#jkl', $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '#abc', rest_sanitize_value_from_schema( '#abc', $schema ) );
+ $this->assertSame( '', rest_sanitize_value_from_schema( '#jkl', $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_object_or_string() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -392,9 +392,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'My Value', rest_sanitize_value_from_schema( 'My Value', $schema ) );
- $this->assertEquals( array( 'raw' => 'My Value' ), rest_sanitize_value_from_schema( array( 'raw' => 'My Value' ), $schema ) );
- $this->assertEquals( array( 'raw' => '1' ), rest_sanitize_value_from_schema( array( 'raw' => 1 ), $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'My Value', rest_sanitize_value_from_schema( 'My Value', $schema ) );
+ $this->assertSame( array( 'raw' => 'My Value' ), rest_sanitize_value_from_schema( array( 'raw' => 'My Value' ), $schema ) );
+ $this->assertSame( array( 'raw' => '1' ), rest_sanitize_value_from_schema( array( 'raw' => 1 ), $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_object_or_bool() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -415,15 +415,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( rest_sanitize_value_from_schema( '0', $schema ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( rest_sanitize_value_from_schema( 0, $schema ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'raw' => true ), rest_sanitize_value_from_schema( array( 'raw' => true ), $schema ) );
- $this->assertEquals( array( 'raw' => true ), rest_sanitize_value_from_schema( array( 'raw' => '1' ), $schema ) );
- $this->assertEquals( array( 'raw' => true ), rest_sanitize_value_from_schema( array( 'raw' => 1 ), $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'raw' => true ), rest_sanitize_value_from_schema( array( 'raw' => true ), $schema ) );
+ $this->assertSame( array( 'raw' => true ), rest_sanitize_value_from_schema( array( 'raw' => '1' ), $schema ) );
+ $this->assertSame( array( 'raw' => true ), rest_sanitize_value_from_schema( array( 'raw' => 1 ), $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'raw' => false ), rest_sanitize_value_from_schema( array( 'raw' => false ), $schema ) );
- $this->assertEquals( array( 'raw' => false ), rest_sanitize_value_from_schema( array( 'raw' => '0' ), $schema ) );
- $this->assertEquals( array( 'raw' => false ), rest_sanitize_value_from_schema( array( 'raw' => 0 ), $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'raw' => false ), rest_sanitize_value_from_schema( array( 'raw' => false ), $schema ) );
+ $this->assertSame( array( 'raw' => false ), rest_sanitize_value_from_schema( array( 'raw' => '0' ), $schema ) );
+ $this->assertSame( array( 'raw' => false ), rest_sanitize_value_from_schema( array( 'raw' => 0 ), $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'raw' => true ), rest_sanitize_value_from_schema( array( 'raw' => 'something non boolean' ), $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'raw' => true ), rest_sanitize_value_from_schema( array( 'raw' => 'something non boolean' ), $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -437,7 +437,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => array( 'invalid', 'type' ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'My Value', rest_sanitize_value_from_schema( 'My Value', $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'My Value', rest_sanitize_value_from_schema( 'My Value', $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -451,7 +451,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => array( 'object', 'type' ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'My Value', rest_sanitize_value_from_schema( 'My Value', $schema ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'My Value', rest_sanitize_value_from_schema( 'My Value', $schema ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestschemasetupphp"></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/rest-api/rest-schema-setup.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -132,7 +132,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '/wp/v2/block-directory/search',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_routes, $routes );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_routes, $routes );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> private function is_builtin_route( $route ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -441,7 +441,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $status = $response->get_status();
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> 200,
</span><span class="cx" style="display: block; padding: 0 10px"> $response->get_status(),
</span><span class="cx" style="display: block; padding: 0 10px"> "HTTP $status from $route[route]: " . json_encode( $data )
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestschemavalidationphp"></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/rest-api/rest-schema-validation.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-schema-validation.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-schema-validation.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -390,7 +390,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $error = rest_validate_value_from_schema( 'some random string', $schema );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Invalid date.', $error->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Invalid date.', $error->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_object_or_string() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -408,7 +408,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $error = rest_validate_value_from_schema( array( 'raw' => array( 'a list' ) ), $schema );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '[raw] is not of type string.', $error->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '[raw] is not of type string.', $error->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -427,7 +427,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $error = rest_validate_value_from_schema( 30, $schema, 'param' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'param must be between 10 (inclusive) and 20 (inclusive)', $error->get_error_message() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'param must be between 10 (inclusive) and 20 (inclusive)', $error->get_error_message() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestsearchcontrollerphp"></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/rest-api/rest-search-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-search-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-search-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -96,8 +96,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $this->do_request_with_params( array(), 'OPTIONS' );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
- $this->assertEquals( array( 'view', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
+ $this->assertSame( array( 'view', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,7 +110,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets(
</span><span class="cx" style="display: block; padding: 0 10px"> array_merge(
</span><span class="cx" style="display: block; padding: 0 10px"> self::$my_title_post_ids,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -131,8 +131,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( 3, count( $response->get_data() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( 3, count( $response->get_data() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -146,7 +146,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets(
</span><span class="cx" style="display: block; padding: 0 10px"> array_merge(
</span><span class="cx" style="display: block; padding: 0 10px"> self::$my_title_post_ids,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -169,7 +169,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets(
</span><span class="cx" style="display: block; padding: 0 10px"> array_merge(
</span><span class="cx" style="display: block; padding: 0 10px"> self::$my_title_post_ids,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -191,7 +191,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets(
</span><span class="cx" style="display: block; padding: 0 10px"> self::$my_title_page_ids,
</span><span class="cx" style="display: block; padding: 0 10px"> wp_list_pluck( $response->get_data(), 'id' )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -239,7 +239,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets(
</span><span class="cx" style="display: block; padding: 0 10px"> array_merge(
</span><span class="cx" style="display: block; padding: 0 10px"> self::$my_title_post_ids,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -261,7 +261,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets(
</span><span class="cx" style="display: block; padding: 0 10px"> array_merge(
</span><span class="cx" style="display: block; padding: 0 10px"> self::$my_title_post_ids,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -282,7 +282,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets(
</span><span class="cx" style="display: block; padding: 0 10px"> self::$my_content_post_ids,
</span><span class="cx" style="display: block; padding: 0 10px"> wp_list_pluck( $response->get_data(), 'id' )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -296,7 +296,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** The search controller does not allow getting individual item content */
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/search' . self::$my_title_post_ids[0] );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -306,7 +306,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** The search controller does not allow creating content */
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/search' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -316,7 +316,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** The search controller does not allow upading content */
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/search' . self::$my_title_post_ids[0] );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -326,7 +326,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** The search controller does not allow deleting content */
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'DELETE', '/wp/v2/search' . self::$my_title_post_ids[0] );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -334,10 +334,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_prepare_item() {
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $this->do_request_with_params();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'id',
</span><span class="cx" style="display: block; padding: 0 10px"> 'title',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -363,10 +363,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '_fields' => 'id,title',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'id',
</span><span class="cx" style="display: block; padding: 0 10px"> 'title',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -448,7 +448,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $controller->prepare_item_for_response( 1, $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'id',
</span><span class="cx" style="display: block; padding: 0 10px"> 'title',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -479,7 +479,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $controller->prepare_item_for_response( 1, $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'id',
</span><span class="cx" style="display: block; padding: 0 10px"> 'title',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -495,7 +495,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $controller = new WP_REST_Search_Controller( array( new WP_REST_Test_Search_Handler( 10 ) ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $params = $controller->get_collection_params();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test', $params[ WP_REST_Search_Controller::PROP_TYPE ]['default'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test', $params[ WP_REST_Search_Controller::PROP_TYPE ]['default'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'test' ), $params[ WP_REST_Search_Controller::PROP_TYPE ]['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'test_first_type', 'test_second_type', WP_REST_Search_Controller::TYPE_ANY ), $params[ WP_REST_Search_Controller::PROP_SUBTYPE ]['items']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -511,7 +511,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'self', $data['_embedded'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $data['_embedded']['self'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( WP_REST_Search_Controller::PROP_ID, $data['_embedded']['self'][0] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $data[ WP_REST_Search_Controller::PROP_ID ], $data['_embedded']['self'][0][ WP_REST_Search_Controller::PROP_ID ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $data[ WP_REST_Search_Controller::PROP_ID ], $data['_embedded']['self'][0][ WP_REST_Search_Controller::PROP_ID ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestserverphp"></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/rest-api/rest-server.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-server.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-server.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,15 +49,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The envelope should still be a response, but with defaults.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_REST_Response', $envelope_response );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $envelope_response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $envelope_response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $envelope_response->get_headers() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $envelope_response->get_links() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $enveloped = $envelope_response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $data, $enveloped['body'] );
- $this->assertEquals( $status, $enveloped['status'] );
- $this->assertEquals( $headers, $enveloped['headers'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $data, $enveloped['body'] );
+ $this->assertSame( $status, $enveloped['status'] );
+ $this->assertSame( $headers, $enveloped['headers'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_default_param() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -80,7 +80,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/test-ns/test' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bar', $request['foo'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bar', $request['foo'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_default_param_is_overridden() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,7 +125,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_query_params( array() );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_REST_Response', $response );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'foo', (array) $request );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -146,7 +146,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/no-zero/test' );
</span><span class="cx" style="display: block; padding: 0 10px"> rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'foo' => 'bar' ), $request->get_params() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'foo' => 'bar' ), $request->get_params() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_head_request_handled_by_get() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -161,7 +161,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'HEAD', '/head-request/test' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -189,7 +189,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'HEAD', '/head-request/test' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_url_params_no_numeric_keys() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -211,7 +211,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/test/some-value' );
</span><span class="cx" style="display: block; padding: 0 10px"> rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'data' => 'some-value' ), $request->get_params() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'data' => 'some-value' ), $request->get_params() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -233,7 +233,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/test-ns/test', array() );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -260,7 +260,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $result->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $result->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -288,7 +288,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $result->get_status() !== 200 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $sent_headers = $result->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $sent_headers['Allow'], 'GET' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $sent_headers['Allow'], 'GET' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -328,7 +328,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = apply_filters( 'rest_post_dispatch', $result, rest_get_server(), $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $sent_headers = $result->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $sent_headers['Allow'], 'GET, POST' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $sent_headers['Allow'], 'GET, POST' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -364,10 +364,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = apply_filters( 'rest_post_dispatch', $result, rest_get_server(), $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $result->get_status(), 403 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $result->get_status(), 403 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $sent_headers = $result->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $sent_headers['Allow'], 'POST' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $sent_headers['Allow'], 'POST' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_allow_header_sent_on_options_request() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -395,7 +395,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $result->get_headers();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'GET', $headers['Allow'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'GET', $headers['Allow'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function permission_denied() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -411,12 +411,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_REST_Response', $response );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure we default to a 500 error.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 500, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 500, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $code, $data['code'] );
- $this->assertEquals( $message, $data['message'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $code, $data['code'] );
+ $this->assertSame( $message, $data['message'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_error_to_response_with_status() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -427,12 +427,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->error_to_response( $error );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_REST_Response', $response );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 400, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 400, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $code, $data['code'] );
- $this->assertEquals( $message, $data['message'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $code, $data['code'] );
+ $this->assertSame( $message, $data['message'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_error_to_response_to_error() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -446,14 +446,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->error_to_response( $error );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_REST_Response', $response );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 400, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 400, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $response->as_error();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $error );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $code, $error->get_error_code() );
- $this->assertEquals( $message, $error->get_error_message() );
- $this->assertEquals( $message2, $error->errors[ $code2 ][0] );
- $this->assertEquals( array( 'status' => 403 ), $error->error_data[ $code2 ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $code, $error->get_error_code() );
+ $this->assertSame( $message, $error->get_error_message() );
+ $this->assertSame( $message2, $error->errors[ $code2 ][0] );
+ $this->assertSame( array( 'status' => 403 ), $error->error_data[ $code2 ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_error() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -464,7 +464,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = wp_json_encode( $data );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->json_error( 'wp-api-test-error', 'Message text' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $response );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $response );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_json_error_with_status() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -484,7 +484,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $stub->json_error( 'wp-api-test-error', 'Message text', 400 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $response );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $response );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_response_to_data_links() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -498,13 +498,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $self = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'href' => 'http://example.com/',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $self, $data['_links']['self'][0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $self, $data['_links']['self'][0] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $alternate = array(
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'type' => 'application/xml',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'href' => 'http://example.org/',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'type' => 'application/xml',
</del><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $alternate, $data['_links']['alternate'][0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $alternate, $data['_links']['alternate'][0] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_link_embedding() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -537,7 +537,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $alternate[1]['hello'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure the context is set to embed when requesting.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'embed', $alternate[1]['parameters']['context'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'embed', $alternate[1]['parameters']['context'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_link_curies() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -652,7 +652,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'alternate', $data['_embedded'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $data['_embedded']['alternate'][0];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'yes', $data['parameters']['parsed_params'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'yes', $data['parameters']['parsed_params'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -684,9 +684,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $up );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $up_data = $up[0];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'wp-api-test-error', $up_data['code'] );
- $this->assertEquals( 'Test message', $up_data['message'] );
- $this->assertEquals( 403, $up_data['data']['status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'wp-api-test-error', $up_data['code'] );
+ $this->assertSame( 'Test message', $up_data['message'] );
+ $this->assertSame( 403, $up_data['data']['status'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -712,7 +712,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = rest_get_server()->response_to_data( $response, true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'post', $data['_embedded'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $data['_embedded']['post'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'My Awesome Title', $data['_embedded']['post'][0]['title']['rendered'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'My Awesome Title', $data['_embedded']['post'][0]['title']['rendered'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -802,7 +802,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( '_links', $data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( '_embedded', $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'data', $data['untouched'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'data', $data['untouched'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function embedded_response_callback( $request ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -833,10 +833,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'self', $data['_links'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $alternate = array(
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'type' => 'application/xml',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'href' => 'http://example.org/',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'type' => 'application/xml',
</del><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $alternate, $data['_links']['alternate'][0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $alternate, $data['_links']['alternate'][0] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_removing_links_for_href() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -854,7 +854,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $self_not_filtered = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'href' => 'http://example.com/',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $self_not_filtered, $data['_links']['self'][0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $self_not_filtered, $data['_links']['self'][0] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -954,7 +954,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the route.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( '/test/example/some-route', $data['routes'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $route = $data['routes']['/test/example/some-route'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test/example', $route['namespace'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test/example', $route['namespace'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'methods', $route );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'GET', $route['methods'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'DELETE', $route['methods'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -994,7 +994,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $index->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check top-level.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test/example', $data['namespace'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test/example', $data['namespace'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'routes', $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check we have the route we expect...
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1052,7 +1052,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual['_links'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual['_links'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_x_robot_tag_header_on_requests() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1061,7 +1061,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = rest_get_server()->serve_request( '/' );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = rest_get_server()->sent_headers;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'noindex', $headers['X-Robots-Tag'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'noindex', $headers['X-Robots-Tag'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1086,7 +1086,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = rest_get_server()->serve_request( '/' );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = rest_get_server()->sent_headers;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<' . esc_url_raw( $api_root ) . '>; rel="https://api.w.org/"', $headers['Link'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<' . esc_url_raw( $api_root ) . '>; rel="https://api.w.org/"', $headers['Link'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_nocache_headers_on_authenticated_requests() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1103,7 +1103,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $headers[ $header ] ), sprintf( 'Header %s is not present in the response.', $header ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, $headers[ $header ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, $headers[ $header ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Last-Modified should be unset as per #WP23021.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1140,7 +1140,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = rest_get_server()->serve_request( '/test/data\\with\\slashes' );
</span><span class="cx" style="display: block; padding: 0 10px"> $url_params = rest_get_server()->last_request->get_url_params();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'data\\with\\slashes', $url_params['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'data\\with\\slashes', $url_params['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_serve_request_query_params_are_unslashed() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1168,7 +1168,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = rest_get_server()->serve_request( '/test' );
</span><span class="cx" style="display: block; padding: 0 10px"> $query_params = rest_get_server()->last_request->get_query_params();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'data\\with\\slashes', $query_params['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'data\\with\\slashes', $query_params['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_serve_request_body_params_are_unslashed() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1197,7 +1197,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = rest_get_server()->serve_request( '/test/data' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $body_params = rest_get_server()->last_request->get_body_params();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'data\\with\\slashes', $body_params['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'data\\with\\slashes', $body_params['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_serve_request_json_params_are_unslashed() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1225,7 +1225,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = rest_get_server()->serve_request( '/test' );
</span><span class="cx" style="display: block; padding: 0 10px"> $json_params = rest_get_server()->last_request->get_json_params();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'data\\with\\slashes', $json_params['data'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'data\\with\\slashes', $json_params['data'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_serve_request_file_params_are_unslashed() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1253,7 +1253,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = rest_get_server()->serve_request( '/test/data\\with\\slashes' );
</span><span class="cx" style="display: block; padding: 0 10px"> $file_params = rest_get_server()->last_request->get_file_params();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'data\\with\\slashes', $file_params['data']['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'data\\with\\slashes', $file_params['data']['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_serve_request_headers_are_unslashed() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1276,7 +1276,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTP_X_MY_HEADER'] = wp_slash( 'data\\with\\slashes' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = rest_get_server()->serve_request( '/test/data\\with\\slashes' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'data\\with\\slashes', rest_get_server()->last_request->get_header( 'x_my_header' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'data\\with\\slashes', rest_get_server()->last_request->get_header( 'x_my_header' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function filter_wp_rest_server_class() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1364,7 +1364,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1386,7 +1386,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = rest_get_server()->serve_request( '/test-ns/test' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', rest_get_server()->sent_body );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', rest_get_server()->sent_body );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1408,7 +1408,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = rest_get_server()->serve_request( '/test-ns/test' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', rest_get_server()->sent_body );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', rest_get_server()->sent_body );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1510,7 +1510,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/test-ns/v1/test' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 204, $response->get_status(), '/test-ns/v1/test' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 204, $response->get_status(), '/test-ns/v1/test' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function _validate_as_integer_123( $value, $request, $key ) {
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestsettingscontrollerphp"></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/rest-api/rest-settings-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-settings-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-settings-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,7 +67,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$administrator );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/settings/title' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_context_param() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,7 +76,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_is_not_public_not_authenticated() {
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/settings' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_is_not_public_no_permission() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,7 +83,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$author );
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/settings' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,8 +117,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $expected );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $actual );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_value_is_cast_to_type() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -128,8 +128,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( 1, $data['posts_per_page'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( 1, $data['posts_per_page'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_with_custom_setting() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -154,9 +154,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'mycustomsettinginrest', $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'validvalue1', $data['mycustomsettinginrest'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'validvalue1', $data['mycustomsettinginrest'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'mycustomsetting', 'validvalue2' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -163,7 +163,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/settings' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'validvalue2', $data['mycustomsettinginrest'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'validvalue2', $data['mycustomsettinginrest'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_with_custom_array_setting() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -190,7 +190,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/settings' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 1, 2 ), $data['mycustomsetting'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 1, 2 ), $data['mycustomsetting'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Empty array works as expected.
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'mycustomsetting', array() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -197,7 +197,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/settings' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $data['mycustomsetting'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $data['mycustomsetting'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Invalid value.
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'mycustomsetting', array( array( 1 ) ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -204,7 +204,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/settings' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( null, $data['mycustomsetting'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $data['mycustomsetting'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // No option value.
</span><span class="cx" style="display: block; padding: 0 10px"> delete_option( 'mycustomsetting' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -211,7 +211,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/settings' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( null, $data['mycustomsetting'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $data['mycustomsetting'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_with_custom_object_setting() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -244,7 +244,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/settings' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'a' => 1 ), $data['mycustomsetting'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'a' => 1 ), $data['mycustomsetting'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Empty array works as expected.
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'mycustomsetting', array() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -251,7 +251,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/settings' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $data['mycustomsetting'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $data['mycustomsetting'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Invalid value.
</span><span class="cx" style="display: block; padding: 0 10px"> update_option(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -264,7 +264,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/settings' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( null, $data['mycustomsetting'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $data['mycustomsetting'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_setting_custom_callback( $result, $name, $args ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -309,13 +309,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'mycustomsettinginrest1', $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'unfiltered1', $data['mycustomsettinginrest1'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'unfiltered1', $data['mycustomsettinginrest1'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'mycustomsettinginrest2', $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'unfiltered2', $data['mycustomsettinginrest2'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'unfiltered2', $data['mycustomsettinginrest2'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_all_filters( 'rest_pre_get_setting' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -343,7 +343,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/settings' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( null, $data['mycustomsettinginrest'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $data['mycustomsettinginrest'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_with_invalid_object_array_in_options() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -369,7 +369,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/settings' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( null, $data['mycustomsettinginrest'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $data['mycustomsettinginrest'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -383,9 +383,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( 'The new title!', $data['title'] );
- $this->assertEquals( get_option( 'blogname' ), $data['title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( 'The new title!', $data['title'] );
+ $this->assertSame( get_option( 'blogname' ), $data['title'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function update_setting_custom_callback( $result, $name, $value, $args ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -423,8 +423,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'mycustomsetting', array( '1', '2' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 1, 2 ), $data['mycustomsetting'] );
- $this->assertEquals( array( 1, 2 ), get_option( 'mycustomsetting' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 1, 2 ), $data['mycustomsetting'] );
+ $this->assertSame( array( 1, 2 ), get_option( 'mycustomsetting' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Setting an empty array.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', '/wp/v2/settings' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -431,8 +431,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'mycustomsetting', array() );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $data['mycustomsetting'] );
- $this->assertEquals( array(), get_option( 'mycustomsetting' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $data['mycustomsetting'] );
+ $this->assertSame( array(), get_option( 'mycustomsetting' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Setting an invalid array.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', '/wp/v2/settings' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -513,8 +513,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'mycustomsetting', array( 'a' => 1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'a' => 1 ), $data['mycustomsetting'] );
- $this->assertEquals( array( 'a' => 1 ), get_option( 'mycustomsetting' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'a' => 1 ), $data['mycustomsetting'] );
+ $this->assertSame( array( 'a' => 1 ), get_option( 'mycustomsetting' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Setting an empty object.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', '/wp/v2/settings' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -521,8 +521,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'mycustomsetting', array() );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $data['mycustomsetting'] );
- $this->assertEquals( array(), get_option( 'mycustomsetting' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $data['mycustomsetting'] );
+ $this->assertSame( array(), get_option( 'mycustomsetting' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Provide more keys.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', '/wp/v2/settings' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -552,11 +552,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'description', 'The old description!' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( 'The old title!', $data['title'] );
- $this->assertEquals( 'The old description!', $data['description'] );
- $this->assertEquals( get_option( 'blogname' ), $data['title'] );
- $this->assertEquals( get_option( 'blogdescription' ), $data['description'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( 'The old title!', $data['title'] );
+ $this->assertSame( 'The old description!', $data['description'] );
+ $this->assertSame( get_option( 'blogname' ), $data['title'] );
+ $this->assertSame( get_option( 'blogdescription' ), $data['description'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'rest_pre_update_setting', array( $this, 'update_setting_custom_callback' ), 10, 4 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -566,11 +566,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( 'The old title!', $data['title'] );
- $this->assertEquals( 'The new description!', $data['description'] );
- $this->assertEquals( get_option( 'blogname' ), $data['title'] );
- $this->assertEquals( get_option( 'blogdescription' ), $data['description'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( 'The old title!', $data['title'] );
+ $this->assertSame( 'The new description!', $data['description'] );
+ $this->assertSame( get_option( 'blogname' ), $data['title'] );
+ $this->assertSame( get_option( 'blogdescription' ), $data['description'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_all_filters( 'rest_pre_update_setting' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -588,7 +588,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', '/wp/v2/settings' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'posts_per_page', 11 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item_with_invalid_float_for_integer() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -611,8 +611,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( 10, $data['posts_per_page'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( 10, $data['posts_per_page'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item_with_invalid_enum() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -650,7 +650,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** Settings can't be deleted */
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'DELETE', '/wp/v2/settings/title' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_prepare_item() {
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapiresttagscontrollerphp"></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/rest-api/rest-tags-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-tags-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-tags-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -135,7 +135,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px"> // Single.
</span><span class="cx" style="display: block; padding: 0 10px"> $tag1 = $this->factory->tag->create( array( 'name' => 'Season 5' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -142,7 +142,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/tags/' . $tag1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -152,7 +152,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $keys = array_keys( $data['endpoints'][0]['args'] );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $keys );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'context',
</span><span class="cx" style="display: block; padding: 0 10px"> 'exclude',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -200,9 +200,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'hide_empty', true );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
- $this->assertEquals( 'Season 5', $data[0]['name'] );
- $this->assertEquals( 'The Be Sharps', $data[1]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
+ $this->assertSame( 'Season 5', $data[0]['name'] );
+ $this->assertSame( 'The Be Sharps', $data[1]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Invalid 'hide_empty' should error.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'hide_empty', 'nothanks' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -220,15 +220,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'include', array( $id2, $id1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
- $this->assertEquals( $id1, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
+ $this->assertSame( $id1, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // 'orderby' => 'include'.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'include' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
- $this->assertEquals( $id2, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
+ $this->assertSame( $id2, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Invalid 'include' should error.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'include', array( 'myterm' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -300,10 +300,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'order', 'desc' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'per_page', 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( 'Zucchini', $data[0]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( 'Zucchini', $data[0]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'name' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -310,10 +310,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'order', 'asc' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'per_page', 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
- $this->assertEquals( 'Apple', $data[0]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
+ $this->assertSame( 'Apple', $data[0]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Invalid 'orderby' should error.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'invalid' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -329,21 +329,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Defaults to 'orderby' => 'name', 'order' => 'asc'.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Apple', $data[0]['name'] );
- $this->assertEquals( 'Banana', $data[1]['name'] );
- $this->assertEquals( 'Cantaloupe', $data[2]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Apple', $data[0]['name'] );
+ $this->assertSame( 'Banana', $data[1]['name'] );
+ $this->assertSame( 'Cantaloupe', $data[2]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // 'orderby' => 'id', with default 'order' => 'asc'.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'id' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Tag 0', $data[0]['name'] );
- $this->assertEquals( 'Tag 1', $data[1]['name'] );
- $this->assertEquals( 'Tag 2', $data[2]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Tag 0', $data[0]['name'] );
+ $this->assertSame( 'Tag 1', $data[1]['name'] );
+ $this->assertSame( 'Tag 2', $data[2]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // 'orderby' => 'id', 'order' => 'desc'.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -351,10 +351,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'order', 'desc' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( 'Banana', $data[0]['name'] );
- $this->assertEquals( 'Apple', $data[1]['name'] );
- $this->assertEquals( 'Cantaloupe', $data[2]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( 'Banana', $data[0]['name'] );
+ $this->assertSame( 'Apple', $data[1]['name'] );
+ $this->assertSame( 'Cantaloupe', $data[2]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_orderby_slugs() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -367,10 +367,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'slug', array( 'taco', 'burrito', 'chalupa' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( 'taco', $data[0]['slug'] );
- $this->assertEquals( 'burrito', $data[1]['slug'] );
- $this->assertEquals( 'chalupa', $data[2]['slug'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( 'taco', $data[0]['slug'] );
+ $this->assertSame( 'burrito', $data[1]['slug'] );
+ $this->assertSame( 'chalupa', $data[2]['slug'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_post_args() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -384,11 +384,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'post', $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
- $this->assertEquals( 'DC', $data[0]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
+ $this->assertSame( 'DC', $data[0]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Invalid 'post' should error.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -412,7 +412,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $i = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $tags as $tag ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $tag['name'], "Tag {$i}" );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $tag['name'], "Tag {$i}" );
</ins><span class="cx" style="display: block; padding: 0 10px"> $i++;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -425,7 +425,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $tags = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $tags as $tag ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $tag['name'], "Tag {$i}" );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $tag['name'], "Tag {$i}" );
</ins><span class="cx" style="display: block; padding: 0 10px"> $i++;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -436,7 +436,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'post', $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 0, $data );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -471,11 +471,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/batman' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'post', $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
- $this->assertEquals( 'Cape', $data[0]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
+ $this->assertSame( 'Cape', $data[0]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_search_args() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -489,17 +489,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'search', 'App' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( 'Apple', $data[0]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( 'Apple', $data[0]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'search', 'Garbage' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_slug_arg() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -509,10 +509,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'slug', 'apple' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( 'Apple', $data[0]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( 'Apple', $data[0]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_slug_array_arg() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -531,11 +531,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $names = wp_list_pluck( $data, 'name' );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $names );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'Burrito', 'Enchilada', 'Taco' ), $names );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'Burrito', 'Enchilada', 'Taco' ), $names );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_slug_csv_arg() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -547,11 +547,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'slug', 'taco,burrito, enchilada' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $names = wp_list_pluck( $data, 'name' );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $names );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'Burrito', 'Enchilada', 'Taco' ), $names );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'Burrito', 'Enchilada', 'Taco' ), $names );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_terms_private_taxonomy() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -582,8 +582,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_tags, $headers['X-WP-Total'] );
- $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_tags, $headers['X-WP-Total'] );
+ $this->assertSame( $total_pages, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $next_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'page' => 2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -601,8 +601,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'page', 3 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_tags, $headers['X-WP-Total'] );
- $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_tags, $headers['X-WP-Total'] );
+ $this->assertSame( $total_pages, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $prev_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'page' => 2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -623,8 +623,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'page', $total_pages );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_tags, $headers['X-WP-Total'] );
- $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_tags, $headers['X-WP-Total'] );
+ $this->assertSame( $total_pages, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $prev_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'page' => $total_pages - 1,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -639,8 +639,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'page', 100 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_tags, $headers['X-WP-Total'] );
- $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_tags, $headers['X-WP-Total'] );
+ $this->assertSame( $total_pages, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $prev_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'page' => $total_pages,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -756,13 +756,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'description', 'This term is so awesome.' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'slug', 'so-awesome' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '/wp/v2/tags/' . $data['id'], $headers['Location'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'My Awesome Term', $data['name'] );
- $this->assertEquals( 'This term is so awesome.', $data['description'] );
- $this->assertEquals( 'so-awesome', $data['slug'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'My Awesome Term', $data['name'] );
+ $this->assertSame( 'This term is so awesome.', $data['description'] );
+ $this->assertSame( 'so-awesome', $data['slug'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_item_contributor() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -773,13 +773,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'description', 'This term is so awesome.' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'slug', 'so-awesome' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '/wp/v2/tags/' . $data['id'], $headers['Location'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'My Awesome Term', $data['name'] );
- $this->assertEquals( 'This term is so awesome.', $data['description'] );
- $this->assertEquals( 'so-awesome', $data['slug'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'My Awesome Term', $data['name'] );
+ $this->assertSame( 'This term is so awesome.', $data['description'] );
+ $this->assertSame( 'so-awesome', $data['slug'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_item_incorrect_permissions() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -816,12 +816,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'name', 'My Awesome Term' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'meta', array( 'test_tag_single' => 'hello' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '/wp/v2/tags/' . $data['id'], $headers['Location'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'My Awesome Term', $data['name'] );
- $this->assertEquals( 'hello', get_term_meta( $data['id'], 'test_tag_single', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'My Awesome Term', $data['name'] );
+ $this->assertSame( 'hello', get_term_meta( $data['id'], 'test_tag_single', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_item_with_meta_wrong_id() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -834,13 +834,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'meta', array( 'test_tag_single' => 'hello' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'id', $existing_tag_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '/wp/v2/tags/' . $data['id'], $headers['Location'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'My Awesome Term', $data['name'] );
- $this->assertEquals( '', get_term_meta( $existing_tag_id, 'test_tag_single', true ) );
- $this->assertEquals( 'hello', get_term_meta( $data['id'], 'test_tag_single', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'My Awesome Term', $data['name'] );
+ $this->assertSame( '', get_term_meta( $existing_tag_id, 'test_tag_single', true ) );
+ $this->assertSame( 'hello', get_term_meta( $data['id'], 'test_tag_single', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -867,13 +867,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'New Name', $data['name'] );
- $this->assertEquals( 'New Description', $data['description'] );
- $this->assertEquals( 'new-slug', $data['slug'] );
- $this->assertEquals( 'just meta', $data['meta']['test_single'] );
- $this->assertEquals( 'tag-specific meta', $data['meta']['test_tag_single'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'New Name', $data['name'] );
+ $this->assertSame( 'New Description', $data['description'] );
+ $this->assertSame( 'new-slug', $data['slug'] );
+ $this->assertSame( 'just meta', $data['meta']['test_single'] );
+ $this->assertSame( 'tag-specific meta', $data['meta']['test_tag_single'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( isset( $data['meta']['test_cat_meta'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -884,16 +884,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', '/wp/v2/tags/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'slug', $term->slug );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Run twice to make sure that the update still succeeds
</span><span class="cx" style="display: block; padding: 0 10px"> // even if no DB rows are updated.
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item_invalid_term() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -931,9 +931,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'user_has_cap', array( $this, 'grant_edit_term' ), 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'New Name', $data['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'New Name', $data['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function grant_edit_term( $caps, $cap ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -986,17 +986,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( $name, $value );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $actual_output = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to actual API output.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['name'], $actual_output['name'] );
- $this->assertEquals( $expected_output['description'], $actual_output['description'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['name'], $actual_output['name'] );
+ $this->assertSame( $expected_output['description'], $actual_output['description'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to WP internal values.
</span><span class="cx" style="display: block; padding: 0 10px"> $tag = get_term_by( 'id', $actual_output['id'], 'post_tag' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['name'], $tag->name );
- $this->assertEquals( $expected_output['description'], $tag->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['name'], $tag->name );
+ $this->assertSame( $expected_output['description'], $tag->description );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update the tag.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/tags/%d', $actual_output['id'] ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1004,23 +1004,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( $name, $value );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $actual_output = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to actual API output.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['name'], $actual_output['name'] );
- $this->assertEquals( $expected_output['description'], $actual_output['description'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['name'], $actual_output['name'] );
+ $this->assertSame( $expected_output['description'], $actual_output['description'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to WP internal values.
</span><span class="cx" style="display: block; padding: 0 10px"> $tag = get_term_by( 'id', $actual_output['id'], 'post_tag' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['name'], $tag->name );
- $this->assertEquals( $expected_output['description'], $tag->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['name'], $tag->name );
+ $this->assertSame( $expected_output['description'], $tag->description );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_tag_roundtrip_as_editor() {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( ! is_multisite(), current_user_can( 'unfiltered_html' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( ! is_multisite(), current_user_can( 'unfiltered_html' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->verify_tag_roundtrip(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'name' => '\o/ ¯\_(ツ)_/¯',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1103,10 +1103,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'DELETE', '/wp/v2/tags/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'force', true );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['deleted'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Deleted Tag', $data['previous']['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Deleted Tag', $data['previous']['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_item_no_trash() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1156,10 +1156,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'map_meta_cap', array( $this, 'grant_delete_term' ), 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['deleted'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Deleted Tag', $data['previous']['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Deleted Tag', $data['previous']['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function grant_delete_term( $caps, $cap ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1210,7 +1210,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( '_fields', 'id,name' );
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term_by( 'id', $this->factory->tag->create(), 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $endpoint->prepare_item_for_response( $term, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'id',
</span><span class="cx" style="display: block; padding: 0 10px"> 'name',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1224,7 +1224,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $properties = $data['schema']['properties'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 8, count( $properties ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 8, count( $properties ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'id', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'count', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'description', $properties );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1233,7 +1233,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'name', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'slug', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'taxonomy', $properties );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array_keys( get_taxonomies() ), $properties['taxonomy']['enum'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array_keys( get_taxonomies() ), $properties['taxonomy']['enum'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_schema_non_hierarchical() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1268,7 +1268,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'my_custom_int', $data['schema']['properties'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $schema, $data['schema']['properties']['my_custom_int'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $schema, $data['schema']['properties']['my_custom_int'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $tag_id = $this->factory->tag->create();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1376,7 +1376,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $create = new WP_REST_Request( 'POST', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px"> $create->set_param( 'name', 'My New Term' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $create );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $edit_field, $data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( $view_field, $data );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1384,7 +1384,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $update = new WP_REST_Request( 'PUT', '/wp/v2/tags/' . $data['id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $update->set_param( 'name', 'My Awesome New Term' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $update );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $edit_field, $data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( $view_field, $data );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1407,31 +1407,31 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected function check_get_taxonomy_terms_response( $response ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $args = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'hide_empty' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $tags = get_terms( 'post_tag', $args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( count( $tags ), count( $data ) );
- $this->assertEquals( $tags[0]->term_id, $data[0]['id'] );
- $this->assertEquals( $tags[0]->name, $data[0]['name'] );
- $this->assertEquals( $tags[0]->slug, $data[0]['slug'] );
- $this->assertEquals( $tags[0]->taxonomy, $data[0]['taxonomy'] );
- $this->assertEquals( $tags[0]->description, $data[0]['description'] );
- $this->assertEquals( $tags[0]->count, $data[0]['count'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( count( $tags ), count( $data ) );
+ $this->assertSame( $tags[0]->term_id, $data[0]['id'] );
+ $this->assertSame( $tags[0]->name, $data[0]['name'] );
+ $this->assertSame( $tags[0]->slug, $data[0]['slug'] );
+ $this->assertSame( $tags[0]->taxonomy, $data[0]['taxonomy'] );
+ $this->assertSame( $tags[0]->description, $data[0]['description'] );
+ $this->assertSame( $tags[0]->count, $data[0]['count'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected function check_taxonomy_term( $term, $data, $links ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $term->term_id, $data['id'] );
- $this->assertEquals( $term->name, $data['name'] );
- $this->assertEquals( $term->slug, $data['slug'] );
- $this->assertEquals( $term->description, $data['description'] );
- $this->assertEquals( get_term_link( $term ), $data['link'] );
- $this->assertEquals( $term->count, $data['count'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $term->term_id, $data['id'] );
+ $this->assertSame( $term->name, $data['name'] );
+ $this->assertSame( $term->slug, $data['slug'] );
+ $this->assertSame( $term->description, $data['description'] );
+ $this->assertSame( get_term_link( $term ), $data['link'] );
+ $this->assertSame( $term->count, $data['count'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $taxonomy = get_taxonomy( $term->taxonomy );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $taxonomy->hierarchical ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $term->parent, $data['parent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $term->parent, $data['parent'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( isset( $data['parent'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1446,12 +1446,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( $expected_links, array_keys( $links ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'wp/v2/taxonomies/' . $term->taxonomy, $links['about'][0]['href'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( add_query_arg( 'tags', $term->term_id, rest_url( 'wp/v2/posts' ) ), $links['https://api.w.org/post_type'][0]['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( add_query_arg( 'tags', $term->term_id, rest_url( 'wp/v2/posts' ) ), $links['https://api.w.org/post_type'][0]['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected function check_get_taxonomy_term_response( $response, $id ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $tag = get_term( $id, 'post_tag' );
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapiresttaxonomiescontrollerphp"></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/rest-api/rest-taxonomies-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-taxonomies-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-taxonomies-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,13 +37,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/taxonomies' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px"> // Single.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/taxonomies/post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets( array( 'view', 'edit', 'embed' ), $data['endpoints'][0]['args']['context']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,14 +52,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $taxonomies = $this->get_public_taxonomies( get_taxonomies( '', 'objects' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( count( $taxonomies ), count( $data ) );
- $this->assertEquals( 'Categories', $data['category']['name'] );
- $this->assertEquals( 'category', $data['category']['slug'] );
- $this->assertEquals( true, $data['category']['hierarchical'] );
- $this->assertEquals( 'Tags', $data['post_tag']['name'] );
- $this->assertEquals( 'post_tag', $data['post_tag']['slug'] );
- $this->assertEquals( false, $data['post_tag']['hierarchical'] );
- $this->assertEquals( 'tags', $data['post_tag']['rest_base'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( count( $taxonomies ), count( $data ) );
+ $this->assertSame( 'Categories', $data['category']['name'] );
+ $this->assertSame( 'category', $data['category']['slug'] );
+ $this->assertTrue( $data['category']['hierarchical'] );
+ $this->assertSame( 'Tags', $data['post_tag']['name'] );
+ $this->assertSame( 'post_tag', $data['post_tag']['slug'] );
+ $this->assertFalse( $data['post_tag']['hierarchical'] );
+ $this->assertSame( 'tags', $data['post_tag']['rest_base'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_context_edit() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -69,14 +69,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $taxonomies = $this->get_public_taxonomies( get_taxonomies( '', 'objects' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( count( $taxonomies ), count( $data ) );
- $this->assertEquals( 'Categories', $data['category']['name'] );
- $this->assertEquals( 'category', $data['category']['slug'] );
- $this->assertEquals( true, $data['category']['hierarchical'] );
- $this->assertEquals( 'Tags', $data['post_tag']['name'] );
- $this->assertEquals( 'post_tag', $data['post_tag']['slug'] );
- $this->assertEquals( false, $data['post_tag']['hierarchical'] );
- $this->assertEquals( 'tags', $data['post_tag']['rest_base'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( count( $taxonomies ), count( $data ) );
+ $this->assertSame( 'Categories', $data['category']['name'] );
+ $this->assertSame( 'category', $data['category']['slug'] );
+ $this->assertTrue( $data['category']['hierarchical'] );
+ $this->assertSame( 'Tags', $data['post_tag']['name'] );
+ $this->assertSame( 'post_tag', $data['post_tag']['slug'] );
+ $this->assertFalse( $data['post_tag']['hierarchical'] );
+ $this->assertSame( 'tags', $data['post_tag']['rest_base'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_invalid_permission_for_context() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -98,9 +98,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/taxonomies' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'type', 'wingding' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '{}', json_encode( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '{}', json_encode( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -153,7 +153,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** Taxonomies can't be created */
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/taxonomies' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -160,7 +160,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** Taxonomies can't be updated */
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'POST', '/wp/v2/taxonomies/category' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -167,7 +167,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** Taxonomies can't be deleted */
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'DELETE', '/wp/v2/taxonomies/category' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_prepare_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,7 +186,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'context', 'edit' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( '_fields', 'id,name' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $endpoint->prepare_item_for_response( $tax, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> // 'id' doesn't exist in this context.
</span><span class="cx" style="display: block; padding: 0 10px"> 'name',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -208,10 +208,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $types = $response->get_data()['types'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 0, $types );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'post', $types[0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'post', $types[0] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 1, $types );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'attachment', $types[1] );
- $this->assertEquals( 2, count( $types ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'attachment', $types[1] );
+ $this->assertSame( 2, count( $types ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_schema() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -219,7 +219,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $properties = $data['schema']['properties'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, count( $properties ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, count( $properties ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'capabilities', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'description', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'hierarchical', $properties );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -251,24 +251,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected function check_taxonomy_object( $context, $tax_obj, $data, $links ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $tax_obj->label, $data['name'] );
- $this->assertEquals( $tax_obj->name, $data['slug'] );
- $this->assertEquals( $tax_obj->description, $data['description'] );
- $this->assertEquals( $tax_obj->hierarchical, $data['hierarchical'] );
- $this->assertEquals( $tax_obj->rest_base, $data['rest_base'] );
- $this->assertEquals( rest_url( 'wp/v2/taxonomies' ), $links['collection'][0]['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $tax_obj->label, $data['name'] );
+ $this->assertSame( $tax_obj->name, $data['slug'] );
+ $this->assertSame( $tax_obj->description, $data['description'] );
+ $this->assertSame( $tax_obj->hierarchical, $data['hierarchical'] );
+ $this->assertSame( $tax_obj->rest_base, $data['rest_base'] );
+ $this->assertSame( rest_url( 'wp/v2/taxonomies' ), $links['collection'][0]['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'https://api.w.org/items', $links );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'edit' === $context ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $tax_obj->cap, $data['capabilities'] );
- $this->assertEquals( $tax_obj->labels, $data['labels'] );
- $this->assertEquals( $tax_obj->show_tagcloud, $data['show_cloud'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $tax_obj->cap, $data['capabilities'] );
+ $this->assertSame( $tax_obj->labels, $data['labels'] );
+ $this->assertSame( $tax_obj->show_tagcloud, $data['show_cloud'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $tax_obj->public, $data['visibility']['public'] );
- $this->assertEquals( $tax_obj->publicly_queryable, $data['visibility']['publicly_queryable'] );
- $this->assertEquals( $tax_obj->show_admin_column, $data['visibility']['show_admin_column'] );
- $this->assertEquals( $tax_obj->show_in_nav_menus, $data['visibility']['show_in_nav_menus'] );
- $this->assertEquals( $tax_obj->show_in_quick_edit, $data['visibility']['show_in_quick_edit'] );
- $this->assertEquals( $tax_obj->show_ui, $data['visibility']['show_ui'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $tax_obj->public, $data['visibility']['public'] );
+ $this->assertSame( $tax_obj->publicly_queryable, $data['visibility']['publicly_queryable'] );
+ $this->assertSame( $tax_obj->show_admin_column, $data['visibility']['show_admin_column'] );
+ $this->assertSame( $tax_obj->show_in_nav_menus, $data['visibility']['show_in_nav_menus'] );
+ $this->assertSame( $tax_obj->show_in_quick_edit, $data['visibility']['show_in_quick_edit'] );
+ $this->assertSame( $tax_obj->show_ui, $data['visibility']['show_ui'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( isset( $data['capabilities'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( isset( $data['labels'] ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -278,7 +278,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected function check_taxonomy_object_response( $context, $response ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $category = get_taxonomy( 'category' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_taxonomy_object( $context, $category, $data, $response->get_links() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -285,10 +285,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected function check_taxonomies_for_type_response( $type, $response ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $taxonomies = $this->get_public_taxonomies( get_object_taxonomies( $type, 'objects' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( count( $taxonomies ), count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( count( $taxonomies ), count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapiresttermmetafieldsphp"></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/rest-api/rest-term-meta-fields.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-term-meta-fields.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-term-meta-fields.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -214,7 +214,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/categories/%d', self::$category_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'meta', $data );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -221,7 +221,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'test_single', $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'testvalue', $meta['test_single'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'testvalue', $meta['test_single'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -232,7 +232,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/categories/%d', self::$category_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -244,7 +244,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_term_meta( self::$category_id, 'test_multi', 'value2' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'value1', $meta['test_multi'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -259,7 +259,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/categories/%d', self::$category_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -274,7 +274,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/categories/%d', self::$category_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -289,7 +289,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/categories/%d', self::$category_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -336,7 +336,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/categories/%d', self::$category_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -351,7 +351,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'test_bool', $meta );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'boolean', $meta['test_bool'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( true, $meta['test_bool'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertTrue( $meta['test_bool'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_value_custom_name() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -360,7 +360,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/categories/%d', self::$category_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'meta', $data );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -367,7 +367,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'new_name', $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'janet', $meta['new_name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'janet', $meta['new_name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -389,17 +389,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_term_meta( self::$category_id, 'test_single', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test_value', $meta[0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test_value', $meta[0] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'test_single', $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test_value', $meta['test_single'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test_value', $meta['test_single'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -408,7 +408,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_set_duplicate_single_value() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Start with an existing metakey and value.
</span><span class="cx" style="display: block; padding: 0 10px"> $values = update_term_meta( self::$category_id, 'test_single', 'test_value' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test_value', get_term_meta( self::$category_id, 'test_single', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test_value', get_term_meta( self::$category_id, 'test_single', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->grant_write_permission();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -421,16 +421,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_term_meta( self::$category_id, 'test_single', true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test_value', $meta );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test_value', $meta );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'test_single', $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test_value', $meta['test_single'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test_value', $meta['test_single'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -539,12 +539,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_term_meta( self::$category_id, 'test_multi', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'val1', $meta[0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'val1', $meta[0] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add another value.
</span><span class="cx" style="display: block; padding: 0 10px"> $data = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -555,7 +555,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_term_meta( self::$category_id, 'test_multi', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -583,7 +583,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_term_meta( self::$category_id, 'test_multi', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -690,7 +690,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $data['meta']['my_meta_key'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $data['meta']['my_meta_key'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_set_value_csv() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -716,7 +716,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 1, 2, 3 ), $data['meta']['my_meta_key'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 1, 2, 3 ), $data['meta']['my_meta_key'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -788,7 +788,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_term_meta( self::$category_id, 'test_custom_schema', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -817,7 +817,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_term_meta( self::$category_id, 'test_custom_schema_multi', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -833,7 +833,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_term_meta( self::$category_id, 'test_custom_schema_multi', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -861,17 +861,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_term_meta( self::$category_id, 'test_custom_name', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'janet', $meta[0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'janet', $meta[0] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'new_name', $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'janet', $meta['new_name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'janet', $meta['new_name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_set_value_custom_name_multiple() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -890,12 +890,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_term_meta( self::$category_id, 'test_custom_name_multi', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'janet', $meta[0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'janet', $meta[0] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add another value.
</span><span class="cx" style="display: block; padding: 0 10px"> $data = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -906,7 +906,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_term_meta( self::$category_id, 'test_custom_name_multi', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $meta );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -938,11 +938,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The meta value should not have changed.
</span><span class="cx" style="display: block; padding: 0 10px"> $current_value = get_term_meta( self::$category_id, 'test_single', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'So I tied an onion to my belt, which was the style at the time.', $current_value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'So I tied an onion to my belt, which was the style at the time.', $current_value );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure the term name update was not processed.
</span><span class="cx" style="display: block; padding: 0 10px"> $term_updated = get_term( self::$category_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $term_original->name, $term_updated->name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $term_original->name, $term_updated->name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -967,17 +967,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The meta value should not have changed.
</span><span class="cx" style="display: block; padding: 0 10px"> $current_value = get_term_meta( self::$category_id, 'test_single', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Now, to take the ferry cost a nickel, and in those days, nickels had pictures of bumblebees on them.', $current_value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Now, to take the ferry cost a nickel, and in those days, nickels had pictures of bumblebees on them.', $current_value );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure the term name update was not processed.
</span><span class="cx" style="display: block; padding: 0 10px"> $term_updated = get_term( self::$category_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $term_original->name, $term_updated->name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $term_original->name, $term_updated->name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_remove_multi_value_db_error() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_term_meta( self::$category_id, 'test_multi', 'val1' );
</span><span class="cx" style="display: block; padding: 0 10px"> $values = get_term_meta( self::$category_id, 'test_multi', false );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'val1' ), $values );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'val1' ), $values );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->grant_write_permission();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1008,7 +1008,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_value() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_term_meta( self::$category_id, 'test_single', 'val1' );
</span><span class="cx" style="display: block; padding: 0 10px"> $current = get_term_meta( self::$category_id, 'test_single', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'val1', $current );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'val1', $current );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->grant_write_permission();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1021,7 +1021,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_term_meta( self::$category_id, 'test_single', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $meta );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1033,7 +1033,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_value_blocked() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_term_meta( self::$category_id, 'test_bad_auth', 'val1' );
</span><span class="cx" style="display: block; padding: 0 10px"> $current = get_term_meta( self::$category_id, 'test_bad_auth', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'val1', $current );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'val1', $current );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->grant_write_permission();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1049,7 +1049,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertErrorResponse( 'rest_cannot_delete', $response, 403 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_term_meta( self::$category_id, 'test_bad_auth', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'val1', $meta );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'val1', $meta );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1058,7 +1058,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_value_db_error() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_term_meta( self::$category_id, 'test_single', 'val1' );
</span><span class="cx" style="display: block; padding: 0 10px"> $current = get_term_meta( self::$category_id, 'test_single', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'val1', $current );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'val1', $current );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->grant_write_permission();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1087,7 +1087,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_value_custom_name() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_term_meta( self::$category_id, 'test_custom_name', 'janet' );
</span><span class="cx" style="display: block; padding: 0 10px"> $current = get_term_meta( self::$category_id, 'test_custom_name', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'janet', $current );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'janet', $current );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->grant_write_permission();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1100,7 +1100,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_body_params( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = get_term_meta( self::$category_id, 'test_custom_name', false );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $meta );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1117,15 +1117,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $meta_schema = $schema['properties']['meta']['properties'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'test_single', $meta_schema );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'string', $meta_schema['test_single']['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'string', $meta_schema['test_single']['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'test_multi', $meta_schema );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'array', $meta_schema['test_multi']['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'array', $meta_schema['test_multi']['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'items', $meta_schema['test_multi'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'string', $meta_schema['test_multi']['items']['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'string', $meta_schema['test_multi']['items']['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'test_custom_schema', $meta_schema );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'number', $meta_schema['test_custom_schema']['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'number', $meta_schema['test_custom_schema']['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'test_no_rest', $meta_schema );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'test_rest_disabled', $meta_schema );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1152,7 +1152,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/%s/%d', $endpoint, $term_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1166,7 +1166,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $meta_key, $data['meta'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_value, $data['meta'][ $meta_key ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_value, $data['meta'][ $meta_key ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( $meta_key, $data['meta'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1212,12 +1212,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $can_write ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( get_term_meta( $term_id, $meta_key, $single ) );
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'meta', $data );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1229,9 +1229,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_value = array( $expected_value );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_value, get_term_meta( $term_id, $meta_key, $single ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_value, get_term_meta( $term_id, $meta_key, $single ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $meta_key, $data['meta'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_value, $data['meta'][ $meta_key ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_value, $data['meta'][ $meta_key ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( get_term_meta( $term_id, $meta_key, $single ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( $meta_key, $data['meta'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1275,7 +1275,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/categories/%d', self::$category_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'meta', $data );
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestthemescontrollerphp"></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/rest-api/rest-themes-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-themes-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-themes-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,9 +78,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'X-WP-Total', $headers );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $headers['X-WP-Total'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $headers['X-WP-Total'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'X-WP-TotalPages', $headers );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -146,7 +146,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items() {
</span><span class="cx" style="display: block; padding: 0 10px"> $response = self::perform_active_theme_request();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_get_theme_response( $response );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -198,7 +198,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $user->ID );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = self::perform_active_theme_request();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -208,7 +208,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_prepare_item() {
</span><span class="cx" style="display: block; padding: 0 10px"> $response = self::perform_active_theme_request();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->check_get_theme_response( $response );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -221,7 +221,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = self::perform_active_theme_request( 'OPTIONS' );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $properties = $data['schema']['properties'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 14, count( $properties ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 14, count( $properties ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'author', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'raw', $properties['author']['properties'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -529,7 +529,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = self::perform_active_theme_request();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'theme_supports', $result[0] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $wordpress_blue ), $result[0]['theme_supports']['editor-color-palette'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $wordpress_blue ), $result[0]['theme_supports']['editor-color-palette'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -574,10 +574,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_theme_supports_custom_logo() {
</span><span class="cx" style="display: block; padding: 0 10px"> remove_theme_support( 'custom-logo' );
</span><span class="cx" style="display: block; padding: 0 10px"> $wordpress_logo = array(
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'width' => 400,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'height' => 100,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'width' => 400,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'flex-width' => true,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'flex-height' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'flex-width' => true,
</del><span class="cx" style="display: block; padding: 0 10px"> 'header-text' => array( 'site-title', 'site-description' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'unlink-homepage-logo' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -585,7 +585,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = self::perform_active_theme_request();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'theme_supports', $result[0] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $wordpress_logo, $result[0]['theme_supports']['custom-logo'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $wordpress_logo, $result[0]['theme_supports']['custom-logo'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -633,7 +633,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'theme_supports', $result[0] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array_diff_key( $wordpress_header, array_flip( $excluded ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $result[0]['theme_supports']['custom-header'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $result[0]['theme_supports']['custom-header'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -677,7 +677,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'theme_supports', $result[0] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array_diff_key( $background, array_flip( $excluded ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $result[0]['theme_supports']['custom-background'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $result[0]['theme_supports']['custom-background'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -710,7 +710,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = self::perform_active_theme_request();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'theme_supports', $result[0] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $html5, $result[0]['theme_supports']['html5'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $html5, $result[0]['theme_supports']['html5'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -895,7 +895,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = self::perform_active_theme_request();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'theme_supports', $result[0] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $gradient ), $result[0]['theme_supports']['editor-gradient-presets'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $gradient ), $result[0]['theme_supports']['editor-gradient-presets'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -995,7 +995,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = self::perform_active_theme_request();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $result[0]['theme_supports'] ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'post' ), $result[0]['theme_supports']['post-thumbnails'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'post' ), $result[0]['theme_supports']['post-thumbnails'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1021,7 +1021,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = self::perform_active_theme_request();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $result[0]['theme_supports'] ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'a', 'b', 'c' ), $result[0]['theme_supports']['test-feature'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'a', 'b', 'c' ), $result[0]['theme_supports']['test-feature'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1049,7 +1049,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'my_custom_int', $data['schema']['properties'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $schema, $data['schema']['properties']['my_custom_int'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $schema, $data['schema']['properties']['my_custom_int'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = self::perform_active_theme_request( 'GET' );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestuserscontrollerphp"></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/rest-api/rest-users-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-users-controller.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api/rest-users-controller.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -168,14 +168,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
- $this->assertEquals( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
+ $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Single.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/users/' . self::$user );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'view', $data['endpoints'][0]['args']['context']['default'] );
- $this->assertEquals( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
+ $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_registered_query_params() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -184,7 +184,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $keys = array_keys( $data['endpoints'][0]['args'] );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $keys );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'context',
</span><span class="cx" style="display: block; padding: 0 10px"> 'exclude',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -210,7 +210,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'context', 'view' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $all_data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $all_data[0];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -225,7 +225,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'context', 'edit' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $all_data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $all_data[0];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -239,7 +239,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'context', 'edit' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test with a user logged in but without sufficient capabilities;
</span><span class="cx" style="display: block; padding: 0 10px"> // capability in question: 'list_users'.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -249,7 +249,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'context', 'edit' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_unauthenticated_includes_authors_of_post_types_shown_in_rest() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -313,8 +313,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_users, $headers['X-WP-Total'] );
- $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_users, $headers['X-WP-Total'] );
+ $this->assertSame( $total_pages, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $next_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'page' => 2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -332,8 +332,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'page', 3 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_users, $headers['X-WP-Total'] );
- $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_users, $headers['X-WP-Total'] );
+ $this->assertSame( $total_pages, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $prev_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'page' => 2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -354,8 +354,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'page', $total_pages );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_users, $headers['X-WP-Total'] );
- $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_users, $headers['X-WP-Total'] );
+ $this->assertSame( $total_pages, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $prev_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'page' => $total_pages - 1,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -370,8 +370,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'page', 100 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $total_users, $headers['X-WP-Total'] );
- $this->assertEquals( $total_pages, $headers['X-WP-TotalPages'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $total_users, $headers['X-WP-Total'] );
+ $this->assertSame( $total_pages, $headers['X-WP-TotalPages'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $prev_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'page' => $total_pages,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -387,12 +387,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, count( $response->get_data() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, count( $response->get_data() ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'per_page', 5 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 5, count( $response->get_data() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 5, count( $response->get_data() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_page() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -402,7 +402,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'per_page', 5 );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'page', 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 5, count( $response->get_data() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 5, count( $response->get_data() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $prev_link = add_query_arg(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'per_page' => 5,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -427,7 +427,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'per_page', 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $high_id, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $high_id, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'name' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -435,7 +435,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'per_page', 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $low_id, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $low_id, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_orderby_url() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -451,7 +451,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'include', array( $low_id, $high_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $high_id, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $high_id, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'url' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -460,7 +460,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'include', array( $low_id, $high_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $low_id, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $low_id, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_orderby_slug() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -476,7 +476,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'include', array( $low_id, $high_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $high_id, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $high_id, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'slug' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -485,7 +485,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'include', array( $low_id, $high_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $low_id, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $low_id, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_orderby_slugs() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -501,9 +501,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'taco', $data[0]['slug'] );
- $this->assertEquals( 'burrito', $data[1]['slug'] );
- $this->assertEquals( 'chalupa', $data[2]['slug'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'taco', $data[0]['slug'] );
+ $this->assertSame( 'burrito', $data[1]['slug'] );
+ $this->assertSame( 'chalupa', $data[2]['slug'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_orderby_email() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -519,7 +519,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'include', array( $low_id, $high_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $high_id, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $high_id, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'email' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -528,7 +528,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'include', array( $low_id, $high_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $low_id, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $low_id, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_orderby_email_unauthenticated() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -598,15 +598,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'include', array( $id2, $id1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
- $this->assertEquals( $id1, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
+ $this->assertSame( $id1, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // 'orderby' => 'include'.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'include' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $data ) );
- $this->assertEquals( $id2, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $data ) );
+ $this->assertSame( $id2, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Invalid 'include' should error.
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'include', 'invalid' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -618,7 +618,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $data ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $data ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -655,7 +655,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'search', 'yololololo' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $response->get_data() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $response->get_data() ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $yolo_id = $this->factory->user->create( array( 'display_name' => 'yololololo' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -662,7 +662,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'search', 'yololololo' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $response->get_data() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $response->get_data() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Default to wildcard search.
</span><span class="cx" style="display: block; padding: 0 10px"> $adam_id = $this->factory->user->create(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -675,8 +675,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'search', 'ada' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( $adam_id, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( $adam_id, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_slug_query() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -699,8 +699,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'slug', 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( $id2, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( $id2, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_slug_array_query() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -743,10 +743,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'slug' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'order', 'asc' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $slugs = wp_list_pluck( $data, 'slug' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'burrito', 'enchilada', 'taco' ), $slugs );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'burrito', 'enchilada', 'taco' ), $slugs );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_slug_csv_query() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -782,10 +782,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'orderby', 'slug' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'order', 'desc' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $slugs = wp_list_pluck( $data, 'slug' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'taco', 'enchilada', 'burrito' ), $slugs );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'taco', 'enchilada', 'burrito' ), $slugs );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -812,15 +812,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'roles', 'author,subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $data ) );
- $this->assertEquals( $tango, $data[1]['id'] );
- $this->assertEquals( $yolo, $data[2]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $data ) );
+ $this->assertSame( $tango, $data[1]['id'] );
+ $this->assertSame( $yolo, $data[2]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'roles', 'author' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( $yolo, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( $yolo, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -849,15 +849,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'roles', 'ilovesteak,author' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $data ) );
- $this->assertEquals( $lolz, $data[0]['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $data ) );
+ $this->assertSame( $lolz, $data[0]['id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'roles', 'steakisgood' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $data ) );
- $this->assertEquals( array(), $data );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $data ) );
+ $this->assertSame( array(), $data );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_items_who_author_query() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -867,7 +867,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'search', 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $response->get_data() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Second request should exclude subscriber.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -875,7 +875,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'who', 'authors' );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'search', 'subscriber' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 0, $response->get_data() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -929,7 +929,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( '_fields', 'id,name' );
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_user_by( 'id', get_current_user_id() );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = $this->endpoint->prepare_item_for_response( $user, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'id',
</span><span class="cx" style="display: block; padding: 0 10px"> 'name',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -952,7 +952,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_user_by( 'id', self::$editor );
</span><span class="cx" style="display: block; padding: 0 10px"> // Ignore the subdomain, since get_avatar_url() randomly sets
</span><span class="cx" style="display: block; padding: 0 10px"> // the Gravatar server when building the URL string.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( substr( get_avatar_url( $user->user_email ), 9 ), substr( $data['avatar_urls'][96], 9 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( substr( get_avatar_url( $user->user_email ), 9 ), substr( $data['avatar_urls'][96], 9 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_user_invalid_id() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1004,7 +1004,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_can_get_item_author_of_rest_true_public_true_unauthenticated() {
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/users/%d', self::$authors['r_true_p_true'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_can_get_item_author_of_rest_true_public_true_authenticated() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1012,13 +1012,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/users/%d', self::$authors['r_true_p_true'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_can_get_item_author_of_rest_true_public_false() {
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/users/%d', self::$authors['r_true_p_false'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_cannot_get_item_author_of_rest_false_public_true_unauthenticated() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1044,7 +1044,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_can_get_item_author_of_post() {
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/users/%d', self::$editor ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_cannot_get_item_author_of_draft() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1084,7 +1084,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/users/%d', $this->author_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->post_id = $this->factory->post->create(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1134,7 +1134,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', '/wp/v2/users/me' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->check_get_user_response( $response, 'view' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1141,7 +1141,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'Location', $headers );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $links = $response->get_links();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( rest_url( 'wp/v2/users/' . self::$user ), $links['self'][0]['href'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( rest_url( 'wp/v2/users/' . self::$user ), $links['self'][0]['href'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_current_user_without_permission() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1175,8 +1175,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://example.com', $data['url'] );
- $this->assertEquals( array( 'editor' ), $data['roles'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://example.com', $data['url'] );
+ $this->assertSame( array( 'editor' ), $data['roles'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->check_add_edit_user_response( $response );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1214,13 +1214,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $data['additional_errors'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 1, $data['additional_errors'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $error = $data['additional_errors'][0];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'user_name', $error['code'] );
- $this->assertEquals( 'Usernames can only contain lowercase letters (a-z) and numbers.', $error['message'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'user_name', $error['code'] );
+ $this->assertSame( 'Usernames can only contain lowercase letters (a-z) and numbers.', $error['message'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $data['data']['params'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $errors = $data['data']['params'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $errors['username'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'This username is invalid because it uses illegal characters. Please enter a valid username.', $errors['username'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'This username is invalid because it uses illegal characters. Please enter a valid username.', $errors['username'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1260,7 +1260,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $data['data']['params'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $errors = $data['data']['params'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $errors['username'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Sorry, that username is not allowed.', $errors['username'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Sorry, that username is not allowed.', $errors['username'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1388,9 +1388,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the code matches one we know.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $error['code'], array( 'user_name', 'user_email' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'user_name' === $error['code'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Sorry, that username already exists!', $error['message'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Sorry, that username already exists!', $error['message'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Sorry, that email address is already used!', $error['message'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Sorry, that email address is already used!', $error['message'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1524,17 +1524,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that the name has been updated correctly.
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'New Name', $new_data['first_name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'New Name', $new_data['first_name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $user = get_userdata( $user_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'New Name', $user->first_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'New Name', $user->first_name );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://google.com', $new_data['url'] );
- $this->assertEquals( 'http://google.com', $user->user_url );
- $this->assertEquals( 'de_DE', $user->locale );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://google.com', $new_data['url'] );
+ $this->assertSame( 'http://google.com', $user->user_url );
+ $this->assertSame( 'de_DE', $user->locale );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that we haven't inadvertently changed the user's password,
</span><span class="cx" style="display: block; padding: 0 10px"> // as per https://core.trac.wordpress.org/ticket/21429
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $pw_before, $user->user_pass );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $pw_before, $user->user_pass );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item_no_change() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1550,10 +1550,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Run twice to make sure that the update still succeeds
</span><span class="cx" style="display: block; padding: 0 10px"> // even if no DB rows are updated.
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item_existing_email() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1578,7 +1578,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'email', 'testjson@example.com' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $response->as_error() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'rest_user_invalid_email', $response->as_error()->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'rest_user_invalid_email', $response->as_error()->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1596,8 +1596,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
- $this->assertEquals( $updated_email_with_case_change, $data['email'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
+ $this->assertSame( $updated_email_with_case_change, $data['email'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1616,7 +1616,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 400, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 400, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'rest_user_invalid_email', $data['code'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1636,7 +1636,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'locale', 'klingon' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $response->as_error() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'rest_invalid_param', $response->as_error()->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'rest_invalid_param', $response->as_error()->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item_en_US_locale() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1657,7 +1657,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_add_edit_user_response( $response, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_userdata( $user_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'en_US', $user->locale );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'en_US', $user->locale );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1682,9 +1682,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_add_edit_user_response( $response, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_locale(), $data['locale'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_locale(), $data['locale'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $user = get_userdata( $user_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $user->locale );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $user->locale );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item_username_attempt() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1709,7 +1709,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'username', 'test_json_user' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $response->as_error() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'rest_user_invalid_argument', $response->as_error()->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'rest_user_invalid_argument', $response->as_error()->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_item_existing_nicename() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1734,7 +1734,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'slug', 'test_json_user' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $response->as_error() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'rest_user_invalid_slug', $response->as_error()->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'rest_user_invalid_slug', $response->as_error()->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_json_update_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1771,15 +1771,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that the name has been updated correctly.
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'JSON Name', $new_data['first_name'] );
- $this->assertEquals( 'New Last', $new_data['last_name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'JSON Name', $new_data['first_name'] );
+ $this->assertSame( 'New Last', $new_data['last_name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $user = get_userdata( $user_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'JSON Name', $user->first_name );
- $this->assertEquals( 'New Last', $user->last_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'JSON Name', $user->first_name );
+ $this->assertSame( 'New Last', $user->last_name );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that we haven't inadvertently changed the user's password,
</span><span class="cx" style="display: block; padding: 0 10px"> // as per https://core.trac.wordpress.org/ticket/21429
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $pw_before, $user->user_pass );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $pw_before, $user->user_pass );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_user_role() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1795,7 +1795,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'editor', $new_data['roles'][0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'editor', $new_data['roles'][0] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( 'administrator', $new_data['roles'][0] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_userdata( $user_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1816,7 +1816,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'author', 'editor' ), $new_data['roles'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'author', 'editor' ), $new_data['roles'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_userdata( $user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'author', $user->caps );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1890,7 +1890,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'editor', $new_data['roles'][0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'editor', $new_data['roles'][0] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( 'administrator', $new_data['roles'][0] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1904,7 +1904,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'editor', $new_data['roles'][0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'editor', $new_data['roles'][0] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( 'administrator', $new_data['roles'][0] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2012,10 +2012,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/users/%d', $user_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'roles', array( 'editor' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'editor', $new_data['roles'][0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'editor', $new_data['roles'][0] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2044,10 +2044,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertErrorResponse( 'rest_cannot_edit', $response, 403 );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_data = $response->get_data();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'editor', $new_data['roles'][0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'editor', $new_data['roles'][0] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2078,27 +2078,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $request->set_param( 'email', 'cbg@androidsdungeon.com' );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $actual_output = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to actual API output.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['username'], $actual_output['username'] );
- $this->assertEquals( $expected_output['name'], $actual_output['name'] );
- $this->assertEquals( $expected_output['first_name'], $actual_output['first_name'] );
- $this->assertEquals( $expected_output['last_name'], $actual_output['last_name'] );
- $this->assertEquals( $expected_output['url'], $actual_output['url'] );
- $this->assertEquals( $expected_output['description'], $actual_output['description'] );
- $this->assertEquals( $expected_output['nickname'], $actual_output['nickname'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['username'], $actual_output['username'] );
+ $this->assertSame( $expected_output['name'], $actual_output['name'] );
+ $this->assertSame( $expected_output['first_name'], $actual_output['first_name'] );
+ $this->assertSame( $expected_output['last_name'], $actual_output['last_name'] );
+ $this->assertSame( $expected_output['url'], $actual_output['url'] );
+ $this->assertSame( $expected_output['description'], $actual_output['description'] );
+ $this->assertSame( $expected_output['nickname'], $actual_output['nickname'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to WP internal values.
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_userdata( $actual_output['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['username'], $user->user_login );
- $this->assertEquals( $expected_output['name'], $user->display_name );
- $this->assertEquals( $expected_output['first_name'], $user->first_name );
- $this->assertEquals( $expected_output['last_name'], $user->last_name );
- $this->assertEquals( $expected_output['url'], $user->user_url );
- $this->assertEquals( $expected_output['description'], $user->description );
- $this->assertEquals( $expected_output['nickname'], $user->nickname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['username'], $user->user_login );
+ $this->assertSame( $expected_output['name'], $user->display_name );
+ $this->assertSame( $expected_output['first_name'], $user->first_name );
+ $this->assertSame( $expected_output['last_name'], $user->last_name );
+ $this->assertSame( $expected_output['url'], $user->user_url );
+ $this->assertSame( $expected_output['description'], $user->description );
+ $this->assertSame( $expected_output['nickname'], $user->nickname );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( wp_check_password( addslashes( $expected_output['password'] ), $user->user_pass ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user_id = $actual_output['id'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2112,31 +2112,31 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $actual_output = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to actual API output.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $expected_output['username'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['username'], $actual_output['username'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['username'], $actual_output['username'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['name'], $actual_output['name'] );
- $this->assertEquals( $expected_output['first_name'], $actual_output['first_name'] );
- $this->assertEquals( $expected_output['last_name'], $actual_output['last_name'] );
- $this->assertEquals( $expected_output['url'], $actual_output['url'] );
- $this->assertEquals( $expected_output['description'], $actual_output['description'] );
- $this->assertEquals( $expected_output['nickname'], $actual_output['nickname'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['name'], $actual_output['name'] );
+ $this->assertSame( $expected_output['first_name'], $actual_output['first_name'] );
+ $this->assertSame( $expected_output['last_name'], $actual_output['last_name'] );
+ $this->assertSame( $expected_output['url'], $actual_output['url'] );
+ $this->assertSame( $expected_output['description'], $actual_output['description'] );
+ $this->assertSame( $expected_output['nickname'], $actual_output['nickname'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compare expected API output to WP internal values.
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_userdata( $actual_output['id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $expected_output['username'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['username'], $user->user_login );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['username'], $user->user_login );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_output['name'], $user->display_name );
- $this->assertEquals( $expected_output['first_name'], $user->first_name );
- $this->assertEquals( $expected_output['last_name'], $user->last_name );
- $this->assertEquals( $expected_output['url'], $user->user_url );
- $this->assertEquals( $expected_output['description'], $user->description );
- $this->assertEquals( $expected_output['nickname'], $user->nickname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_output['name'], $user->display_name );
+ $this->assertSame( $expected_output['first_name'], $user->first_name );
+ $this->assertSame( $expected_output['last_name'], $user->last_name );
+ $this->assertSame( $expected_output['url'], $user->user_url );
+ $this->assertSame( $expected_output['description'], $user->description );
+ $this->assertSame( $expected_output['nickname'], $user->nickname );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( wp_check_password( addslashes( $expected_output['password'] ), $user->user_pass ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2143,7 +2143,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_user_roundtrip_as_editor() {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( ! is_multisite(), current_user_can( 'unfiltered_html' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( ! is_multisite(), current_user_can( 'unfiltered_html' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->verify_user_roundtrip(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'id' => self::$editor,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2296,10 +2296,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['deleted'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Deleted User', $data['previous']['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Deleted User', $data['previous']['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_item_no_trash() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2355,10 +2355,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $data['deleted'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Deleted User', $data['previous']['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Deleted User', $data['previous']['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_current_item_no_trash() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2459,7 +2459,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that the post has been updated correctly.
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $test_post );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2527,7 +2527,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $test_post = get_post( $test_post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'trash', $test_post->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'trash', $test_post->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_user_reassign_passed_as_string_false_trashes_post() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2555,7 +2555,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $test_post = get_post( $test_post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'trash', $test_post->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'trash', $test_post->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_user_reassign_passed_as_empty_string_trashes_post() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2583,7 +2583,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $test_post = get_post( $test_post );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'trash', $test_post->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'trash', $test_post->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_delete_user_reassign_passed_as_0_reassigns_author() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2620,7 +2620,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $properties = $data['schema']['properties'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 19, count( $properties ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 19, count( $properties ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'avatar_urls', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'capabilities', $properties );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'description', $properties );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2684,7 +2684,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'my_custom_int', $data['schema']['properties'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $schema, $data['schema']['properties']['my_custom_int'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $schema, $data['schema']['properties']['my_custom_int'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2909,7 +2909,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/users/%d', self::$user ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'meta', $data );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2916,7 +2916,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = (array) $data['meta'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( $meta_key, $meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $meta[ $meta_key ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $meta[ $meta_key ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_get_default_data() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3021,25 +3021,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected function check_user_data( $user, $data, $context, $links ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user->ID, $data['id'] );
- $this->assertEquals( $user->display_name, $data['name'] );
- $this->assertEquals( $user->user_url, $data['url'] );
- $this->assertEquals( $user->description, $data['description'] );
- $this->assertEquals( get_author_posts_url( $user->ID ), $data['link'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user->ID, $data['id'] );
+ $this->assertSame( $user->display_name, $data['name'] );
+ $this->assertSame( $user->user_url, $data['url'] );
+ $this->assertSame( $user->description, $data['description'] );
+ $this->assertSame( get_author_posts_url( $user->ID ), $data['link'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'avatar_urls', $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user->user_nicename, $data['slug'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user->user_nicename, $data['slug'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'edit' === $context ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user->first_name, $data['first_name'] );
- $this->assertEquals( $user->last_name, $data['last_name'] );
- $this->assertEquals( $user->nickname, $data['nickname'] );
- $this->assertEquals( $user->user_email, $data['email'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user->first_name, $data['first_name'] );
+ $this->assertSame( $user->last_name, $data['last_name'] );
+ $this->assertSame( $user->nickname, $data['nickname'] );
+ $this->assertSame( $user->user_email, $data['email'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( (object) $user->allcaps, $data['capabilities'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( (object) $user->caps, $data['extra_capabilities'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( gmdate( 'c', strtotime( $user->user_registered ) ), $data['registered_date'] );
- $this->assertEquals( $user->user_login, $data['username'] );
- $this->assertEquals( $user->roles, $data['roles'] );
- $this->assertEquals( get_user_locale( $user ), $data['locale'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( gmdate( 'c', strtotime( $user->user_registered ) ), $data['registered_date'] );
+ $this->assertSame( $user->user_login, $data['username'] );
+ $this->assertSame( $user->roles, $data['roles'] );
+ $this->assertSame( get_user_locale( $user ), $data['locale'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'edit' !== $context ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3067,7 +3067,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected function check_get_user_response( $response, $context = 'view' ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $userdata = get_userdata( $data['id'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3076,9 +3076,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected function check_add_edit_user_response( $response, $update = false ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $update ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 200, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 200, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 201, $response->get_status() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 201, $response->get_status() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapiphp"></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/rest-api.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rest-api.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -42,36 +42,36 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * have a default priority of 10.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_init_action_added() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_action( 'init', 'rest_api_init' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_action( 'init', 'rest_api_init' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_add_extra_api_taxonomy_arguments() {
</span><span class="cx" style="display: block; padding: 0 10px"> $taxonomy = get_taxonomy( 'category' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $taxonomy->show_in_rest );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'categories', $taxonomy->rest_base );
- $this->assertEquals( 'WP_REST_Terms_Controller', $taxonomy->rest_controller_class );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'categories', $taxonomy->rest_base );
+ $this->assertSame( 'WP_REST_Terms_Controller', $taxonomy->rest_controller_class );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $taxonomy = get_taxonomy( 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $taxonomy->show_in_rest );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'tags', $taxonomy->rest_base );
- $this->assertEquals( 'WP_REST_Terms_Controller', $taxonomy->rest_controller_class );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'tags', $taxonomy->rest_base );
+ $this->assertSame( 'WP_REST_Terms_Controller', $taxonomy->rest_controller_class );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_add_extra_api_post_type_arguments() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type = get_post_type_object( 'post' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $post_type->show_in_rest );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'posts', $post_type->rest_base );
- $this->assertEquals( 'WP_REST_Posts_Controller', $post_type->rest_controller_class );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'posts', $post_type->rest_base );
+ $this->assertSame( 'WP_REST_Posts_Controller', $post_type->rest_controller_class );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type = get_post_type_object( 'page' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $post_type->show_in_rest );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'pages', $post_type->rest_base );
- $this->assertEquals( 'WP_REST_Posts_Controller', $post_type->rest_controller_class );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'pages', $post_type->rest_base );
+ $this->assertSame( 'WP_REST_Posts_Controller', $post_type->rest_controller_class );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type = get_post_type_object( 'attachment' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $post_type->show_in_rest );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'media', $post_type->rest_base );
- $this->assertEquals( 'WP_REST_Attachments_Controller', $post_type->rest_controller_class );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'media', $post_type->rest_base );
+ $this->assertSame( 'WP_REST_Attachments_Controller', $post_type->rest_controller_class );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -98,7 +98,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $endpoint = $endpoints['/test-ns/test'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'callback', $endpoint );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'namespace', $endpoint );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test-ns', $endpoint['namespace'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test-ns', $endpoint['namespace'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Grab the filtered data.
</span><span class="cx" style="display: block; padding: 0 10px"> $filtered_endpoints = $GLOBALS['wp_rest_server']->get_routes();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -141,7 +141,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $endpoint = $endpoints['/test-ns/test'];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'callback', $endpoint );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'namespace', $endpoint );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test-ns', $endpoint['namespace'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test-ns', $endpoint['namespace'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $filtered_endpoints = $GLOBALS['wp_rest_server']->get_routes();
</span><span class="cx" style="display: block; padding: 0 10px"> $endpoint = $filtered_endpoints['/test-ns/test'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -281,7 +281,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $routes = $GLOBALS['wp_rest_server']->get_routes();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $routes['/test-ns/test'][0]['methods'], array( 'GET' => true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $routes['/test-ns/test'][0]['methods'], array( 'GET' => true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -300,7 +300,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $routes = $GLOBALS['wp_rest_server']->get_routes();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $routes['/test-ns/test'][0]['methods'], array( 'GET' => true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $routes['/test-ns/test'][0]['methods'], array( 'GET' => true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -319,7 +319,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $routes = $GLOBALS['wp_rest_server']->get_routes();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $routes['/test-ns/test'][0]['methods'],
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'GET' => true,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -344,7 +344,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $routes = $GLOBALS['wp_rest_server']->get_routes();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> $routes['/test-ns/test'][0]['methods'],
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'GET' => true,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -370,7 +370,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = $response->get_headers();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'Allow', $headers );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'GET, POST', $headers['Allow'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'GET, POST', $headers['Allow'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -402,7 +402,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_filter_response_fields( $response, null, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'a' => true ), $response->get_data() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'a' => true ), $response->get_data() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -422,7 +422,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_filter_response_fields( $response, null, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'b' => 1 ), $response->get_data() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'b' => 1 ), $response->get_data() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -445,7 +445,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_filter_response_fields( $response, null, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'b' => 1,
</span><span class="cx" style="display: block; padding: 0 10px"> 'c' => 2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -477,7 +477,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_filter_response_fields( $response, null, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'b' => 1,
</span><span class="cx" style="display: block; padding: 0 10px"> 'c' => 2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -516,7 +516,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_filter_response_fields( $response, null, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'b' => 1,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -562,7 +562,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_filter_response_fields( $response, null, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'b' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> '1' => 1,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -603,7 +603,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_filter_response_fields( $response, null, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'field' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'a' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -639,7 +639,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_filter_response_fields( $response, null, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key1' => 1,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -671,7 +671,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_filter_response_fields( $response, null, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key1' => 1,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -703,7 +703,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = rest_filter_response_fields( $response, null, $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key1' => 1,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -745,15 +745,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_url_generation() {
</span><span class="cx" style="display: block; padding: 0 10px"> // In pretty permalinks case, we expect a path of wp-json/ with no query.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://' . WP_TESTS_DOMAIN . '/wp-json/', get_rest_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://' . WP_TESTS_DOMAIN . '/wp-json/', get_rest_url() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // In index permalinks case, we expect a path of index.php/wp-json/ with no query.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->set_permalink_structure( '/index.php/%year%/%monthnum%/%day%/%postname%/' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://' . WP_TESTS_DOMAIN . '/index.php/wp-json/', get_rest_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://' . WP_TESTS_DOMAIN . '/index.php/wp-json/', get_rest_url() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // In non-pretty case, we get a query string to invoke the rest router.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->set_permalink_structure( '' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://' . WP_TESTS_DOMAIN . '/index.php?rest_route=/', get_rest_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://' . WP_TESTS_DOMAIN . '/index.php?rest_route=/', get_rest_url() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -807,19 +807,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Passing no path should return a slash.
</span><span class="cx" style="display: block; padding: 0 10px"> get_rest_url();
</span><span class="cx" style="display: block; padding: 0 10px"> $args = $filter->get_args();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/', $args[0][1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/', $args[0][1] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $filter->reset();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Paths without a prepended slash should have one added.
</span><span class="cx" style="display: block; padding: 0 10px"> get_rest_url( null, 'wp/media/' );
</span><span class="cx" style="display: block; padding: 0 10px"> $args = $filter->get_args();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/wp/media/', $args[0][1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/wp/media/', $args[0][1] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $filter->reset();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Do not modify paths with a prepended slash.
</span><span class="cx" style="display: block; padding: 0 10px"> get_rest_url( null, '/wp/media/' );
</span><span class="cx" style="display: block; padding: 0 10px"> $args = $filter->get_args();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/wp/media/', $args[0][1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/wp/media/', $args[0][1] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $filter );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -846,7 +846,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider jsonp_callback_provider
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_jsonp_callback_check( $callback, $valid ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $valid, wp_check_jsonp_callback( $callback ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $valid, wp_check_jsonp_callback( $callback ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function rest_date_provider() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -910,7 +910,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider rest_date_force_utc_provider
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_parse_date_force_utc( $string, $value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, rest_parse_date( $string, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, rest_parse_date( $string, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function filter_wp_rest_server_class( $class_name ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -932,7 +932,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $routes = $GLOBALS['wp_rest_server']->get_routes();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $routes['/test-ns/test'][0]['methods'], array( 'GET' => true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $routes['/test-ns/test'][0]['methods'], array( 'GET' => true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_rest_preload_api_request_with_method() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -962,8 +962,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_rest_ensure_request_accepts_path_string() {
</span><span class="cx" style="display: block; padding: 0 10px"> $request = rest_ensure_request( '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_REST_Request', $request );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/wp/v2/posts', $request->get_route() );
- $this->assertEquals( 'GET', $request->get_method() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/wp/v2/posts', $request->get_route() );
+ $this->assertSame( 'GET', $request->get_method() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -970,7 +970,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider _dp_rest_parse_embed_param
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_parse_embed_param( $expected, $embed ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, rest_parse_embed_param( $embed ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, rest_parse_embed_param( $embed ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function _dp_rest_parse_embed_param() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -999,7 +999,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider _dp_rest_filter_response_by_context
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_filter_response_by_context( $schema, $data, $expected ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, rest_filter_response_by_context( $data, $schema, 'view' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, rest_filter_response_by_context( $data, $schema, 'view' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1552,7 +1552,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49116
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_get_route_for_post_non_post() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', rest_get_route_for_post( 'garbage' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', rest_get_route_for_post( 'garbage' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1563,7 +1563,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post = self::factory()->post->create_and_get( array( 'post_type' => 'invalid' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> unregister_post_type( 'invalid' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', rest_get_route_for_post( $post ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', rest_get_route_for_post( $post ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1571,7 +1571,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_get_route_for_post_non_rest() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = self::factory()->post->create_and_get( array( 'post_type' => 'custom_css' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', rest_get_route_for_post( $post ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', rest_get_route_for_post( $post ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1579,7 +1579,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_get_route_for_post_custom_controller() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = self::factory()->post->create_and_get( array( 'post_type' => 'wp_block' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', rest_get_route_for_post( $post ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', rest_get_route_for_post( $post ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1587,7 +1587,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_get_route_for_post() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = self::factory()->post->create_and_get();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/wp/v2/posts/' . $post->ID, rest_get_route_for_post( $post ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/wp/v2/posts/' . $post->ID, rest_get_route_for_post( $post ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1595,7 +1595,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_get_route_for_media() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = self::factory()->attachment->create_and_get();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/wp/v2/media/' . $post->ID, rest_get_route_for_post( $post ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/wp/v2/media/' . $post->ID, rest_get_route_for_post( $post ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1603,7 +1603,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_get_route_for_post_id() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = self::factory()->post->create_and_get();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/wp/v2/posts/' . $post->ID, rest_get_route_for_post( $post->ID ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/wp/v2/posts/' . $post->ID, rest_get_route_for_post( $post->ID ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1610,7 +1610,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49116
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_get_route_for_term_non_term() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', rest_get_route_for_term( 'garbage' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', rest_get_route_for_term( 'garbage' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1621,7 +1621,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $term = self::factory()->term->create_and_get( array( 'taxonomy' => 'invalid' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> unregister_taxonomy( 'invalid' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', rest_get_route_for_term( $term ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', rest_get_route_for_term( $term ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1629,7 +1629,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_get_route_for_term_non_rest() {
</span><span class="cx" style="display: block; padding: 0 10px"> $term = self::factory()->term->create_and_get( array( 'taxonomy' => 'post_format' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', rest_get_route_for_term( $term ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', rest_get_route_for_term( $term ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1637,7 +1637,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_get_route_for_term() {
</span><span class="cx" style="display: block; padding: 0 10px"> $term = self::factory()->term->create_and_get();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/wp/v2/tags/' . $term->term_id, rest_get_route_for_term( $term ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/wp/v2/tags/' . $term->term_id, rest_get_route_for_term( $term ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1645,7 +1645,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_get_route_for_category() {
</span><span class="cx" style="display: block; padding: 0 10px"> $term = self::factory()->category->create_and_get();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/wp/v2/categories/' . $term->term_id, rest_get_route_for_term( $term ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/wp/v2/categories/' . $term->term_id, rest_get_route_for_term( $term ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1653,7 +1653,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_get_route_for_term_id() {
</span><span class="cx" style="display: block; padding: 0 10px"> $term = self::factory()->term->create_and_get();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/wp/v2/tags/' . $term->term_id, rest_get_route_for_term( $term->term_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/wp/v2/tags/' . $term->term_id, rest_get_route_for_term( $term->term_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1729,7 +1729,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_sanitize_object( $expected, $value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $sanitized = rest_sanitize_object( $value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $sanitized );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $sanitized );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function _dp_rest_sanitize_object() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1858,7 +1858,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_rest_sanitize_array( $expected, $value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $sanitized = rest_sanitize_array( $value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $sanitized );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $sanitized );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function _dp_rest_sanitize_array() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1991,7 +1991,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $types The list of available types.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_best_type_for_value( $expected, $value, $types ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, rest_get_best_type_for_value( $value, $types ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, rest_get_best_type_for_value( $value, $types ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function _dp_get_best_type_for_value() {
</span></span></pre></div>
<a id="trunktestsphpunittestsrewritenumericSlugsphp"></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/rewrite/numericSlugs.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rewrite/numericSlugs.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rewrite/numericSlugs.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,7 +75,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'ID' => $id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '2015', url_to_postid( get_permalink( '2015' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2015, url_to_postid( get_permalink( '2015' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_go_to_year_segment_collision_with_title() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -109,7 +109,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, url_to_postid( get_permalink( $id ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_go_to_month_segment_collision_without_title() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -145,7 +145,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, url_to_postid( get_permalink( $id ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_go_to_month_segment_collision_without_title_no_leading_zero() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -181,7 +181,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, url_to_postid( get_permalink( $id ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_go_to_month_segment_collision_with_title() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -215,7 +215,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, url_to_postid( get_permalink( $id ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_go_to_month_segment_collision_with_title_no_leading_zero() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -249,7 +249,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, url_to_postid( get_permalink( $id ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_go_to_day_segment_collision_without_title() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -285,7 +285,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, url_to_postid( get_permalink( $id ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_go_to_day_segment_collision_with_title() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -319,7 +319,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, url_to_postid( get_permalink( $id ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_numeric_slug_permalink_conflicts_should_only_be_resolved_for_the_main_query() {
</span></span></pre></div>
<a id="trunktestsphpunittestsrewriteoldSlugRedirectphp"></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/rewrite/oldSlugRedirect.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rewrite/oldSlugRedirect.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rewrite/oldSlugRedirect.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,7 +51,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( $old_permalink );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_old_slug_redirect();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $permalink, $this->old_slug_redirect_url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $permalink, $this->old_slug_redirect_url );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_old_slug_redirect_attachment() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,7 +92,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( $old_permalink );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_old_slug_redirect();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $permalink, $this->old_slug_redirect_url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $permalink, $this->old_slug_redirect_url );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_old_slug_redirect_paged() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -116,7 +116,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( $old_permalink );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_old_slug_redirect();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $permalink, $this->old_slug_redirect_url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $permalink, $this->old_slug_redirect_url );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -141,7 +141,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $permalink = user_trailingslashit( get_permalink( $new_post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $old_permalink, $permalink );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $old_permalink, $permalink );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( $old_permalink );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_old_slug_redirect();
</span></span></pre></div>
<a id="trunktestsphpunittestsrewritephp"></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/rewrite.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rewrite.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/rewrite.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -88,20 +88,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_url_to_postid() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $id = self::factory()->post->create();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, url_to_postid( get_permalink( $id ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $id = self::factory()->post->create( array( 'post_type' => 'page' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, url_to_postid( get_permalink( $id ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_url_to_postid_set_url_scheme_https_to_http() {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px"> $permalink = get_permalink( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_id, url_to_postid( set_url_scheme( $permalink, 'https' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_id, url_to_postid( set_url_scheme( $permalink, 'https' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_type' => 'page' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $permalink = get_permalink( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_id, url_to_postid( set_url_scheme( $permalink, 'https' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_id, url_to_postid( set_url_scheme( $permalink, 'https' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_url_to_postid_set_url_scheme_http_to_https() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -115,8 +115,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $page_permalink = get_permalink( $page_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $page_url_to_id = url_to_postid( set_url_scheme( $page_permalink, 'http' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_id, $post_url_to_id );
- $this->assertEquals( $page_id, $page_url_to_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_id, $post_url_to_id );
+ $this->assertSame( $page_id, $page_url_to_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -148,7 +148,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'https', parse_url( $network_home, PHP_URL_SCHEME ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test that the url_to_postid() call matched.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_id, $url_to_postid );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_id, $url_to_postid );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -177,7 +177,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> register_post_type( $post_type, array( 'public' => true ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $id = self::factory()->post->create( array( 'post_type' => $post_type ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, url_to_postid( get_permalink( $id ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_post_type( $post_type );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -198,8 +198,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $parent_id, url_to_postid( get_permalink( $parent_id ) ) );
- $this->assertEquals( $child_id, url_to_postid( get_permalink( $child_id ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $parent_id, url_to_postid( get_permalink( $parent_id ) ) );
+ $this->assertSame( $child_id, url_to_postid( get_permalink( $child_id ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_url_to_postid_hierarchical_with_matching_leaves() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -239,10 +239,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( home_url( 'parent/child1/grandchild/' ), get_permalink( $grandchild_id_1 ) );
- $this->assertEquals( home_url( 'parent/child2/grandchild/' ), get_permalink( $grandchild_id_2 ) );
- $this->assertEquals( $grandchild_id_1, url_to_postid( get_permalink( $grandchild_id_1 ) ) );
- $this->assertEquals( $grandchild_id_2, url_to_postid( get_permalink( $grandchild_id_2 ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( home_url( 'parent/child1/grandchild/' ), get_permalink( $grandchild_id_1 ) );
+ $this->assertSame( home_url( 'parent/child2/grandchild/' ), get_permalink( $grandchild_id_2 ) );
+ $this->assertSame( $grandchild_id_1, url_to_postid( get_permalink( $grandchild_id_1 ) ) );
+ $this->assertSame( $grandchild_id_2, url_to_postid( get_permalink( $grandchild_id_2 ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_url_to_postid_home_has_path() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -256,16 +256,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_name' => 'examp',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
- $this->assertEquals( $id, url_to_postid( site_url( '/example/examp' ) ) );
- $this->assertEquals( $id, url_to_postid( '/example/examp/' ) );
- $this->assertEquals( $id, url_to_postid( '/example/examp' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, url_to_postid( get_permalink( $id ) ) );
+ $this->assertSame( $id, url_to_postid( site_url( '/example/examp' ) ) );
+ $this->assertSame( $id, url_to_postid( '/example/examp/' ) );
+ $this->assertSame( $id, url_to_postid( '/example/examp' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, url_to_postid( site_url( '/example/ex' ) ) );
- $this->assertEquals( 0, url_to_postid( '/example/ex' ) );
- $this->assertEquals( 0, url_to_postid( '/example/ex/' ) );
- $this->assertEquals( 0, url_to_postid( '/example-page/example/' ) );
- $this->assertEquals( 0, url_to_postid( '/example-page/ex/' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, url_to_postid( site_url( '/example/ex' ) ) );
+ $this->assertSame( 0, url_to_postid( '/example/ex' ) );
+ $this->assertSame( 0, url_to_postid( '/example/ex/' ) );
+ $this->assertSame( 0, url_to_postid( '/example-page/example/' ) );
+ $this->assertSame( 0, url_to_postid( '/example-page/ex/' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -276,10 +276,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'home', $home_url );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( $home_url );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $GLOBALS['wp']->query_vars );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $GLOBALS['wp']->query_vars );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( $home_url . 'page' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'page' => '',
</span><span class="cx" style="display: block; padding: 0 10px"> 'pagename' => 'page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -297,10 +297,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'home', $home_url );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( $home_url );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $GLOBALS['wp']->query_vars );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $GLOBALS['wp']->query_vars );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( $home_url . 'page' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'page' => '',
</span><span class="cx" style="display: block; padding: 0 10px"> 'pagename' => 'page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -316,7 +316,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['wp']->query_vars
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'page' => '',
</span><span class="cx" style="display: block; padding: 0 10px"> 'pagename' => 'match/page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -337,7 +337,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_post_type( 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $GLOBALS['wp']->query_vars );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $GLOBALS['wp']->query_vars );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_url_to_postid_dupe_path() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -351,10 +351,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
- $this->assertEquals( $id, url_to_postid( site_url( '/example/example/' ) ) );
- $this->assertEquals( $id, url_to_postid( '/example/example/' ) );
- $this->assertEquals( $id, url_to_postid( '/example/example' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id, url_to_postid( get_permalink( $id ) ) );
+ $this->assertSame( $id, url_to_postid( site_url( '/example/example/' ) ) );
+ $this->assertSame( $id, url_to_postid( '/example/example/' ) );
+ $this->assertSame( $id, url_to_postid( '/example/example' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -373,7 +373,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // This url should NOT return a post ID.
</span><span class="cx" style="display: block; padding: 0 10px"> $badurl = site_url( '/example-collision' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, url_to_postid( $badurl ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, url_to_postid( $badurl ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -394,7 +394,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // This url should NOT return a post ID.
</span><span class="cx" style="display: block; padding: 0 10px"> $badurl = network_home_url( '/example-collision' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, url_to_postid( $badurl ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, url_to_postid( $badurl ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> restore_current_blog();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -413,7 +413,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create( array( 'post_title' => get_post( $page_id )->post_title ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_id, url_to_postid( get_permalink( $post_id ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_id, url_to_postid( get_permalink( $post_id ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsshortcodephp"></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/shortcode.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/shortcode.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/shortcode.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -97,19 +97,19 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_noatts() {
</span><span class="cx" style="display: block; padding: 0 10px"> do_shortcode( '[test-shortcode-tag /]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $this->atts );
- $this->assertEquals( 'test-shortcode-tag', $this->tagname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $this->atts );
+ $this->assertSame( 'test-shortcode-tag', $this->tagname );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_one_att() {
</span><span class="cx" style="display: block; padding: 0 10px"> do_shortcode( '[test-shortcode-tag foo="asdf" /]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'foo' => 'asdf' ), $this->atts );
- $this->assertEquals( 'test-shortcode-tag', $this->tagname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'foo' => 'asdf' ), $this->atts );
+ $this->assertSame( 'test-shortcode-tag', $this->tagname );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_not_a_tag() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[not-a-shortcode-tag]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '[not-a-shortcode-tag]', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '[not-a-shortcode-tag]', $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,17 +117,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_tag_hyphen_not_tag() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[dumptag-notreal]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '[dumptag-notreal]', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '[dumptag-notreal]', $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_tag_underscore_not_tag() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[dumptag_notreal]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '[dumptag_notreal]', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '[dumptag_notreal]', $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_tag_not_tag() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[dumptagnotreal]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '[dumptagnotreal]', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '[dumptagnotreal]', $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -134,11 +134,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 17657
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_tag_hyphen() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '_shortcode_hyphen', do_shortcode( '[hyphen]' ) );
- $this->assertEquals( '_shortcode_hyphen_foo', do_shortcode( '[hyphen-foo]' ) );
- $this->assertEquals( '_shortcode_hyphen_foo_bar', do_shortcode( '[hyphen-foo-bar]' ) );
- $this->assertEquals( '[hyphen-baz]', do_shortcode( '[hyphen-baz]' ) );
- $this->assertEquals( '[hyphen-foo-bar-baz]', do_shortcode( '[hyphen-foo-bar-baz]' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '_shortcode_hyphen', do_shortcode( '[hyphen]' ) );
+ $this->assertSame( '_shortcode_hyphen_foo', do_shortcode( '[hyphen-foo]' ) );
+ $this->assertSame( '_shortcode_hyphen_foo_bar', do_shortcode( '[hyphen-foo-bar]' ) );
+ $this->assertSame( '[hyphen-baz]', do_shortcode( '[hyphen-baz]' ) );
+ $this->assertSame( '[hyphen-foo-bar-baz]', do_shortcode( '[hyphen-foo-bar-baz]' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -156,12 +156,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '-foo-bar-baz' => '-foo-bar-baz',
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo--bar' => 'foo--bar',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_attrs, $this->atts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_attrs, $this->atts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_two_atts() {
</span><span class="cx" style="display: block; padding: 0 10px"> do_shortcode( '[test-shortcode-tag foo="asdf" bar="bing" /]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo' => 'asdf',
</span><span class="cx" style="display: block; padding: 0 10px"> 'bar' => 'bing',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -168,26 +168,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $this->atts
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test-shortcode-tag', $this->tagname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test-shortcode-tag', $this->tagname );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_noatts_enclosing() {
</span><span class="cx" style="display: block; padding: 0 10px"> do_shortcode( '[test-shortcode-tag]content[/test-shortcode-tag]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $this->atts );
- $this->assertEquals( 'content', $this->content );
- $this->assertEquals( 'test-shortcode-tag', $this->tagname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $this->atts );
+ $this->assertSame( 'content', $this->content );
+ $this->assertSame( 'test-shortcode-tag', $this->tagname );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_one_att_enclosing() {
</span><span class="cx" style="display: block; padding: 0 10px"> do_shortcode( '[test-shortcode-tag foo="bar"]content[/test-shortcode-tag]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'foo' => 'bar' ), $this->atts );
- $this->assertEquals( 'content', $this->content );
- $this->assertEquals( 'test-shortcode-tag', $this->tagname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'foo' => 'bar' ), $this->atts );
+ $this->assertSame( 'content', $this->content );
+ $this->assertSame( 'test-shortcode-tag', $this->tagname );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_two_atts_enclosing() {
</span><span class="cx" style="display: block; padding: 0 10px"> do_shortcode( '[test-shortcode-tag foo="bar" baz="bing"]content[/test-shortcode-tag]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo' => 'bar',
</span><span class="cx" style="display: block; padding: 0 10px"> 'baz' => 'bing',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -194,35 +194,35 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $this->atts
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'content', $this->content );
- $this->assertEquals( 'test-shortcode-tag', $this->tagname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'content', $this->content );
+ $this->assertSame( 'test-shortcode-tag', $this->tagname );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_unclosed() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[test-shortcode-tag]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out );
- $this->assertEquals( '', $this->atts );
- $this->assertEquals( 'test-shortcode-tag', $this->tagname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out );
+ $this->assertSame( '', $this->atts );
+ $this->assertSame( 'test-shortcode-tag', $this->tagname );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_positional_atts_num() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[test-shortcode-tag 123]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out );
- $this->assertEquals( array( 0 => '123' ), $this->atts );
- $this->assertEquals( 'test-shortcode-tag', $this->tagname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out );
+ $this->assertSame( array( 0 => '123' ), $this->atts );
+ $this->assertSame( 'test-shortcode-tag', $this->tagname );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_positional_atts_url() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[test-shortcode-tag http://www.youtube.com/watch?v=eBGIQ7ZuuiU]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out );
- $this->assertEquals( array( 0 => 'http://www.youtube.com/watch?v=eBGIQ7ZuuiU' ), $this->atts );
- $this->assertEquals( 'test-shortcode-tag', $this->tagname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out );
+ $this->assertSame( array( 0 => 'http://www.youtube.com/watch?v=eBGIQ7ZuuiU' ), $this->atts );
+ $this->assertSame( 'test-shortcode-tag', $this->tagname );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_positional_atts_quotes() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[test-shortcode-tag "something in quotes" "something else"]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out );
- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out );
+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 0 => 'something in quotes',
</span><span class="cx" style="display: block; padding: 0 10px"> 1 => 'something else',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -229,13 +229,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $this->atts
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test-shortcode-tag', $this->tagname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test-shortcode-tag', $this->tagname );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_positional_atts_mixed() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[test-shortcode-tag 123 https://wordpress.org/ 0 "foo" bar]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out );
- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out );
+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 0 => '123',
</span><span class="cx" style="display: block; padding: 0 10px"> 1 => 'https://wordpress.org/',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -245,13 +245,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $this->atts
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test-shortcode-tag', $this->tagname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test-shortcode-tag', $this->tagname );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_positional_and_named_atts() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[test-shortcode-tag 123 url=https://wordpress.org/ foo bar="baz"]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out );
- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out );
+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 0 => '123',
</span><span class="cx" style="display: block; padding: 0 10px"> 'url' => 'https://wordpress.org/',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -260,24 +260,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $this->atts
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test-shortcode-tag', $this->tagname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test-shortcode-tag', $this->tagname );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_footag_default() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[footag]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo = ', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo = ', $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_footag_val() {
</span><span class="cx" style="display: block; padding: 0 10px"> $val = rand_str();
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[footag foo="' . $val . '"]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo = ' . $val, $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo = ' . $val, $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_nested_tags() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[baztag][dumptag abc="foo" def=123 https://wordpress.org/][/baztag]' );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = "content = abc = foo\ndef = 123\n0 = https://wordpress.org\n";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -285,35 +285,35 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_tag_escaped() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[[footag]] [[bartag foo="bar"]]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '[footag] [bartag foo="bar"]', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '[footag] [bartag foo="bar"]', $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[[footag /]] [[bartag foo="bar" /]]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '[footag /] [bartag foo="bar" /]', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '[footag /] [bartag foo="bar" /]', $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[[baztag foo="bar"]the content[/baztag]]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '[baztag foo="bar"]the content[/baztag]', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '[baztag foo="bar"]the content[/baztag]', $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Double escaped.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[[[footag]]] [[[bartag foo="bar"]]]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '[[footag]] [[bartag foo="bar"]]', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '[[footag]] [[bartag foo="bar"]]', $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_tag_not_escaped() {
</span><span class="cx" style="display: block; padding: 0 10px"> // These have square brackets on either end but aren't actually escaped.
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[[footag] [bartag foo="bar"]]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '[foo = foo = bar]', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '[foo = foo = bar]', $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[[footag /] [bartag foo="bar" /]]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '[foo = foo = bar]', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '[foo = foo = bar]', $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[[baztag foo="bar"]the content[/baztag]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '[content = the content', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '[content = the content', $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[[not-a-tag]]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '[[not-a-tag]]', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '[[not-a-tag]]', $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[[[footag] [bartag foo="bar"]]]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '[[foo = foo = bar]]', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '[[foo = foo = bar]]', $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_mixed_tags() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -350,7 +350,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> EOF;
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( $in );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( strip_ws( $expected ), strip_ws( $out ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( strip_ws( $expected ), strip_ws( $out ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -359,7 +359,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_utf8_whitespace_1() {
</span><span class="cx" style="display: block; padding: 0 10px"> // NO-BREAK SPACE: U+00A0.
</span><span class="cx" style="display: block; padding: 0 10px"> do_shortcode( "[test-shortcode-tag foo=\"bar\" \xC2\xA0baz=\"123\"]" );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo' => 'bar',
</span><span class="cx" style="display: block; padding: 0 10px"> 'baz' => '123',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -366,7 +366,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $this->atts
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $this->content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $this->content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -375,7 +375,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_utf8_whitespace_2() {
</span><span class="cx" style="display: block; padding: 0 10px"> // ZERO WIDTH SPACE: U+200B.
</span><span class="cx" style="display: block; padding: 0 10px"> do_shortcode( "[test-shortcode-tag foo=\"bar\" \xE2\x80\x8Babc=\"def\"]" );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo' => 'bar',
</span><span class="cx" style="display: block; padding: 0 10px"> 'abc' => 'def',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -382,7 +382,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $this->atts
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $this->content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $this->content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -391,7 +391,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_shortcode_unautop() {
</span><span class="cx" style="display: block; padding: 0 10px"> // A blank line is added at the end, so test with it already there.
</span><span class="cx" style="display: block; padding: 0 10px"> $test_string = "[footag]\n";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $test_string, shortcode_unautop( wpautop( $test_string ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $test_string, shortcode_unautop( wpautop( $test_string ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_test_strip_shortcodes() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -418,7 +418,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $content Content to run strip_shortcodes() on.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_strip_shortcodes( $expected, $content ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, strip_shortcodes( $content ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, strip_shortcodes( $content ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -426,7 +426,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_strip_shortcodes_filter() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'strip_shortcodes_tagnames', array( $this, '_filter_strip_shortcodes_tagnames' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'beforemiddle [footag]after', strip_shortcodes( 'before[gallery]middle [footag]after' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'beforemiddle [footag]after', strip_shortcodes( 'before[gallery]middle [footag]after' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'strip_shortcodes_tagnames', array( $this, '_filter_strip_shortcodes_tagnames' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -462,7 +462,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'shortcode_atts_bartag', array( $this, '_filter_atts' ), 10, 3 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> do_shortcode( '[bartag foo="foo1" /]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo' => 'foo1',
</span><span class="cx" style="display: block; padding: 0 10px"> 'baz' => 'default baz',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -469,7 +469,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $this->filter_atts_out
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo' => 'no foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'baz' => 'default baz',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -476,7 +476,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $this->filter_atts_pairs
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'foo' => 'foo1' ), $this->filter_atts_atts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'foo' => 'foo1' ), $this->filter_atts_atts );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'shortcode_atts_bartag', array( $this, '_filter_atts' ), 10, 3 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -485,11 +485,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'shortcode_atts_bartag', array( $this, '_filter_atts2' ), 10, 3 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[bartag foo="foo1" baz="baz1" /]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'foo' => 'no foo' ), $this->filter_atts_out );
- $this->assertEquals( 'foo = no foo', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'foo' => 'no foo' ), $this->filter_atts_out );
+ $this->assertSame( 'foo = no foo', $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[bartag foo="foo2" /]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo = foo2', $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo = foo2', $out );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'shortcode_atts_bartag', array( $this, '_filter_atts2' ), 10, 3 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -512,7 +512,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $output = '[gallery ids="37,15,11"]';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $input as $in ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $output, shortcode_unautop( $in ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $output, shortcode_unautop( $in ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -522,7 +522,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_escaping
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_escaping( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, do_shortcode( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, do_shortcode( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_escaping() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -600,7 +600,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_escaping2
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_escaping2( $input, $output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->assertEquals( $output, strip_shortcodes( $input ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->assertSame( $output, strip_shortcodes( $input ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_escaping2() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -671,7 +671,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function sub_registration( $input, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px"> add_shortcode( $input, '' );
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = shortcode_exists( $input );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $test = $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $test = $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $actual ) {
</span><span class="cx" style="display: block; padding: 0 10px"> remove_shortcode( $input );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -765,7 +765,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_unnamed_attribute() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[dumptag=https://wordpress.org/]' );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = "0 = =https://wordpress.org\n";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -774,7 +774,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_smilies_arent_converted() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = apply_filters( 'the_content', '[img alt="Hello :-) World"]' );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = "<img alt=\"Hello :-) World\" />\n";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $out );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $out );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -924,7 +924,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_empty_single_quote_attribute() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( '[test-shortcode-tag a="foo" b=\'bar\' c=baz foo \'bar\' "baz" ]test empty atts[/test-shortcode-tag]' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'a' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px"> 'b' => 'bar',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -942,8 +942,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_positional_atts_single_quotes() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( "[test-shortcode-tag 'something in quotes' 'something else']" );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out );
- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out );
+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 0 => 'something in quotes',
</span><span class="cx" style="display: block; padding: 0 10px"> 1 => 'something else',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -950,7 +950,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $this->atts
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test-shortcode-tag', $this->tagname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test-shortcode-tag', $this->tagname );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -958,8 +958,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_positional_atts_mixed_quotes() {
</span><span class="cx" style="display: block; padding: 0 10px"> $out = do_shortcode( "[test-shortcode-tag 'something in quotes' \"something else\" 123 foo bar='baz' example=\"test\" ]" );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $out );
- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $out );
+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 0 => 'something in quotes',
</span><span class="cx" style="display: block; padding: 0 10px"> 1 => 'something else',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -970,6 +970,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> $this->atts
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test-shortcode-tag', $this->tagname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test-shortcode-tag', $this->tagname );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestssitemapsfunctionsphp"></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/sitemaps/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/functions.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/sitemaps/functions.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,9 +15,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_taxonomies = wp_sitemaps_get_max_urls( 'term' );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_users = wp_sitemaps_get_max_urls( 'user' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_posts, 300, 'Can not confirm max URL number for posts.' );
- $this->assertEquals( $expected_taxonomies, 50, 'Can not confirm max URL number for taxonomies.' );
- $this->assertEquals( $expected_users, 1, 'Can not confirm max URL number for users.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_posts, 300, 'Can not confirm max URL number for posts.' );
+ $this->assertSame( $expected_taxonomies, 50, 'Can not confirm max URL number for taxonomies.' );
+ $this->assertSame( $expected_users, 1, 'Can not confirm max URL number for users.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,7 +52,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'users' => 'WP_Sitemaps_Users',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array_keys( $expected ), array_keys( $sitemaps ), 'Unable to confirm default sitemap types are registered.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array_keys( $expected ), array_keys( $sitemaps ), 'Unable to confirm default sitemap types are registered.' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $expected as $name => $provider ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_a( $sitemaps[ $name ], $provider ), "Default $name sitemap is not a $provider object." );
</span></span></pre></div>
<a id="trunktestsphpunittestssitemapssitemapspostsphp"></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/sitemaps/sitemaps-posts.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/sitemaps-posts.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/sitemaps/sitemaps-posts.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,7 +24,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $post_list );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $post_list );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,7 +37,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'wp_sitemaps_post_types', '__return_empty_array' );
</span><span class="cx" style="display: block; padding: 0 10px"> $subtypes = $posts_provider->get_object_subtypes();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $subtypes, 'Could not filter posts subtypes.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $subtypes, 'Could not filter posts subtypes.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,7 +51,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $url_list = $posts_provider->get_url_list( 1, 'page' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $url_list );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $url_list );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'show_on_front', 'posts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestssitemapssitemapstaxonomiesphp"></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/sitemaps/sitemaps-taxonomies.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/sitemaps-taxonomies.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/sitemaps/sitemaps-taxonomies.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -114,7 +114,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Clean up.
</span><span class="cx" style="display: block; padding: 0 10px"> unregister_taxonomy_for_object_type( $taxonomy, 'post' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $post_list, 'Custom taxonomy term links are not visible.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $post_list, 'Custom taxonomy term links are not visible.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -216,6 +216,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'wp_sitemaps_taxonomies', '__return_empty_array' );
</span><span class="cx" style="display: block; padding: 0 10px"> $subtypes = $taxonomies_provider->get_object_subtypes();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $subtypes, 'Could not filter taxonomies subtypes.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $subtypes, 'Could not filter taxonomies subtypes.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestssitemapssitemapsphp"></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/sitemaps/sitemaps.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/sitemaps.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/sitemaps/sitemaps.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -224,7 +224,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = $this->_get_expected_url_list( 'post', self::$posts );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $post_list );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $post_list );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -240,7 +240,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = $this->_get_expected_url_list( 'page', self::$pages );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $post_list );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $post_list );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -261,7 +261,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $post_list );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $post_list );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -306,7 +306,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Clean up.
</span><span class="cx" style="display: block; padding: 0 10px"> unregister_post_type( $post_type );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $post_list, 'Custom post type posts are not visible.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $post_list, 'Custom post type posts are not visible.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -393,7 +393,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $sitemaps = wp_get_sitemap_providers();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $sitemaps['test_sitemap'], self::$test_provider, 'Can not confirm sitemap registration is working.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $sitemaps['test_sitemap'], self::$test_provider, 'Can not confirm sitemap registration is working.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunitteststaxonomyphp"></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/taxonomy.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/taxonomy.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/taxonomy.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,11 +5,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Taxonomy extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_post_taxonomies() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'category', 'post_tag', 'post_format' ), get_object_taxonomies( 'post' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'category', 'post_tag', 'post_format' ), get_object_taxonomies( 'post' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_link_taxonomies() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'link_category' ), get_object_taxonomies( 'link' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'link_category' ), get_object_taxonomies( 'link' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,10 +17,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_unknown_taxonomies() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Taxonomies for an unknown object type.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), get_object_taxonomies( rand_str() ) );
- $this->assertEquals( array(), get_object_taxonomies( '' ) );
- $this->assertEquals( array(), get_object_taxonomies( 0 ) );
- $this->assertEquals( array(), get_object_taxonomies( null ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), get_object_taxonomies( rand_str() ) );
+ $this->assertSame( array(), get_object_taxonomies( '' ) );
+ $this->assertSame( array(), get_object_taxonomies( 0 ) );
+ $this->assertSame( array(), get_object_taxonomies( null ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_post_taxonomy() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,7 +29,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Should return an object with the correct taxonomy object type.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_object( $tax ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_array( $tax->object_type ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'post' ), $tax->object_type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'post' ), $tax->object_type );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,7 +38,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $taxes = get_the_taxonomies( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $taxes );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'category' ), array_keys( $taxes ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'category' ), array_keys( $taxes ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $id = self::factory()->tag->create();
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_post_tags( $post_id, array( $id ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,7 +46,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $taxes = get_the_taxonomies( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $taxes );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $taxes );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'category', 'post_tag' ), array_keys( $taxes ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'category', 'post_tag' ), array_keys( $taxes ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,11 +56,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $taxes = get_the_taxonomies( $post_id, array( 'term_template' => '%2$s' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Categories: Uncategorized.', $taxes['category'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Categories: Uncategorized.', $taxes['category'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $taxes = get_the_taxonomies( $post_id, array( 'term_template' => '<span class="foo"><a href="%1$s">%2$s</a></span>' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $link = get_category_link( 1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Categories: <span class="foo"><a href="' . $link . '">Uncategorized</a></span>.', $taxes['category'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Categories: <span class="foo"><a href="' . $link . '">Uncategorized</a></span>.', $taxes['category'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_the_taxonomies() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,7 +90,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Categories: Uncategorized.', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Categories: Uncategorized.', $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = get_echo(
</span><span class="cx" style="display: block; padding: 0 10px"> 'the_taxonomies',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -102,7 +102,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $link = get_category_link( 1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Categories: <span class="foo"><a href="' . $link . '">Uncategorized</a></span>.', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Categories: <span class="foo"><a href="' . $link . '">Uncategorized</a></span>.', $output );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_link_taxonomy() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -111,7 +111,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Should return an object with the correct taxonomy object type.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_object( $tax ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_array( $tax->object_type ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'link' ), $tax->object_type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'link' ), $tax->object_type );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -285,11 +285,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_objects_in_term_should_return_invalid_taxonomy_error() {
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = get_objects_in_term( 1, 'invalid_taxonomy' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $terms );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_taxonomy', $terms->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_taxonomy', $terms->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_objects_in_term_should_return_empty_array() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), get_objects_in_term( 1, 'post_tag' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), get_objects_in_term( 1, 'post_tag' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_objects_in_term_should_return_objects_ids() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -429,7 +429,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'taxonomy' => 'category',
</span><span class="cx" style="display: block; padding: 0 10px"> 'cat_name' => 'Updated Name',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, wp_insert_category( $cat ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, wp_insert_category( $cat ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_insert_category_force_error_handle() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -447,7 +447,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'taxonomy' => 'force_error',
</span><span class="cx" style="display: block; padding: 0 10px"> 'cat_name' => 'Error',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, wp_insert_category( $cat, false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, wp_insert_category( $cat, false ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_ancestors_taxonomy_non_hierarchical() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -963,7 +963,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $terms_obj = get_the_terms( $updated_post_id, $taxonomy_name );
</span><span class="cx" style="display: block; padding: 0 10px"> $problematic_term = current( wp_list_pluck( $terms_obj, 'name' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $problematic_term, $term_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $problematic_term, $term_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunitteststemplatephp"></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/template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/template.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/template.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -231,7 +231,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_front_page_template_hierarchy_with_posts_on_front() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'posts', get_option( 'show_on_front' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'posts', get_option( 'show_on_front' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTemplateHierarchy(
</span><span class="cx" style="display: block; padding: 0 10px"> home_url(),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -461,7 +461,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( $url );
</span><span class="cx" style="display: block; padding: 0 10px"> $hierarchy = $this->get_template_hierarchy();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $hierarchy, $message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $hierarchy, $message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> protected static function get_query_template_conditions() {
</span></span></pre></div>
<a id="trunktestsphpunitteststermcachephp"></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/term/cache.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/cache.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term/cache.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -19,7 +19,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $term_id1_child = self::factory()->category->create( array( 'parent' => $term_id1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $hierarchy = _get_term_hierarchy( 'category' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $term_id1 => array( $term_id1_child ) ), $hierarchy );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $term_id1 => array( $term_id1_child ) ), $hierarchy );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add another Parent => Child.
</span><span class="cx" style="display: block; padding: 0 10px"> $term_id2 = self::factory()->category->create();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,7 +26,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $term_id2_child = self::factory()->category->create( array( 'parent' => $term_id2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $hierarchy = _get_term_hierarchy( 'category' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> $term_id1 => array( $term_id1_child ),
</span><span class="cx" style="display: block; padding: 0 10px"> $term_id2 => array( $term_id2_child ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,7 +45,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $cats1 = get_the_category( $post->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $term->name, reset( $cats1 )->name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $term->name, reset( $cats1 )->name );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_term( $term->term_id, 'category', array( 'name' => 'Bar' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $cats2 = get_the_category( $post->ID );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,11 +83,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = get_terms( $tax, array( 'hide_empty' => false ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $i, count( $terms ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $i, count( $terms ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $i > 1 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $hierarchy = _get_term_hierarchy( $tax );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $hierarchy );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $children, count( $hierarchy, COUNT_RECURSIVE ) - count( $hierarchy ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $children, count( $hierarchy, COUNT_RECURSIVE ) - count( $hierarchy ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 0 === ( $i % 3 ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,7 +125,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // No new queries should have fired.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $num_queries, $wpdb->num_queries );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $term_object, $term_object_2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $term_object, $term_object_2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_term_should_update_term_cache_when_passed_a_valid_term_identifier() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -257,16 +257,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term_by( 'slug', 'burrito', 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries++;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Taco', $term->name );
- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Taco', $term->name );
+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // This should now hit cache.
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term_by( 'slug', 'burrito', 'post_tag' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Taco', $term->name );
- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Taco', $term->name );
+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( get_term( $term_id, 'post_tag' ), $term );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -288,13 +288,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term_by( 'slug', 'burrito', 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries++;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Taco', $term->name );
- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Taco', $term->name );
+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // This should now hit cache.
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term_by( 'slug', 'burrito', 'post_tag' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Taco', $term->name );
- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Taco', $term->name );
+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update the tag which invalidates the cache.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_term( $term_id, 'post_tag', array( 'name' => 'No Taco' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -303,8 +303,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // This should not hit cache.
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term_by( 'slug', 'burrito', 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries++;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'No Taco', $term->name );
- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'No Taco', $term->name );
+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -326,14 +326,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> get_term_by( 'name', 'Burrito', 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries++;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // This should now hit cache.
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term_by( 'name', 'Burrito', 'post_tag' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( get_term( $term_id, 'post_tag' ), $term );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -355,11 +355,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> get_term_by( 'name', 'Burrito', 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries++;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // This should now hit cache.
</span><span class="cx" style="display: block; padding: 0 10px"> get_term_by( 'name', 'Burrito', 'post_tag' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Update the tag which invalidates the cache.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_term( $term_id, 'post_tag', array( 'slug' => 'taco' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -368,7 +368,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // This should not hit cache.
</span><span class="cx" style="display: block; padding: 0 10px"> get_term_by( 'name', 'burrito', 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries++;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -393,7 +393,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify the term is cached.
</span><span class="cx" style="display: block; padding: 0 10px"> $term2 = get_term_by( 'name', 'Burrito', 'post_tag' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $term1, $term2 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $suspend = wp_suspend_cache_invalidation();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -404,7 +404,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify that the cached term still matches the initial cached term.
</span><span class="cx" style="display: block; padding: 0 10px"> $term3 = get_term_by( 'name', 'Burrito', 'post_tag' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $term1, $term3 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify that last changed has not been updated as part of an invalidation routine.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -435,12 +435,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries++;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $term instanceof WP_Term );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $term_id, $term->term_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $term_meta = get_term_meta( $term_id, 'foo', true );
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries++;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $term_meta, 'bar' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunitteststermgetEditTermLinkphp"></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/term/getEditTermLink.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/getEditTermLink.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term/getEditTermLink.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = get_edit_term_link( $term1, 'wptests_tax' );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = 'http://' . WP_TESTS_DOMAIN . '/wp-admin/term.php?taxonomy=wptests_tax&tag_ID=' . $term1 . '&post_type=post';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunitteststermgetTermphp"></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/term/getTerm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/getTerm.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term/getTerm.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,11 +72,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_passing_term_string_that_casts_to_int_0_should_return_null() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( null, get_term( 'abc', 'wptests_tax' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( get_term( 'abc', 'wptests_tax' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_should_return_null_for_invalid_term_id() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( null, get_term( 99999999, 'wptests_tax' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( get_term( 99999999, 'wptests_tax' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_cache_should_be_populated_by_successful_fetch() {
</span></span></pre></div>
<a id="trunktestsphpunitteststermgetTermByphp"></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/term/getTermBy.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/getTermBy.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term/getTermBy.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -232,7 +232,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> get_term_by( 'name', 'burrito', 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'get_terms', array( $action, 'filter' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $action->get_call_count() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $action->get_call_count() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunitteststermgetTermParentsListphp"></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/term/getTermParentsList.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/getTermParentsList.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term/getTermParentsList.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,7 +34,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_should_return_empty_for_invalid_id() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_term_parents_list( 99999999, 'wptests_tax' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_term_parents_list( 99999999, 'wptests_tax' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_should_return_wp_error_for_invalid_taxonomy() {
</span></span></pre></div>
<a id="trunktestsphpunitteststermgetTermsphp"></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/term/getTerms.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/getTerms.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term/getTerms.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -115,18 +115,18 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // last_changed and num_queries should bump.
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = get_terms( 'post_tag', array( 'update_term_meta_cache' => false ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $terms ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $terms ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $time1 = wp_cache_get( 'last_changed', 'terms' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $time1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_queries + 1, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Again. last_changed and num_queries should remain the same.
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = get_terms( 'post_tag', array( 'update_term_meta_cache' => false ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $terms ) );
- $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'terms' ) );
- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $terms ) );
+ $this->assertSame( $time1, wp_cache_get( 'last_changed', 'terms' ) );
+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -144,17 +144,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // num_queries should bump, last_changed should remain the same.
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = get_terms( 'post_tag', array( 'number' => 2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $terms ) );
- $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'terms' ) );
- $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $terms ) );
+ $this->assertSame( $time1, wp_cache_get( 'last_changed', 'terms' ) );
+ $this->assertSame( $num_queries + 1, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Again. last_changed and num_queries should remain the same.
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = get_terms( 'post_tag', array( 'number' => 2 ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $terms ) );
- $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'terms' ) );
- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $terms ) );
+ $this->assertSame( $time1, wp_cache_get( 'last_changed', 'terms' ) );
+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -179,17 +179,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // last_changed and num_queries should bump after a term is deleted.
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = get_terms( 'post_tag' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $terms ) );
- $this->assertEquals( $time2, wp_cache_get( 'last_changed', 'terms' ) );
- $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $terms ) );
+ $this->assertSame( $time2, wp_cache_get( 'last_changed', 'terms' ) );
+ $this->assertSame( $num_queries + 1, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $num_queries = $wpdb->num_queries;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Again. last_changed and num_queries should remain the same.
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = get_terms( 'post_tag' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $terms ) );
- $this->assertEquals( $time2, wp_cache_get( 'last_changed', 'terms' ) );
- $this->assertEquals( $num_queries, $wpdb->num_queries );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $terms ) );
+ $this->assertSame( $time2, wp_cache_get( 'last_changed', 'terms' ) );
+ $this->assertSame( $num_queries, $wpdb->num_queries );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @todo Repeat with term insert and update.
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -200,7 +200,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_terms_should_allow_arbitrary_indexed_taxonomies_array() {
</span><span class="cx" style="display: block; padding: 0 10px"> $term_id = self::factory()->tag->create();
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = get_terms( array( '111' => 'post_tag' ), array( 'hide_empty' => false ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $term_id, reset( $terms )->term_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $term_id, reset( $terms )->term_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -300,7 +300,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'hide_empty' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $term_id1, $term_id2 ), wp_list_pluck( $inc_terms, 'term_id' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $term_id1, $term_id2 ), wp_list_pluck( $inc_terms, 'term_id' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $exc_terms = get_terms(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_tag',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -309,7 +309,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'hide_empty' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), wp_list_pluck( $exc_terms, 'term_id' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), wp_list_pluck( $exc_terms, 'term_id' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // These should not generate query errors.
</span><span class="cx" style="display: block; padding: 0 10px"> get_terms(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -363,7 +363,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $terms[1] ), wp_list_pluck( $found, 'term_id' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $terms[1] ), wp_list_pluck( $found, 'term_id' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_taxonomy( 'wptests_tax' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -388,7 +388,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'hide_empty' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $term_id1, $term_id11, $term_id2, $term_id22 ), $terms );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $term_id1, $term_id11, $term_id2, $term_id22 ), $terms );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = get_terms(
</span><span class="cx" style="display: block; padding: 0 10px"> 'category',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -399,7 +399,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $term_id2, $term_id22 ), $terms );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $term_id2, $term_id22 ), $terms );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -547,7 +547,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_post_terms( $id, $cheddar, $tax );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term( $cheddar, $tax );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $term->count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $term->count );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $brie = self::factory()->term->create(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -559,7 +559,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_post_terms( $post_id, $brie, $tax );
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term( $brie, $tax );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $term->count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $term->count );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $crackers = self::factory()->term->create(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -580,7 +580,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_post_terms( $id, $butter, $tax );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term( $butter, $tax );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $term->count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $term->count );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $multigrain = self::factory()->term->create(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -594,7 +594,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_post_terms( $id, $multigrain, $tax );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term( $multigrain, $tax );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $term->count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $term->count );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $fruit = self::factory()->term->create(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -617,8 +617,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'cache_domain' => $tax,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $terms ) );
- $this->assertEquals( wp_list_pluck( $terms, 'name' ), array( 'Cheese', 'Crackers' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $terms ) );
+ $this->assertSame( wp_list_pluck( $terms, 'name' ), array( 'Cheese', 'Crackers' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -651,7 +651,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_post_terms( $post_id, $spread, $tax );
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term( $spread, $tax );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $term->count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $term->count );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = get_terms(
</span><span class="cx" style="display: block; padding: 0 10px"> $tax,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -660,8 +660,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'cache_domain' => $tax,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $terms ) );
- $this->assertEquals( array( 'Cheese' ), wp_list_pluck( $terms, 'name' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $terms ) );
+ $this->assertSame( array( 'Cheese' ), wp_list_pluck( $terms, 'name' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_taxonomy( $tax );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -687,7 +687,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_post_terms( $post_id, $t[7], $tax );
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term( $t[7], $tax );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $term->count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $term->count );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = get_terms(
</span><span class="cx" style="display: block; padding: 0 10px"> $tax,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -696,8 +696,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'cache_domain' => $tax,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $terms ) );
- $this->assertEquals( array( 'term1' ), wp_list_pluck( $terms, 'name' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $terms ) );
+ $this->assertSame( array( 'term1' ), wp_list_pluck( $terms, 'name' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_taxonomy( $tax );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -716,7 +716,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'hide_empty' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $terms ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $terms ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -748,7 +748,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> $child => 'Test 1',
</span><span class="cx" style="display: block; padding: 0 10px"> $child2 => 'Test 2',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -787,7 +787,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> $child => 'test-1',
</span><span class="cx" style="display: block; padding: 0 10px"> $child2 => 'test-2',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -860,7 +860,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $term = wp_update_term( $term['term_id'], 'category', array( 'parent' => $term['term_id'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term( $term['term_id'], 'category' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $term->term_id, $term->parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $term->term_id, $term->parent );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', get_term_children( $term->term_id, 'category' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'wp_update_term_parent', 'wp_check_term_hierarchy_for_loops', 10, 3 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -917,7 +917,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $t1 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $t1 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -937,7 +937,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $t1, $t3 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $t1, $t3 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -956,7 +956,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $t1 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $t1 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1837,7 +1837,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_taxonomy( 'wptests_tax' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $t4, $t1, $t2 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $t4, $t1, $t2 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1883,7 +1883,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_taxonomy( 'wptests_tax' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $t2, $t1, $t4, $t3 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $t2, $t1, $t4, $t3 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1919,7 +1919,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $t1, $t2, $t3 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $t1, $t2, $t3 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2308,7 +2308,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify that there are no children.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $terms ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $terms ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2374,7 +2374,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify that there are no children.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $terms ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $terms ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_hierarchical_true_with_child_of_should_return_grandchildren() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2487,7 +2487,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // 'hierarchical=false' means that descendants are not fetched.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $terms ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $terms ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2626,11 +2626,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $found as $f ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $t1 === $f->term_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $f->count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $f->count );
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( $t2 === $f->term_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $f->count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $f->count );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $f->count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $f->count );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunitteststermgetTheTermsphp"></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/term/getTheTerms.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/getTheTerms.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term/getTheTerms.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,7 +22,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Cache should be empty after a set.
</span><span class="cx" style="display: block; padding: 0 10px"> $tt_1 = wp_set_object_terms( $post_id, $terms_1, $this->taxonomy );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $tt_1 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $tt_1 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wp_cache_get( $post_id, $this->taxonomy . '_relationships' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // wp_get_object_terms() does not prime the cache.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,7 +43,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Cache should be empty after a set.
</span><span class="cx" style="display: block; padding: 0 10px"> $tt_2 = wp_set_object_terms( $post_id, $terms_2, $this->taxonomy );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $tt_2 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $tt_2 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wp_cache_get( $post_id, $this->taxonomy . '_relationships' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,8 +62,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $tt_1 = wp_set_object_terms( $post_id, $tag_id, 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = get_the_terms( $post_id, 'post_tag' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $tag_id, $terms[0]->term_id );
- $this->assertEquals( 'My Amazing Tag', $terms[0]->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $tag_id, $terms[0]->term_id );
+ $this->assertSame( 'My Amazing Tag', $terms[0]->description );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_updated = wp_update_term(
</span><span class="cx" style="display: block; padding: 0 10px"> $tag_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,12 +74,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_new_term = get_term( $tag_id, 'post_tag' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $tag_id, $_new_term->term_id );
- $this->assertEquals( 'This description is even more amazing!', $_new_term->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $tag_id, $_new_term->term_id );
+ $this->assertSame( 'This description is even more amazing!', $_new_term->description );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = get_the_terms( $post_id, 'post_tag' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $tag_id, $terms[0]->term_id );
- $this->assertEquals( 'This description is even more amazing!', $terms[0]->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $tag_id, $terms[0]->term_id );
+ $this->assertSame( 'This description is even more amazing!', $terms[0]->description );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunitteststermmetaphp"></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/term/meta.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/meta.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term/meta.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -87,7 +87,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_term_meta( $t, 'foo', 'baz' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = get_term_meta( $t, 'foo', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bar', $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bar', $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_should_pass_to_add_when_no_value_exists_for_key() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -494,9 +494,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Reset global so subsequent data tests do not get polluted.
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['wp_meta_keys'] = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'term', $this->last_register_meta_call['object_type'] );
- $this->assertEquals( $meta_key, $this->last_register_meta_call['meta_key'] );
- $this->assertEquals( $args, $this->last_register_meta_call['args'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'term', $this->last_register_meta_call['object_type'] );
+ $this->assertSame( $meta_key, $this->last_register_meta_call['meta_key'] );
+ $this->assertSame( $args, $this->last_register_meta_call['args'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_register_term_meta() {
</span></span></pre></div>
<a id="trunktestsphpunitteststermqueryphp"></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/term/query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/query.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term/query.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -480,11 +480,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_object_terms( $post_id, array( $term_ids[0], $term_ids[1] ), 'wptests_tax' );
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = get_the_terms( $post_id, 'wptests_tax' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $term_ids[0], $term_ids[1] ), wp_list_pluck( $terms, 'term_id' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $term_ids[0], $term_ids[1] ), wp_list_pluck( $terms, 'term_id' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Flip the order.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_object_terms( $post_id, array( $term_ids[1], $term_ids[0] ), 'wptests_tax' );
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = get_the_terms( $post_id, 'wptests_tax' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $term_ids[1], $term_ids[0] ), wp_list_pluck( $terms, 'term_id' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $term_ids[1], $term_ids[0] ), wp_list_pluck( $terms, 'term_id' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -510,11 +510,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create();
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_object_terms( $post_id, array( $term_ids[0], $term_ids[1] ), 'wptests_tax' );
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = wp_get_object_terms( $post_id, array( 'category', 'wptests_tax' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $term_ids[0], $term_ids[1], 1 ), wp_list_pluck( $terms, 'term_id' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $term_ids[0], $term_ids[1], 1 ), wp_list_pluck( $terms, 'term_id' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Flip the order.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_object_terms( $post_id, array( $term_ids[1], $term_ids[0] ), 'wptests_tax' );
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = wp_get_object_terms( $post_id, array( 'category', 'wptests_tax' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $term_ids[1], $term_ids[0], 1 ), wp_list_pluck( $terms, 'term_id' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $term_ids[1], $term_ids[0], 1 ), wp_list_pluck( $terms, 'term_id' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunitteststermslashesphp"></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/term/slashes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/slashes.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term/slashes.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,8 +39,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term( $insert['term_id'], $taxonomy );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_1 ), $term->name );
- $this->assertEquals( wp_unslash( $this->slash_3 ), $term->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_1 ), $term->name );
+ $this->assertSame( wp_unslash( $this->slash_3 ), $term->description );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $insert = wp_insert_term(
</span><span class="cx" style="display: block; padding: 0 10px"> $this->slash_3,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,8 +51,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term( $insert['term_id'], $taxonomy );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_3 ), $term->name );
- $this->assertEquals( wp_unslash( $this->slash_5 ), $term->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_3 ), $term->name );
+ $this->assertSame( wp_unslash( $this->slash_5 ), $term->description );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $insert = wp_insert_term(
</span><span class="cx" style="display: block; padding: 0 10px"> $this->slash_2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,8 +63,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term( $insert['term_id'], $taxonomy );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_2 ), $term->name );
- $this->assertEquals( wp_unslash( $this->slash_4 ), $term->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_2 ), $term->name );
+ $this->assertSame( wp_unslash( $this->slash_4 ), $term->description );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -93,8 +93,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term( $id, $taxonomy );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_1 ), $term->name );
- $this->assertEquals( wp_unslash( $this->slash_3 ), $term->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_1 ), $term->name );
+ $this->assertSame( wp_unslash( $this->slash_3 ), $term->description );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $update = wp_update_term(
</span><span class="cx" style="display: block; padding: 0 10px"> $id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -105,8 +105,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term( $id, $taxonomy );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_3 ), $term->name );
- $this->assertEquals( wp_unslash( $this->slash_5 ), $term->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_3 ), $term->name );
+ $this->assertSame( wp_unslash( $this->slash_5 ), $term->description );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $update = wp_update_term(
</span><span class="cx" style="display: block; padding: 0 10px"> $id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,8 +117,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term( $id, $taxonomy );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_2 ), $term->name );
- $this->assertEquals( wp_unslash( $this->slash_4 ), $term->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_2 ), $term->name );
+ $this->assertSame( wp_unslash( $this->slash_4 ), $term->description );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunitteststermsplitSharedTermphp"></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/term/splitSharedTerm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/splitSharedTerm.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term/splitSharedTerm.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -100,7 +100,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->terms['t2_child']['term_taxonomy_id'], $children[0]->term_taxonomy_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->terms['t2_child']['term_taxonomy_id'], $children[0]->term_taxonomy_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -115,7 +115,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->terms['t2_child']['term_taxonomy_id'], $children[0]->term_taxonomy_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->terms['t2_child']['term_taxonomy_id'], $children[0]->term_taxonomy_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -156,7 +156,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_term_id = _split_shared_term( $t1['term_id'], $t3['term_taxonomy_id'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $t2_children = get_term_children( $t2['term_id'], 'wptests_tax_4' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $new_term_id ), $t2_children );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $new_term_id ), $t2_children );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -180,12 +180,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> array( '%d' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $t1['term_id'], get_option( 'default_category', -1 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $t1['term_id'], get_option( 'default_category', -1 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_term_id = _split_shared_term( $t1['term_id'], $t1['term_taxonomy_id'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( $new_term_id, $t1['term_id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_term_id, get_option( 'default_category', -1 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_term_id, get_option( 'default_category', -1 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -252,7 +252,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_term_id = _split_shared_term( $shared_term_id, $nav_term->term_taxonomy_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $locations = get_nav_menu_locations();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_term_id, $locations['foo'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_term_id, $locations['foo'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -301,7 +301,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'Updated Foo Menu', $menu->description );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $menu_items = wp_get_nav_menu_items( $new_nav_menu_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $cat_menu_item ), wp_list_pluck( $menu_items, 'ID' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $cat_menu_item ), wp_list_pluck( $menu_items, 'ID' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_get_split_terms() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -317,6 +317,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_get_split_term() {
</span><span class="cx" style="display: block; padding: 0 10px"> $found = wp_get_split_term( $this->terms['t1']['term_id'], 'wptests_tax_3' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->terms['t3']['term_id'], $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->terms['t3']['term_id'], $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunitteststermtaxQueryphp"></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/term/taxQuery.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/taxQuery.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term/taxQuery.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -94,7 +94,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'foo' ), $tq->queries[0]['terms'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'foo' ), $tq->queries[0]['terms'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -237,7 +237,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $tq->transform_query( $tq->queries[0], 'term_id' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $t1 ), $tq->queries[0]['terms'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $t1 ), $tq->queries[0]['terms'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'term_id', $tq->queries[0]['field'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunitteststermtermExistsphp"></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/term/termExists.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/termExists.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term/termExists.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,7 +150,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_taxonomy( 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( null, $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertNull( $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_term_exists_taxonomy_nonempty_parent_nonempty_match_name() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -273,8 +273,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_term_exists_unknown() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( term_exists( rand_str() ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, term_exists( 0 ) );
- $this->assertEquals( 0, term_exists( '' ) );
- $this->assertEquals( 0, term_exists( null ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, term_exists( 0 ) );
+ $this->assertNull( term_exists( '' ) );
+ $this->assertNull( term_exists( null ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunitteststermwpDeleteTermphp"></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/term/wpDeleteTerm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/wpDeleteTerm.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term/wpDeleteTerm.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,11 +28,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'delete_term', array( $this, 'catch_deleted_term' ), 10, 5 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_term( $terms[0], 'wptests_tax' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->deleted_term->count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->deleted_term->count );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $this->object_ids, array( "$post_id" ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_term( $terms[1], 'wptests_tax' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $this->deleted_term->count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $this->deleted_term->count );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $this->object_ids, array() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunitteststermwpGetObjectTermsphp"></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/term/wpGetObjectTerms.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/wpGetObjectTerms.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term/wpGetObjectTerms.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set the initial terms.
</span><span class="cx" style="display: block; padding: 0 10px"> $tt_1 = wp_set_object_terms( $post_id, $terms_1, $this->taxonomy );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $tt_1 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $tt_1 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure they're correct.
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = wp_get_object_terms(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,7 +31,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'orderby' => 'term_id',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $terms_1_slugs, $terms );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $terms_1_slugs, $terms );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,7 +47,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = wp_get_object_terms( array( $post_id1, $post_id2 ), 'category' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $terms );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $cat_id, $cat_id2 ), wp_list_pluck( $terms, 'term_id' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $cat_id, $cat_id2 ), wp_list_pluck( $terms, 'term_id' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $terms2 = wp_get_object_terms(
</span><span class="cx" style="display: block; padding: 0 10px"> array( $post_id1, $post_id2 ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -58,7 +58,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 3, $terms2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $cat_id, $cat_id, $cat_id2 ), wp_list_pluck( $terms2, 'term_id' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $cat_id, $cat_id, $cat_id2 ), wp_list_pluck( $terms2, 'term_id' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -149,7 +149,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $t1, $t3, $t2 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $t1, $t3, $t2 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_orderby_count() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -187,7 +187,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $t2, $t1, $t3 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $t2, $t1, $t3 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_orderby_slug() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -223,7 +223,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $t1, $t3, $t2 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $t1, $t3, $t2 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_orderby_term_group() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -262,7 +262,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $t1, $t3, $t2 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $t1, $t3, $t2 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_orderby_term_order() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -326,7 +326,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $t1, $t3, $t2 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $t1, $t3, $t2 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -371,7 +371,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $t1, $t3, $t2 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $t1, $t3, $t2 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -412,7 +412,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $t1, $t3, $t2 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $t1, $t3, $t2 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -458,7 +458,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $t1, $t3, $t2 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $t1, $t3, $t2 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_order_desc() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -495,7 +495,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $t2, $t3, $t1 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $t2, $t3, $t1 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -546,7 +546,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $t3 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $t3 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -927,7 +927,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $found = wp_get_object_terms( $p, $this->taxonomy, 'orderby=name&fields=ids' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $t1, $t3, $t2 ), $found );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $t1, $t3, $t2 ), $found );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -946,11 +946,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test directly.
</span><span class="cx" style="display: block; padding: 0 10px"> $get_object_terms = wp_get_object_terms( $post_id, $taxonomy, array( 'fields' => 'names' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $terms, $get_object_terms );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $terms, $get_object_terms );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test metabox taxonomy (admin advanced edit).
</span><span class="cx" style="display: block; padding: 0 10px"> $terms_to_edit = get_terms_to_edit( $post_id, $taxonomy );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( implode( ',', $terms ), $terms_to_edit );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( implode( ',', $terms ), $terms_to_edit );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function filter_wp_get_object_terms_args( $args, $object_ids, $taxonomies ) {
</span></span></pre></div>
<a id="trunktestsphpunitteststermwpInsertTermphp"></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/term/wpInsertTerm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/wpInsertTerm.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term/wpInsertTerm.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -211,7 +211,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $term7 = self::factory()->tag->create( array( 'name' => 'T$$$$' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $term7 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $term7->errors );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $term6, $term7->error_data['term_exists'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $term6, $term7->error_data['term_exists'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = array_map( 'get_tag', array( $term3, $term4, $term5, $term6 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 4, array_unique( wp_list_pluck( $terms, 'slug' ) ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -224,7 +224,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $term12 = self::factory()->tag->create( array( 'name' => '$$$$' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $term12 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $term12->errors );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $term11, $term12->error_data['term_exists'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $term11, $term12->error_data['term_exists'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = array_map( 'get_tag', array( $term8, $term9, $term10, $term11 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 4, array_unique( wp_list_pluck( $terms, 'slug' ) ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -817,8 +817,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_taxonomy( 'wptests_tax' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( false, wp_cache_get( 'all_ids', 'wptests_tax' ) );
- $this->assertSame( false, wp_cache_get( 'get', 'wptests_tax' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( wp_cache_get( 'all_ids', 'wptests_tax' ) );
+ $this->assertFalse( wp_cache_get( 'get', 'wptests_tax' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $cached_children = get_option( 'wptests_tax_children' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $cached_children[ $t ] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -904,8 +904,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'int', $term );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $object_ids );
</span><span class="cx" style="display: block; padding: 0 10px"> // Pesky string $this->assertInternalType( 'int', $tt_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $term, $deleted_term->term_id );
- $this->assertEquals( $taxonomy, $deleted_term->taxonomy );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $term, $deleted_term->term_id );
+ $this->assertSame( $taxonomy, $deleted_term->taxonomy );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $tt_id, $deleted_term->term_taxonomy_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $object_ids );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunitteststermwpSetObjectTermsphp"></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/term/wpSetObjectTerms.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/wpSetObjectTerms.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term/wpSetObjectTerms.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,19 +113,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $ids as $id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $tt = wp_set_object_terms( $id, array_values( $term_id ), $this->taxonomy );
</span><span class="cx" style="display: block; padding: 0 10px"> // Should return three term taxonomy IDs.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $tt ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $tt ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Each term should be associated with every post.
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $term_id as $term => $id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = get_objects_in_term( $id, $this->taxonomy );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $ids, array_map( 'intval', $actual ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $ids, array_map( 'intval', $actual ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Each term should have a count of 5.
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( array_keys( $term_id ) as $term ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $t = get_term_by( 'name', $term, $this->taxonomy );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 5, $t->count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 5, $t->count );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -141,7 +141,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $ids as $id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $tt = wp_set_object_terms( $id, $terms, $this->taxonomy );
</span><span class="cx" style="display: block; padding: 0 10px"> // Should return three term taxonomy IDs.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $tt ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $tt ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Remember which term has which term_id.
</span><span class="cx" style="display: block; padding: 0 10px"> for ( $i = 0; $i < 3; $i++ ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term_by( 'name', $terms[ $i ], $this->taxonomy );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -152,13 +152,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Each term should be associated with every post.
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $term_id as $term => $id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = get_objects_in_term( $id, $this->taxonomy );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $ids, array_map( 'intval', $actual ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $ids, array_map( 'intval', $actual ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Each term should have a count of 5.
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $terms as $term ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $t = get_term_by( 'name', $term, $this->taxonomy );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 5, $t->count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 5, $t->count );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -268,7 +268,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set the initial terms.
</span><span class="cx" style="display: block; padding: 0 10px"> $tt_1 = wp_set_object_terms( $post_id, $terms_1, $this->taxonomy );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $tt_1 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $tt_1 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure they're correct.
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = wp_get_object_terms(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -279,11 +279,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'orderby' => 'term_id',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $terms_1, $terms );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $terms_1, $terms );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Change the terms.
</span><span class="cx" style="display: block; padding: 0 10px"> $tt_2 = wp_set_object_terms( $post_id, $terms_2, $this->taxonomy );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $tt_2 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $tt_2 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure they're correct.
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = wp_get_object_terms(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -294,10 +294,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'orderby' => 'term_id',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $terms_2, $terms );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $terms_2, $terms );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the term taxonomy ID for 'bar' matches.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $tt_1[1], $tt_2[0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $tt_1[1], $tt_2[0] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -312,7 +312,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set the initial terms.
</span><span class="cx" style="display: block; padding: 0 10px"> $tt_1 = wp_set_object_terms( $post_id, $terms_1, $this->taxonomy );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $tt_1 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $tt_1 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure they're correct.
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = wp_get_object_terms(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -323,11 +323,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'orderby' => 'term_id',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $terms_1, $terms );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $terms_1, $terms );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Change the terms.
</span><span class="cx" style="display: block; padding: 0 10px"> $tt_2 = wp_set_object_terms( $post_id, $terms_2, $this->taxonomy );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $tt_2 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $tt_2 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure they're correct.
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = wp_get_object_terms(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -338,7 +338,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'orderby' => 'term_id',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $terms_2, $terms );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $terms_2, $terms );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the term taxonomy ID for 'bar' matches.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $tt_1[1], $tt_2[0] );
</span></span></pre></div>
<a id="trunktestsphpunitteststermwpUniqueTermSlugphp"></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/term/wpUniqueTermSlug.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/wpUniqueTermSlug.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term/wpUniqueTermSlug.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = wp_unique_term_slug( 'bar', $term );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bar', $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bar', $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_nonunique_slug_in_different_taxonomy_should_be_unchanged() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -42,7 +42,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $term2_object = get_term( $term2, 'wptests_tax1' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = wp_unique_term_slug( 'bar', $term2_object );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bar', $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bar', $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_nonunique_slug_in_same_nonhierarchical_taxonomy_should_be_changed() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,7 +64,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $term2_object = get_term( $term2, 'wptests_tax1' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = wp_unique_term_slug( 'bar', $term2_object );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bar-2', $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bar-2', $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_nonunique_slug_in_same_hierarchical_taxonomy_with_same_parent_should_be_suffixed_with_parent_slug() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -95,7 +95,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $term2_object = get_term( $term2, 'wptests_tax2' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = wp_unique_term_slug( 'bar', $term2_object );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bar-parent-term', $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bar-parent-term', $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_nonunique_slug_in_same_hierarchical_taxonomy_at_different_level_of_hierarchy_should_be_suffixed_with_number() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,7 +125,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $term2_object = get_term( $term2, 'wptests_tax2' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = wp_unique_term_slug( 'bar', $term2_object );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'bar-2', $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'bar-2', $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunitteststermwpUpdateTermphp"></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/term/wpUpdateTerm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/wpUpdateTerm.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term/wpUpdateTerm.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -115,7 +115,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'missing_parent', $found->get_error_code() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $term = get_term( $t, 'wptests_tax' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $term->parent );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $term->parent );
</ins><span class="cx" style="display: block; padding: 0 10px"> _unregister_taxonomy( 'wptests_tax' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -680,8 +680,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_taxonomy( 'wptests_tax' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( false, wp_cache_get( 'all_ids', 'wptests_tax' ) );
- $this->assertSame( false, wp_cache_get( 'get', 'wptests_tax' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( wp_cache_get( 'all_ids', 'wptests_tax' ) );
+ $this->assertFalse( wp_cache_get( 'get', 'wptests_tax' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $cached_children = get_option( 'wptests_tax_children' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $cached_children[ $t2 ] );
</span></span></pre></div>
<a id="trunktestsphpunitteststermphp"></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/term.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/term.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -101,19 +101,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $tags = self::factory()->tag->create_many( 5 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $tt = wp_add_object_terms( $posts[0], $tags[1], 'post_tag' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $tt ) );
- $this->assertEquals( array( $tags[1] ), wp_get_object_terms( $posts[0], 'post_tag', array( 'fields' => 'ids' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $tt ) );
+ $this->assertSame( array( $tags[1] ), wp_get_object_terms( $posts[0], 'post_tag', array( 'fields' => 'ids' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $three_tags = array( $tags[0], $tags[1], $tags[2] );
</span><span class="cx" style="display: block; padding: 0 10px"> $tt = wp_add_object_terms( $posts[1], $three_tags, 'post_tag' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $tt ) );
- $this->assertEquals( $three_tags, wp_get_object_terms( $posts[1], 'post_tag', array( 'fields' => 'ids' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $tt ) );
+ $this->assertSame( $three_tags, wp_get_object_terms( $posts[1], 'post_tag', array( 'fields' => 'ids' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( wp_remove_object_terms( $posts[0], $tags[1], 'post_tag' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wp_remove_object_terms( $posts[0], $tags[0], 'post_tag' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', wp_remove_object_terms( $posts[0], $tags[1], 'non_existing_taxonomy' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( wp_remove_object_terms( $posts[1], $three_tags, 'post_tag' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( wp_get_object_terms( $posts[1], 'post_tag' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( wp_get_object_terms( $posts[1], 'post_tag' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $tags as $term_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( wp_delete_term( $term_id, 'post_tag' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -177,7 +177,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $post->post_category );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $post->post_category ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $post->post_category ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( get_option( 'default_category' ), $post->post_category[0] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $term1 = wp_insert_term( 'Foo', 'category' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -185,26 +185,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $term3 = wp_insert_term( 'Baz', 'category' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_post_categories( $post_id, array( $term1['term_id'], $term2['term_id'] ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $post->post_category ) );
- $this->assertEquals( array( $term2['term_id'], $term1['term_id'] ), $post->post_category );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $post->post_category ) );
+ $this->assertSame( array( $term2['term_id'], $term1['term_id'] ), $post->post_category );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_post_categories( $post_id, $term3['term_id'], true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $term2['term_id'], $term3['term_id'], $term1['term_id'] ), $post->post_category );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $term2['term_id'], $term3['term_id'], $term1['term_id'] ), $post->post_category );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $term4 = wp_insert_term( 'Burrito', 'category' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_post_categories( $post_id, $term4['term_id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $term4['term_id'] ), $post->post_category );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $term4['term_id'] ), $post->post_category );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_post_categories( $post_id, array( $term1['term_id'], $term2['term_id'] ), true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $term2['term_id'], $term4['term_id'], $term1['term_id'] ), $post->post_category );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $term2['term_id'], $term4['term_id'], $term1['term_id'] ), $post->post_category );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_post_categories( $post_id, array(), true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $post->post_category ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $post->post_category ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( get_option( 'default_category' ), $post->post_category[0] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_post_categories( $post_id, array() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $post->post_category ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $post->post_category ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( get_option( 'default_category' ), $post->post_category[0] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -224,7 +224,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $term = wp_insert_term( 'Foo', 'category' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_post_categories( $post_id, $term['term_id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $term['term_id'], $post->post_category[0] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $term['term_id'], $post->post_category[0] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_post_categories( $post_id, array() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( get_option( 'default_category' ), $post->post_category[0] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -243,10 +243,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_sanitize_term_field() {
</span><span class="cx" style="display: block; padding: 0 10px"> $term = wp_insert_term( 'foo', $this->taxonomy );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, sanitize_term_field( 'parent', 0, $term['term_id'], $this->taxonomy, 'raw' ) );
- $this->assertEquals( 1, sanitize_term_field( 'parent', 1, $term['term_id'], $this->taxonomy, 'raw' ) );
- $this->assertEquals( 0, sanitize_term_field( 'parent', -1, $term['term_id'], $this->taxonomy, 'raw' ) );
- $this->assertEquals( 0, sanitize_term_field( 'parent', '', $term['term_id'], $this->taxonomy, 'raw' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, sanitize_term_field( 'parent', 0, $term['term_id'], $this->taxonomy, 'raw' ) );
+ $this->assertSame( 1, sanitize_term_field( 'parent', 1, $term['term_id'], $this->taxonomy, 'raw' ) );
+ $this->assertSame( 0, sanitize_term_field( 'parent', -1, $term['term_id'], $this->taxonomy, 'raw' ) );
+ $this->assertSame( 0, sanitize_term_field( 'parent', '', $term['term_id'], $this->taxonomy, 'raw' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunitteststhemeWPThemephp"></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/theme/WPTheme.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/theme/WPTheme.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/theme/WPTheme.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,19 +36,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $theme = new WP_Theme( 'theme1', $this->theme_root );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Meta.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'My Theme', $theme->get( 'Name' ) );
- $this->assertEquals( 'http://example.org/', $theme->get( 'ThemeURI' ) );
- $this->assertEquals( 'An example theme', $theme->get( 'Description' ) );
- $this->assertEquals( 'Minnie Bannister', $theme->get( 'Author' ) );
- $this->assertEquals( 'http://example.com/', $theme->get( 'AuthorURI' ) );
- $this->assertEquals( '1.3', $theme->get( 'Version' ) );
- $this->assertEquals( '', $theme->get( 'Template' ) );
- $this->assertEquals( 'publish', $theme->get( 'Status' ) );
- $this->assertEquals( array(), $theme->get( 'Tags' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'My Theme', $theme->get( 'Name' ) );
+ $this->assertSame( 'http://example.org/', $theme->get( 'ThemeURI' ) );
+ $this->assertSame( 'An example theme', $theme->get( 'Description' ) );
+ $this->assertSame( 'Minnie Bannister', $theme->get( 'Author' ) );
+ $this->assertSame( 'http://example.com/', $theme->get( 'AuthorURI' ) );
+ $this->assertSame( '1.3', $theme->get( 'Version' ) );
+ $this->assertSame( '', $theme->get( 'Template' ) );
+ $this->assertSame( 'publish', $theme->get( 'Status' ) );
+ $this->assertSame( array(), $theme->get( 'Tags' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Important.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'theme1', $theme->get_stylesheet() );
- $this->assertEquals( 'theme1', $theme->get_template() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'theme1', $theme->get_stylesheet() );
+ $this->assertSame( 'theme1', $theme->get_template() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_new_WP_Theme_subdir() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,19 +55,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $theme = new WP_Theme( 'subdir/theme2', $this->theme_root );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Meta.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'My Subdir Theme', $theme->get( 'Name' ) );
- $this->assertEquals( 'http://example.org/', $theme->get( 'ThemeURI' ) );
- $this->assertEquals( 'An example theme in a sub directory', $theme->get( 'Description' ) );
- $this->assertEquals( 'Mr. WordPress', $theme->get( 'Author' ) );
- $this->assertEquals( 'http://wordpress.org/', $theme->get( 'AuthorURI' ) );
- $this->assertEquals( '0.1', $theme->get( 'Version' ) );
- $this->assertEquals( '', $theme->get( 'Template' ) );
- $this->assertEquals( 'publish', $theme->get( 'Status' ) );
- $this->assertEquals( array(), $theme->get( 'Tags' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'My Subdir Theme', $theme->get( 'Name' ) );
+ $this->assertSame( 'http://example.org/', $theme->get( 'ThemeURI' ) );
+ $this->assertSame( 'An example theme in a sub directory', $theme->get( 'Description' ) );
+ $this->assertSame( 'Mr. WordPress', $theme->get( 'Author' ) );
+ $this->assertSame( 'http://wordpress.org/', $theme->get( 'AuthorURI' ) );
+ $this->assertSame( '0.1', $theme->get( 'Version' ) );
+ $this->assertSame( '', $theme->get( 'Template' ) );
+ $this->assertSame( 'publish', $theme->get( 'Status' ) );
+ $this->assertSame( array(), $theme->get( 'Tags' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Important.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'subdir/theme2', $theme->get_stylesheet() );
- $this->assertEquals( 'subdir/theme2', $theme->get_template() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'subdir/theme2', $theme->get_stylesheet() );
+ $this->assertSame( 'subdir/theme2', $theme->get_template() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,19 +78,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $theme = new WP_Theme( 'theme2', $this->theme_root . '/subdir' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Meta.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'My Subdir Theme', $theme->get( 'Name' ) );
- $this->assertEquals( 'http://example.org/', $theme->get( 'ThemeURI' ) );
- $this->assertEquals( 'An example theme in a sub directory', $theme->get( 'Description' ) );
- $this->assertEquals( 'Mr. WordPress', $theme->get( 'Author' ) );
- $this->assertEquals( 'http://wordpress.org/', $theme->get( 'AuthorURI' ) );
- $this->assertEquals( '0.1', $theme->get( 'Version' ) );
- $this->assertEquals( '', $theme->get( 'Template' ) );
- $this->assertEquals( 'publish', $theme->get( 'Status' ) );
- $this->assertEquals( array(), $theme->get( 'Tags' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'My Subdir Theme', $theme->get( 'Name' ) );
+ $this->assertSame( 'http://example.org/', $theme->get( 'ThemeURI' ) );
+ $this->assertSame( 'An example theme in a sub directory', $theme->get( 'Description' ) );
+ $this->assertSame( 'Mr. WordPress', $theme->get( 'Author' ) );
+ $this->assertSame( 'http://wordpress.org/', $theme->get( 'AuthorURI' ) );
+ $this->assertSame( '0.1', $theme->get( 'Version' ) );
+ $this->assertSame( '', $theme->get( 'Template' ) );
+ $this->assertSame( 'publish', $theme->get( 'Status' ) );
+ $this->assertSame( array(), $theme->get( 'Tags' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Important.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'subdir/theme2', $theme->get_stylesheet() );
- $this->assertEquals( 'subdir/theme2', $theme->get_template() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'subdir/theme2', $theme->get_stylesheet() );
+ $this->assertSame( 'subdir/theme2', $theme->get_template() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -99,15 +99,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_theme_uris_with_spaces() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme = new WP_Theme( 'theme with spaces', $this->theme_root . '/subdir' );
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure subdir/ is considered part of the stylesheet, as we must avoid encoding /'s.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'subdir/theme with spaces', $theme->get_stylesheet() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'subdir/theme with spaces', $theme->get_stylesheet() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that in a URI path, we have raw URL encoding (spaces become %20).
</span><span class="cx" style="display: block; padding: 0 10px"> // Don't try to verify the complete URI path. get_theme_root_uri() breaks down quickly.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'theme%20with%20spaces', basename( $theme->get_stylesheet_directory_uri() ) );
- $this->assertEquals( 'theme%20with%20spaces', basename( $theme->get_template_directory_uri() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'theme%20with%20spaces', basename( $theme->get_stylesheet_directory_uri() ) );
+ $this->assertSame( 'theme%20with%20spaces', basename( $theme->get_template_directory_uri() ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that wp_customize_url() uses URL encoding, as it is a query arg (spaces become +).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( admin_url( 'customize.php?theme=theme+with+spaces' ), wp_customize_url( 'theme with spaces' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( admin_url( 'customize.php?theme=theme+with+spaces' ), wp_customize_url( 'theme with spaces' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -118,8 +118,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'stylesheet', $callback );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'template', $callback );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_theme_root_uri() . '/subdir/theme%20with%20spaces', get_stylesheet_directory_uri() );
- $this->assertEquals( get_theme_root_uri() . '/subdir/theme%20with%20spaces', get_template_directory_uri() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_theme_root_uri() . '/subdir/theme%20with%20spaces', get_stylesheet_directory_uri() );
+ $this->assertSame( get_theme_root_uri() . '/subdir/theme%20with%20spaces', get_template_directory_uri() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'stylesheet', $callback );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'template', $callback );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -134,7 +134,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_display_method_on_get_method_failure() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme = new WP_Theme( 'nonexistent', $this->theme_root );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'nonexistent', $theme->get( 'Name' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'nonexistent', $theme->get( 'Name' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $theme->get( 'AuthorURI' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $theme->get( 'Tags' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $theme->display( 'Tags' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -147,7 +147,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $theme = new WP_Theme( 'child-parent-itself', $this->theme_root );
</span><span class="cx" style="display: block; padding: 0 10px"> $errors = $theme->errors();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $errors );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'theme_child_invalid', $errors->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'theme_child_invalid', $errors->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunitteststhemecustomHeaderphp"></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/theme/customHeader.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/theme/customHeader.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/theme/customHeader.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,7 +62,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $image = get_header_image();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( has_header_image() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $default, $image );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $default, $image );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_header_image_from_theme_mod() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,7 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> set_theme_mod( 'header_image', $custom );
</span><span class="cx" style="display: block; padding: 0 10px"> $image = get_header_image();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $custom, $image );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $custom, $image );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( has_header_image() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> set_theme_mod( 'header_image', 'remove-header' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -129,7 +129,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // The container should always be returned in the Customizer preview.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_set_customize_previewing( true );
</span><span class="cx" style="display: block; padding: 0 10px"> $html = get_custom_header_markup();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<div id="wp-custom-header" class="wp-custom-header"></div>', $html );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<div id="wp-custom-header" class="wp-custom-header"></div>', $html );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_custom_header_markup_with_registered_default_image() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -147,7 +147,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_header_video() );
</span><span class="cx" style="display: block; padding: 0 10px"> set_theme_mod( 'header_video', self::$header_video_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( has_header_video() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_get_attachment_url( self::$header_video_id ), get_header_video_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_get_attachment_url( self::$header_video_id ), get_header_video_url() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_external_header_video_url() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -157,7 +157,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_header_video() );
</span><span class="cx" style="display: block; padding: 0 10px"> set_theme_mod( 'external_header_video', $external );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( has_header_video() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $external, get_header_video_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $external, get_header_video_url() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_header_video_url_prefers_local_video() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -166,7 +166,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> set_theme_mod( 'header_video', self::$header_video_id );
</span><span class="cx" style="display: block; padding: 0 10px"> set_theme_mod( 'external_header_video', $external );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_get_attachment_url( self::$header_video_id ), get_header_video_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_get_attachment_url( self::$header_video_id ), get_header_video_url() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_custom_header_markup_with_video_and_without_an_image() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -182,7 +182,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $html = get_custom_header_markup();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( has_header_video() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( has_custom_header() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<div id="wp-custom-header" class="wp-custom-header"></div>', $html );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<div id="wp-custom-header" class="wp-custom-header"></div>', $html );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_header_script_is_not_enqueued_by_the_custom_header_markup_without_video() {
</span></span></pre></div>
<a id="trunktestsphpunitteststhemegetAllowedFiltersphp"></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/theme/getAllowedFilters.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/theme/getAllowedFilters.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/theme/getAllowedFilters.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,8 +21,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> WP_Theme::get_allowed( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'network_allowed_themes', array( $this, 'filter_network_allowed_themes' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $this->filter_network_allowed_themes_args ) );
- $this->assertEquals( $blog_id, $this->filter_network_allowed_themes_args[1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $this->filter_network_allowed_themes_args ) );
+ $this->assertSame( $blog_id, $this->filter_network_allowed_themes_args[1] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,7 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = $this->default_allowed + array( 'allow-on-network' => true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $allowed );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $allowed );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,7 +56,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = $this->default_allowed + array( 'network-allowed-theme' => true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $allowed );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $allowed );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -73,7 +73,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = $this->default_allowed + array( 'site-allowed-theme' => true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $allowed );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $allowed );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function filter_allowed_themes( $allowed_themes ) {
</span></span></pre></div>
<a id="trunktestsphpunitteststhemegetThemeStarterContentphp"></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/theme/getThemeStarterContent.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/theme/getThemeStarterContent.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/theme/getThemeStarterContent.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -148,14 +148,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $widget[1] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'title', $widget[1] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'text', $hydrated_starter_content['widgets']['sidebar-1'][1][0], 'Core content extended' );
- $this->assertEquals( 'Our Story', $hydrated_starter_content['widgets']['sidebar-1'][1][1]['title'], 'Core content extended' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'text', $hydrated_starter_content['widgets']['sidebar-1'][1][0], 'Core content extended' );
+ $this->assertSame( 'Our Story', $hydrated_starter_content['widgets']['sidebar-1'][1][1]['title'], 'Core content extended' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $hydrated_starter_content['nav_menus']['top']['items'] as $nav_menu_item ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $nav_menu_item );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( ! empty( $nav_menu_item['object_id'] ) || ! empty( $nav_menu_item['url'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Email Us', $hydrated_starter_content['nav_menus']['top']['items'][4]['title'], 'Core content extended' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Email Us', $hydrated_starter_content['nav_menus']['top']['items'][4]['title'], 'Core content extended' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $hydrated_starter_content['posts'] as $key => $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $key );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -164,9 +164,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'post_type', $post );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'post_title', $post );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Extended', $hydrated_starter_content['posts']['blog']['post_excerpt'], 'Core content extended' );
- $this->assertEquals( 'blog.php', $hydrated_starter_content['posts']['blog']['template'], 'Core content extended' );
- $this->assertEquals( '{{featured-image-logo}}', $hydrated_starter_content['posts']['custom']['thumbnail'], 'Core content extended' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Extended', $hydrated_starter_content['posts']['blog']['post_excerpt'], 'Core content extended' );
+ $this->assertSame( 'blog.php', $hydrated_starter_content['posts']['blog']['template'], 'Core content extended' );
+ $this->assertSame( '{{featured-image-logo}}', $hydrated_starter_content['posts']['custom']['thumbnail'], 'Core content extended' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -189,7 +189,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $starter_content = get_theme_starter_content();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 2, $starter_content['widgets']['sidebar-1'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Filtered Widget', $starter_content['widgets']['sidebar-1'][1][1]['title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Filtered Widget', $starter_content['widgets']['sidebar-1'][1][1]['title'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunitteststhemesupportphp"></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/theme/support.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/theme/support.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/theme/support.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,7 +25,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_theme_support( 'admin-bar', array( 'callback' => '__return_false' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( current_theme_supports( 'admin-bar' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 0 => array( 'callback' => '__return_false' ) ),
</span><span class="cx" style="display: block; padding: 0 10px"> get_theme_support( 'admin-bar' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -61,7 +61,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_theme_support( 'post-thumbnails', array( 'page' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( current_theme_supports( 'post-thumbnails', 'post' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( current_theme_supports( 'post-thumbnails', 'book' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 0 => array( 'post', 'page' ) ),
</span><span class="cx" style="display: block; padding: 0 10px"> get_theme_support( 'post-thumbnails' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span></span></pre></div>
<a id="trunktestsphpunitteststhemethemeDirphp"></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/theme/themeDir.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/theme/themeDir.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/theme/themeDir.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,28 +46,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_theme_default() {
</span><span class="cx" style="display: block; padding: 0 10px"> $themes = get_themes();
</span><span class="cx" style="display: block; padding: 0 10px"> $theme = get_theme( 'WordPress Default' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $themes['WordPress Default'], $theme );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $themes['WordPress Default'], $theme );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( empty( $theme ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // echo gen_tests_array( 'theme', $theme );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'WordPress Default', $theme['Name'] );
- $this->assertEquals( 'WordPress Default', $theme['Title'] );
- $this->assertEquals( 'The default WordPress theme based on the famous <a href="http://binarybonsai.com/kubrick/">Kubrick</a>.', $theme['Description'] );
- $this->assertEquals( '<a href="http://binarybonsai.com/">Michael Heilemann</a>', $theme['Author'] );
- $this->assertEquals( '1.6', $theme['Version'] );
- $this->assertEquals( 'default', $theme['Template'] );
- $this->assertEquals( 'default', $theme['Stylesheet'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'WordPress Default', $theme['Name'] );
+ $this->assertSame( 'WordPress Default', $theme['Title'] );
+ $this->assertSame( 'The default WordPress theme based on the famous <a href="http://binarybonsai.com/kubrick/">Kubrick</a>.', $theme['Description'] );
+ $this->assertSame( '<a href="http://binarybonsai.com/">Michael Heilemann</a>', $theme['Author'] );
+ $this->assertSame( '1.6', $theme['Version'] );
+ $this->assertSame( 'default', $theme['Template'] );
+ $this->assertSame( 'default', $theme['Stylesheet'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $this->theme_root . '/default/functions.php', $theme['Template Files'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $this->theme_root . '/default/index.php', $theme['Template Files'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $this->theme_root . '/default/style.css', $theme['Stylesheet Files'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->theme_root . '/default', $theme['Template Dir'] );
- $this->assertEquals( $this->theme_root . '/default', $theme['Stylesheet Dir'] );
- $this->assertEquals( 'publish', $theme['Status'] );
- $this->assertEquals( '', $theme['Parent Theme'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->theme_root . '/default', $theme['Template Dir'] );
+ $this->assertSame( $this->theme_root . '/default', $theme['Stylesheet Dir'] );
+ $this->assertSame( 'publish', $theme['Status'] );
+ $this->assertSame( '', $theme['Parent Theme'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,27 +81,27 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // echo gen_tests_array( 'theme', $theme );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Sandbox', $theme['Name'] );
- $this->assertEquals( 'Sandbox', $theme['Title'] );
- $this->assertEquals( 'A theme with powerful, semantic CSS selectors and the ability to add new skins.', $theme['Description'] );
- $this->assertEquals( '<a href="http://andy.wordpress.com/">Andy Skelton</a> & <a href="http://www.plaintxt.org/">Scott Allan Wallick</a>', $theme['Author'] );
- $this->assertEquals( '0.6.1-wpcom', $theme['Version'] );
- $this->assertEquals( 'sandbox', $theme['Template'] );
- $this->assertEquals( 'sandbox', $theme['Stylesheet'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Sandbox', $theme['Name'] );
+ $this->assertSame( 'Sandbox', $theme['Title'] );
+ $this->assertSame( 'A theme with powerful, semantic CSS selectors and the ability to add new skins.', $theme['Description'] );
+ $this->assertSame( '<a href="http://andy.wordpress.com/">Andy Skelton</a> & <a href="http://www.plaintxt.org/">Scott Allan Wallick</a>', $theme['Author'] );
+ $this->assertSame( '0.6.1-wpcom', $theme['Version'] );
+ $this->assertSame( 'sandbox', $theme['Template'] );
+ $this->assertSame( 'sandbox', $theme['Stylesheet'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $template_files = $theme['Template Files'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->theme_root . '/sandbox/functions.php', reset( $template_files ) );
- $this->assertEquals( $this->theme_root . '/sandbox/index.php', next( $template_files ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->theme_root . '/sandbox/functions.php', reset( $template_files ) );
+ $this->assertSame( $this->theme_root . '/sandbox/index.php', next( $template_files ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $stylesheet_files = $theme['Stylesheet Files'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->theme_root . '/sandbox/style.css', reset( $stylesheet_files ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->theme_root . '/sandbox/style.css', reset( $stylesheet_files ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->theme_root . '/sandbox', $theme['Template Dir'] );
- $this->assertEquals( $this->theme_root . '/sandbox', $theme['Stylesheet Dir'] );
- $this->assertEquals( 'publish', $theme['Status'] );
- $this->assertEquals( '', $theme['Parent Theme'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->theme_root . '/sandbox', $theme['Template Dir'] );
+ $this->assertSame( $this->theme_root . '/sandbox', $theme['Stylesheet Dir'] );
+ $this->assertSame( 'publish', $theme['Status'] );
+ $this->assertSame( '', $theme['Parent Theme'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -118,22 +118,22 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // echo gen_tests_array( 'theme', $theme );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Stylesheet Only', $theme['Name'] );
- $this->assertEquals( 'Stylesheet Only', $theme['Title'] );
- $this->assertEquals( 'A three-column widget-ready theme in dark blue.', $theme['Description'] );
- $this->assertEquals( '<a href="http://www.example.com/">Henry Crun</a>', $theme['Author'] );
- $this->assertEquals( '1.0', $theme['Version'] );
- $this->assertEquals( 'sandbox', $theme['Template'] );
- $this->assertEquals( 'stylesheetonly', $theme['Stylesheet'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Stylesheet Only', $theme['Name'] );
+ $this->assertSame( 'Stylesheet Only', $theme['Title'] );
+ $this->assertSame( 'A three-column widget-ready theme in dark blue.', $theme['Description'] );
+ $this->assertSame( '<a href="http://www.example.com/">Henry Crun</a>', $theme['Author'] );
+ $this->assertSame( '1.0', $theme['Version'] );
+ $this->assertSame( 'sandbox', $theme['Template'] );
+ $this->assertSame( 'stylesheetonly', $theme['Stylesheet'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $this->theme_root . '/sandbox/functions.php', $theme['Template Files'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $this->theme_root . '/sandbox/index.php', $theme['Template Files'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $this->theme_root . '/stylesheetonly/style.css', $theme['Stylesheet Files'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->theme_root . '/sandbox', $theme['Template Dir'] );
- $this->assertEquals( $this->theme_root . '/stylesheetonly', $theme['Stylesheet Dir'] );
- $this->assertEquals( 'publish', $theme['Status'] );
- $this->assertEquals( 'Sandbox', $theme['Parent Theme'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->theme_root . '/sandbox', $theme['Template Dir'] );
+ $this->assertSame( $this->theme_root . '/stylesheetonly', $theme['Stylesheet Dir'] );
+ $this->assertSame( 'publish', $theme['Status'] );
+ $this->assertSame( 'Sandbox', $theme['Parent Theme'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -169,7 +169,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $theme_names );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $expected );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $theme_names );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $theme_names );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -192,7 +192,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, get_broken_themes() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, get_broken_themes() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_get_theme_with_non_default_theme_root() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -219,17 +219,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_theme_data_top_level() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_data = get_theme_data( DIR_TESTDATA . '/themedir1/theme1/style.css' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'My Theme', $theme_data['Name'] );
- $this->assertEquals( 'http://example.org/', $theme_data['URI'] );
- $this->assertEquals( 'An example theme', $theme_data['Description'] );
- $this->assertEquals( '<a href="http://example.com/">Minnie Bannister</a>', $theme_data['Author'] );
- $this->assertEquals( 'http://example.com/', $theme_data['AuthorURI'] );
- $this->assertEquals( '1.3', $theme_data['Version'] );
- $this->assertEquals( '', $theme_data['Template'] );
- $this->assertEquals( 'publish', $theme_data['Status'] );
- $this->assertEquals( array(), $theme_data['Tags'] );
- $this->assertEquals( 'My Theme', $theme_data['Title'] );
- $this->assertEquals( 'Minnie Bannister', $theme_data['AuthorName'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'My Theme', $theme_data['Name'] );
+ $this->assertSame( 'http://example.org/', $theme_data['URI'] );
+ $this->assertSame( 'An example theme', $theme_data['Description'] );
+ $this->assertSame( '<a href="http://example.com/">Minnie Bannister</a>', $theme_data['Author'] );
+ $this->assertSame( 'http://example.com/', $theme_data['AuthorURI'] );
+ $this->assertSame( '1.3', $theme_data['Version'] );
+ $this->assertSame( '', $theme_data['Template'] );
+ $this->assertSame( 'publish', $theme_data['Status'] );
+ $this->assertSame( array(), $theme_data['Tags'] );
+ $this->assertSame( 'My Theme', $theme_data['Title'] );
+ $this->assertSame( 'Minnie Bannister', $theme_data['AuthorName'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -238,17 +238,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_theme_data_subdir() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_data = get_theme_data( $this->theme_root . '/subdir/theme2/style.css' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'My Subdir Theme', $theme_data['Name'] );
- $this->assertEquals( 'http://example.org/', $theme_data['URI'] );
- $this->assertEquals( 'An example theme in a sub directory', $theme_data['Description'] );
- $this->assertEquals( '<a href="http://wordpress.org/">Mr. WordPress</a>', $theme_data['Author'] );
- $this->assertEquals( 'http://wordpress.org/', $theme_data['AuthorURI'] );
- $this->assertEquals( '0.1', $theme_data['Version'] );
- $this->assertEquals( '', $theme_data['Template'] );
- $this->assertEquals( 'publish', $theme_data['Status'] );
- $this->assertEquals( array(), $theme_data['Tags'] );
- $this->assertEquals( 'My Subdir Theme', $theme_data['Title'] );
- $this->assertEquals( 'Mr. WordPress', $theme_data['AuthorName'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'My Subdir Theme', $theme_data['Name'] );
+ $this->assertSame( 'http://example.org/', $theme_data['URI'] );
+ $this->assertSame( 'An example theme in a sub directory', $theme_data['Description'] );
+ $this->assertSame( '<a href="http://wordpress.org/">Mr. WordPress</a>', $theme_data['Author'] );
+ $this->assertSame( 'http://wordpress.org/', $theme_data['AuthorURI'] );
+ $this->assertSame( '0.1', $theme_data['Version'] );
+ $this->assertSame( '', $theme_data['Template'] );
+ $this->assertSame( 'publish', $theme_data['Status'] );
+ $this->assertSame( array(), $theme_data['Tags'] );
+ $this->assertSame( 'My Subdir Theme', $theme_data['Title'] );
+ $this->assertSame( 'Mr. WordPress', $theme_data['AuthorName'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunitteststhemephp"></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/theme.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/theme.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/theme.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,10 +49,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_get_themes_default() {
</span><span class="cx" style="display: block; padding: 0 10px"> $themes = wp_get_themes();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Theme', $themes[ $this->theme_slug ] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->theme_name, $themes[ $this->theme_slug ]->get( 'Name' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->theme_name, $themes[ $this->theme_slug ]->get( 'Name' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $single_theme = wp_get_theme( $this->theme_slug );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $single_theme->get( 'Name' ), $themes[ $this->theme_slug ]->get( 'Name' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $single_theme->get( 'Name' ), $themes[ $this->theme_slug ]->get( 'Name' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $themes[ $this->theme_slug ], $single_theme );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,11 +63,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_themes_default() {
</span><span class="cx" style="display: block; padding: 0 10px"> $themes = get_themes();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Theme', $themes[ $this->theme_name ] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $themes[ $this->theme_name ], get_theme( $this->theme_name ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $themes[ $this->theme_name ], get_theme( $this->theme_name ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->theme_name, $themes[ $this->theme_name ]['Name'] );
- $this->assertEquals( $this->theme_name, $themes[ $this->theme_name ]->Name );
- $this->assertEquals( $this->theme_name, $themes[ $this->theme_name ]->name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->theme_name, $themes[ $this->theme_name ]['Name'] );
+ $this->assertSame( $this->theme_name, $themes[ $this->theme_name ]->Name );
+ $this->assertSame( $this->theme_name, $themes[ $this->theme_name ]->name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,7 +81,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // WP_Theme implements ArrayAccess. Even ArrayObject returns false for is_array().
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( is_array( $theme ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Theme', $theme );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $theme, $themes[ $name ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $theme, $themes[ $name ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,7 +92,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $theme->errors() );
</span><span class="cx" style="display: block; padding: 0 10px"> $_theme = wp_get_theme( $theme->get_stylesheet() );
</span><span class="cx" style="display: block; padding: 0 10px"> // This primes internal WP_Theme caches for the next assertion (headers_sanitized, textdomain_loaded).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $theme->get( 'Name' ), $_theme->get( 'Name' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $theme->get( 'Name' ), $_theme->get( 'Name' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $theme, $_theme );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -109,7 +109,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $theme['Name'], $k );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $theme['Name'], $k );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $theme['Title'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Important attributes should all be set.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -162,7 +162,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_dir( $dir . $theme['Template Dir'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_dir( $dir . $theme['Stylesheet Dir'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'publish', $theme['Status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'publish', $theme['Status'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_file( $dir . $theme['Stylesheet Dir'] . '/' . $theme['Screenshot'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_readable( $dir . $theme['Stylesheet Dir'] . '/' . $theme['Screenshot'] ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -172,21 +172,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_get_theme_contents() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme = wp_get_theme( $this->theme_slug );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->theme_name, $theme->get( 'Name' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->theme_name, $theme->get( 'Name' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $theme->get( 'Description' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $theme->get( 'Author' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $theme->get( 'Version' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $theme->get( 'AuthorURI' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $theme->get( 'ThemeURI' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->theme_slug, $theme->get_stylesheet() );
- $this->assertEquals( $this->theme_slug, $theme->get_template() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->theme_slug, $theme->get_stylesheet() );
+ $this->assertSame( $this->theme_slug, $theme->get_template() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'publish', $theme->get( 'Status' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'publish', $theme->get( 'Status' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( WP_CONTENT_DIR . '/themes/' . $this->theme_slug, $theme->get_stylesheet_directory(), 'get_stylesheet_directory' );
- $this->assertEquals( WP_CONTENT_DIR . '/themes/' . $this->theme_slug, $theme->get_template_directory(), 'get_template_directory' );
- $this->assertEquals( content_url( 'themes/' . $this->theme_slug ), $theme->get_stylesheet_directory_uri(), 'get_stylesheet_directory_uri' );
- $this->assertEquals( content_url( 'themes/' . $this->theme_slug ), $theme->get_template_directory_uri(), 'get_template_directory_uri' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( WP_CONTENT_DIR . '/themes/' . $this->theme_slug, $theme->get_stylesheet_directory(), 'get_stylesheet_directory' );
+ $this->assertSame( WP_CONTENT_DIR . '/themes/' . $this->theme_slug, $theme->get_template_directory(), 'get_template_directory' );
+ $this->assertSame( content_url( 'themes/' . $this->theme_slug ), $theme->get_stylesheet_directory_uri(), 'get_stylesheet_directory_uri' );
+ $this->assertSame( content_url( 'themes/' . $this->theme_slug ), $theme->get_template_directory_uri(), 'get_template_directory_uri' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -205,7 +205,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_default_themes_have_textdomain() {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $this->default_themes as $theme ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( wp_get_theme( $theme )->exists() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $theme, wp_get_theme( $theme )->get( 'TextDomain' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $theme, wp_get_theme( $theme )->get( 'TextDomain' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -227,12 +227,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> preg_match( '#Copyright (\d+) WordPress.org#', $readme, $matches );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $matches ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this_year, trim( $matches[1] ), "Bundled themes readme.txt's year needs to be updated to $this_year." );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this_year, trim( $matches[1] ), "Bundled themes readme.txt's year needs to be updated to $this_year." );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> preg_match( '#Copyright 20\d\d-(\d+) WordPress.org#', $readme, $matches );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $matches ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this_year, trim( $matches[1] ), "Bundled themes readme.txt's year needs to be updated to $this_year." );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this_year, trim( $matches[1] ), "Bundled themes readme.txt's year needs to be updated to $this_year." );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -277,11 +277,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> switch_theme( $theme['Stylesheet'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $name, get_current_theme() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $name, get_current_theme() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the various get_* functions return the correct values.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $theme['Template'], get_template() );
- $this->assertEquals( $theme['Stylesheet'], get_stylesheet() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $theme['Template'], get_template() );
+ $this->assertSame( $theme['Stylesheet'], get_stylesheet() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $root_fs = get_theme_root();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_dir( $root_fs ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -289,18 +289,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $root_uri = get_theme_root_uri();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( ! empty( $root_uri ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $root_fs . '/' . get_stylesheet(), get_stylesheet_directory() );
- $this->assertEquals( $root_uri . '/' . get_stylesheet(), get_stylesheet_directory_uri() );
- $this->assertEquals( $root_uri . '/' . get_stylesheet() . '/style.css', get_stylesheet_uri() );
- // $this->assertEquals( $root_uri . '/' . get_stylesheet(), get_locale_stylesheet_uri() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $root_fs . '/' . get_stylesheet(), get_stylesheet_directory() );
+ $this->assertSame( $root_uri . '/' . get_stylesheet(), get_stylesheet_directory_uri() );
+ $this->assertSame( $root_uri . '/' . get_stylesheet() . '/style.css', get_stylesheet_uri() );
+ // $this->assertSame( $root_uri . '/' . get_stylesheet(), get_locale_stylesheet_uri() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $root_fs . '/' . get_template(), get_template_directory() );
- $this->assertEquals( $root_uri . '/' . get_template(), get_template_directory_uri() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $root_fs . '/' . get_template(), get_template_directory() );
+ $this->assertSame( $root_uri . '/' . get_template(), get_template_directory_uri() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // get_query_template()
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Template file that doesn't exist.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_query_template( rand_str() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_query_template( rand_str() ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Template files that do exist.
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -307,24 +307,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $theme['Template Files'] as $path ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $file = basename($path, '.php');
</span><span class="cx" style="display: block; padding: 0 10px"> FIXME: untestable because get_query_template() uses TEMPLATEPATH.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals('', get_query_template($file));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame('', get_query_template($file));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // These are kind of tautologies but at least exercise the code.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_404_template(), get_query_template( '404' ) );
- $this->assertEquals( get_archive_template(), get_query_template( 'archive' ) );
- $this->assertEquals( get_author_template(), get_query_template( 'author' ) );
- $this->assertEquals( get_category_template(), get_query_template( 'category' ) );
- $this->assertEquals( get_date_template(), get_query_template( 'date' ) );
- $this->assertEquals( get_home_template(), get_query_template( 'home', array( 'home.php', 'index.php' ) ) );
- $this->assertEquals( get_privacy_policy_template(), get_query_template( 'privacy_policy', array( 'privacy-policy.php' ) ) );
- $this->assertEquals( get_page_template(), get_query_template( 'page' ) );
- $this->assertEquals( get_search_template(), get_query_template( 'search' ) );
- $this->assertEquals( get_single_template(), get_query_template( 'single' ) );
- $this->assertEquals( get_attachment_template(), get_query_template( 'attachment' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_404_template(), get_query_template( '404' ) );
+ $this->assertSame( get_archive_template(), get_query_template( 'archive' ) );
+ $this->assertSame( get_author_template(), get_query_template( 'author' ) );
+ $this->assertSame( get_category_template(), get_query_template( 'category' ) );
+ $this->assertSame( get_date_template(), get_query_template( 'date' ) );
+ $this->assertSame( get_home_template(), get_query_template( 'home', array( 'home.php', 'index.php' ) ) );
+ $this->assertSame( get_privacy_policy_template(), get_query_template( 'privacy_policy', array( 'privacy-policy.php' ) ) );
+ $this->assertSame( get_page_template(), get_query_template( 'page' ) );
+ $this->assertSame( get_search_template(), get_query_template( 'search' ) );
+ $this->assertSame( get_single_template(), get_query_template( 'single' ) );
+ $this->assertSame( get_attachment_template(), get_query_template( 'attachment' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_tag_template(), get_query_template( 'tag' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_tag_template(), get_query_template( 'tag' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // nb: This probably doesn't run because WP_INSTALLING is defined.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( validate_current_theme() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -340,13 +340,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'stylesheet', $style );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $theme = wp_get_theme();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $style, (string) $theme );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $style, (string) $theme );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotFalse( $theme->errors() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $theme->exists() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // These return the bogus name - perhaps not ideal behaviour?
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $template, get_template() );
- $this->assertEquals( $style, get_stylesheet() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $template, get_template() );
+ $this->assertSame( $style, get_stylesheet() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -379,10 +379,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'data' => $data,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_post( $wp_customize->changeset_post_id() )->post_date, get_post( $nav_created_post_ids[0] )->post_date );
- $this->assertEquals( get_post( $wp_customize->changeset_post_id() )->post_date, get_post( $nav_created_post_ids[1] )->post_date );
- $this->assertEquals( 'auto-draft', get_post_status( $nav_created_post_ids[0] ) );
- $this->assertEquals( 'auto-draft', get_post_status( $nav_created_post_ids[1] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_post( $wp_customize->changeset_post_id() )->post_date, get_post( $nav_created_post_ids[0] )->post_date );
+ $this->assertSame( get_post( $wp_customize->changeset_post_id() )->post_date, get_post( $nav_created_post_ids[1] )->post_date );
+ $this->assertSame( 'auto-draft', get_post_status( $nav_created_post_ids[0] ) );
+ $this->assertSame( 'auto-draft', get_post_status( $nav_created_post_ids[1] ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Stubs transition to drafts when changeset is saved as a draft.
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize->save_changeset_post(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -391,8 +391,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'data' => $data,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'draft', get_post_status( $nav_created_post_ids[0] ) );
- $this->assertEquals( 'draft', get_post_status( $nav_created_post_ids[1] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'draft', get_post_status( $nav_created_post_ids[0] ) );
+ $this->assertSame( 'draft', get_post_status( $nav_created_post_ids[1] ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Status remains unchanged for stub that the user broke out of the changeset.
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_post(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -407,13 +407,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'data' => $data,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'draft', get_post_status( $nav_created_post_ids[0] ) );
- $this->assertEquals( 'private', get_post_status( $nav_created_post_ids[1] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'draft', get_post_status( $nav_created_post_ids[0] ) );
+ $this->assertSame( 'private', get_post_status( $nav_created_post_ids[1] ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Draft stub is trashed when the changeset is trashed.
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_customize->trash_changeset_post( $wp_customize->changeset_post_id() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'trash', get_post_status( $nav_created_post_ids[0] ) );
- $this->assertEquals( 'private', get_post_status( $nav_created_post_ids[1] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'trash', get_post_status( $nav_created_post_ids[0] ) );
+ $this->assertSame( 'private', get_post_status( $nav_created_post_ids[1] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -452,10 +452,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> register_theme_feature( 'test-feature', $args );
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = get_registered_theme_feature( 'test-feature' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'array', $actual['type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'array', $actual['type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $actual['variadic'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'My Feature', $actual['description'] );
- $this->assertEquals( array( 'type' => 'string' ), $actual['show_in_rest']['schema']['items'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'My Feature', $actual['description'] );
+ $this->assertSame( array( 'type' => 'string' ), $actual['show_in_rest']['schema']['items'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -532,7 +532,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = get_registered_theme_feature( 'test-feature' )['show_in_rest']['schema']['type'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'array', $actual );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'array', $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -632,7 +632,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $registered = register_theme_feature( 'test-feature', $args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertWPError( $registered );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $error_code, $registered->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $error_code, $registered->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function _dp_register_theme_support_validation() {
</span></span></pre></div>
<a id="trunktestsphpunittestsuploadphp"></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/upload.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/upload.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/upload.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,10 +24,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $info = wp_upload_dir();
</span><span class="cx" style="display: block; padding: 0 10px"> $subdir = gmstrftime( '/%Y/%m' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'siteurl' ) . '/wp-content/uploads' . $subdir, $info['url'] );
- $this->assertEquals( ABSPATH . 'wp-content/uploads' . $subdir, $info['path'] );
- $this->assertEquals( $subdir, $info['subdir'] );
- $this->assertEquals( false, $info['error'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'siteurl' ) . '/wp-content/uploads' . $subdir, $info['url'] );
+ $this->assertSame( ABSPATH . 'wp-content/uploads' . $subdir, $info['path'] );
+ $this->assertSame( $subdir, $info['subdir'] );
+ $this->assertFalse( $info['error'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_upload_dir_relative() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,10 +36,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $info = _wp_upload_dir();
</span><span class="cx" style="display: block; padding: 0 10px"> $subdir = gmstrftime( '/%Y/%m' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'siteurl' ) . '/foo/bar' . $subdir, $info['url'] );
- $this->assertEquals( ABSPATH . 'foo/bar' . $subdir, $info['path'] );
- $this->assertEquals( $subdir, $info['subdir'] );
- $this->assertEquals( false, $info['error'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'siteurl' ) . '/foo/bar' . $subdir, $info['url'] );
+ $this->assertSame( ABSPATH . 'foo/bar' . $subdir, $info['path'] );
+ $this->assertSame( $subdir, $info['subdir'] );
+ $this->assertFalse( $info['error'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,10 +59,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $info = _wp_upload_dir();
</span><span class="cx" style="display: block; padding: 0 10px"> $subdir = gmstrftime( '/%Y/%m' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/baz' . $subdir, $info['url'] );
- $this->assertEquals( $path . $subdir, $info['path'] );
- $this->assertEquals( $subdir, $info['subdir'] );
- $this->assertEquals( false, $info['error'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/baz' . $subdir, $info['url'] );
+ $this->assertSame( $path . $subdir, $info['path'] );
+ $this->assertSame( $subdir, $info['subdir'] );
+ $this->assertFalse( $info['error'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_upload_dir_no_yearnum() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,10 +71,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Use `_wp_upload_dir()` directly to bypass caching and work with the changed options.
</span><span class="cx" style="display: block; padding: 0 10px"> $info = _wp_upload_dir();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'siteurl' ) . '/wp-content/uploads', $info['url'] );
- $this->assertEquals( ABSPATH . 'wp-content/uploads', $info['path'] );
- $this->assertEquals( '', $info['subdir'] );
- $this->assertEquals( false, $info['error'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'siteurl' ) . '/wp-content/uploads', $info['url'] );
+ $this->assertSame( ABSPATH . 'wp-content/uploads', $info['path'] );
+ $this->assertSame( '', $info['subdir'] );
+ $this->assertFalse( $info['error'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_upload_path_absolute() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -85,10 +85,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $info = _wp_upload_dir();
</span><span class="cx" style="display: block; padding: 0 10px"> $subdir = gmstrftime( '/%Y/%m' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'http://' . WP_TESTS_DOMAIN . '/asdf' . $subdir, $info['url'] );
- $this->assertEquals( ABSPATH . 'wp-content/uploads' . $subdir, $info['path'] );
- $this->assertEquals( $subdir, $info['subdir'] );
- $this->assertEquals( false, $info['error'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'http://' . WP_TESTS_DOMAIN . '/asdf' . $subdir, $info['url'] );
+ $this->assertSame( ABSPATH . 'wp-content/uploads' . $subdir, $info['path'] );
+ $this->assertSame( $subdir, $info['subdir'] );
+ $this->assertFalse( $info['error'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_upload_dir_empty() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -100,10 +100,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $info = _wp_upload_dir();
</span><span class="cx" style="display: block; padding: 0 10px"> $subdir = gmstrftime( '/%Y/%m' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'siteurl' ) . '/wp-content/uploads' . $subdir, $info['url'] );
- $this->assertEquals( ABSPATH . 'wp-content/uploads' . $subdir, $info['path'] );
- $this->assertEquals( $subdir, $info['subdir'] );
- $this->assertEquals( false, $info['error'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'siteurl' ) . '/wp-content/uploads' . $subdir, $info['url'] );
+ $this->assertSame( ABSPATH . 'wp-content/uploads' . $subdir, $info['path'] );
+ $this->assertSame( $subdir, $info['subdir'] );
+ $this->assertFalse( $info['error'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsurlphp"></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/url.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/url.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/url.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,8 +77,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $siteurl_https = set_url_scheme( $siteurl_http, 'https' );
</span><span class="cx" style="display: block; padding: 0 10px"> $admin_url_https = admin_url( $url );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $siteurl_http . $expected, $admin_url_http );
- $this->assertEquals( $siteurl_https . $expected, $admin_url_https );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $siteurl_http . $expected, $admin_url_http );
+ $this->assertSame( $siteurl_https . $expected, $admin_url_https );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_admin_urls() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -145,8 +145,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $homeurl_https = set_url_scheme( $homeurl_http, 'https' );
</span><span class="cx" style="display: block; padding: 0 10px"> $home_url_https = home_url( $url );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $homeurl_http . $expected, $home_url_http );
- $this->assertEquals( $homeurl_https . $expected, $home_url_https );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $homeurl_http . $expected, $home_url_http );
+ $this->assertSame( $homeurl_https . $expected, $home_url_https );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function data_home_urls() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -207,17 +207,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // home_url() should return http when in the admin.
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTPS'] = 'on';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $home, home_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $home, home_url() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTPS'] = 'off';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $home, home_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $home, home_url() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If not in the admin, is_ssl() should determine the scheme.
</span><span class="cx" style="display: block; padding: 0 10px"> set_current_screen( 'front' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $home, home_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $home, home_url() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTPS'] = 'on';
</span><span class="cx" style="display: block; padding: 0 10px"> $home = str_replace( 'http://', 'https://', $home );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $home, home_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $home, home_url() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test with https in home.
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'home', set_url_scheme( $home, 'https' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -228,18 +228,18 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // home_url() should return whatever scheme is set in the home option when in the admin.
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTPS'] = 'on';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $home, home_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $home, home_url() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTPS'] = 'off';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $home, home_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $home, home_url() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If not in the admin, is_ssl() should determine the scheme unless https hard-coded in home.
</span><span class="cx" style="display: block; padding: 0 10px"> set_current_screen( 'front' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $home, home_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $home, home_url() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTPS'] = 'on';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $home, home_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $home, home_url() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTPS'] = 'off';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $home, home_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $home, home_url() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'home', set_url_scheme( $home, 'http' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -254,19 +254,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $home = network_home_url();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // home_url() should return http when in the admin.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, strpos( $home, 'http://' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, strpos( $home, 'http://' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTPS'] = 'on';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $home, network_home_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $home, network_home_url() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTPS'] = 'off';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $home, network_home_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $home, network_home_url() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If not in the admin, is_ssl() should determine the scheme.
</span><span class="cx" style="display: block; padding: 0 10px"> set_current_screen( 'front' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $home, network_home_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $home, network_home_url() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTPS'] = 'on';
</span><span class="cx" style="display: block; padding: 0 10px"> $home = str_replace( 'http://', 'https://', $home );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $home, network_home_url() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $home, network_home_url() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['current_screen'] = $screen;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -307,27 +307,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $forced_admin = force_ssl_admin();
</span><span class="cx" style="display: block; padding: 0 10px"> $i = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $links as $link ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $https_links[ $i ], set_url_scheme( $link, 'https' ) );
- $this->assertEquals( $http_links[ $i ], set_url_scheme( $link, 'http' ) );
- $this->assertEquals( $relative_links[ $i ], set_url_scheme( $link, 'relative' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $https_links[ $i ], set_url_scheme( $link, 'https' ) );
+ $this->assertSame( $http_links[ $i ], set_url_scheme( $link, 'http' ) );
+ $this->assertSame( $relative_links[ $i ], set_url_scheme( $link, 'relative' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTPS'] = 'on';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $https_links[ $i ], set_url_scheme( $link ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $https_links[ $i ], set_url_scheme( $link ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTPS'] = 'off';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $http_links[ $i ], set_url_scheme( $link ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $http_links[ $i ], set_url_scheme( $link ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> force_ssl_admin( true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $https_links[ $i ], set_url_scheme( $link, 'admin' ) );
- $this->assertEquals( $https_links[ $i ], set_url_scheme( $link, 'login_post' ) );
- $this->assertEquals( $https_links[ $i ], set_url_scheme( $link, 'login' ) );
- $this->assertEquals( $https_links[ $i ], set_url_scheme( $link, 'rpc' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $https_links[ $i ], set_url_scheme( $link, 'admin' ) );
+ $this->assertSame( $https_links[ $i ], set_url_scheme( $link, 'login_post' ) );
+ $this->assertSame( $https_links[ $i ], set_url_scheme( $link, 'login' ) );
+ $this->assertSame( $https_links[ $i ], set_url_scheme( $link, 'rpc' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> force_ssl_admin( false );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $http_links[ $i ], set_url_scheme( $link, 'admin' ) );
- $this->assertEquals( $http_links[ $i ], set_url_scheme( $link, 'login_post' ) );
- $this->assertEquals( $http_links[ $i ], set_url_scheme( $link, 'login' ) );
- $this->assertEquals( $http_links[ $i ], set_url_scheme( $link, 'rpc' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $http_links[ $i ], set_url_scheme( $link, 'admin' ) );
+ $this->assertSame( $http_links[ $i ], set_url_scheme( $link, 'login_post' ) );
+ $this->assertSame( $http_links[ $i ], set_url_scheme( $link, 'login' ) );
+ $this->assertSame( $http_links[ $i ], set_url_scheme( $link, 'rpc' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $i++;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -348,16 +348,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $p = get_adjacent_post();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $p );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_id, $p->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_id, $p->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The same again to make sure a cached query returns the same result.
</span><span class="cx" style="display: block; padding: 0 10px"> $p = get_adjacent_post();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Post', $p );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_id, $p->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_id, $p->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test next.
</span><span class="cx" style="display: block; padding: 0 10px"> $p = get_adjacent_post( false, '', false );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $p );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $p );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $GLOBALS['post'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( get_adjacent_post() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -398,7 +398,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['post'] = get_post( $p2 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $p = get_adjacent_post();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $p1, $p->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $p1, $p->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['post'] = $orig_post;
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $old_uid );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -436,7 +436,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['post'] = get_post( $p2 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $p = get_adjacent_post();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $p1, $p->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $p1, $p->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['post'] = $orig_post;
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $old_uid );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -480,7 +480,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['post'] = get_post( $p3 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $p = get_adjacent_post();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $p1, $p->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $p1, $p->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['post'] = $orig_post;
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( $old_uid );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -506,11 +506,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $functions as $function ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> call_user_func( $function, '/' ) . '../',
</span><span class="cx" style="display: block; padding: 0 10px"> call_user_func( $function, '../' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> call_user_func( $function, '/' ) . 'something...here',
</span><span class="cx" style="display: block; padding: 0 10px"> call_user_func( $function, 'something...here' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -518,11 +518,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // These functions accept a blog ID argument.
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( array( 'get_site_url', 'get_home_url', 'get_admin_url' ) as $function ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> call_user_func( $function, null, '/' ) . '../',
</span><span class="cx" style="display: block; padding: 0 10px"> call_user_func( $function, null, '../' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> call_user_func( $function, null, '/' ) . 'something...here',
</span><span class="cx" style="display: block; padding: 0 10px"> call_user_func( $function, null, 'something...here' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span></span></pre></div>
<a id="trunktestsphpunittestsuserauthorphp"></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/user/author.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user/author.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/user/author.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,41 +47,41 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $author_name = get_the_author();
</span><span class="cx" style="display: block; padding: 0 10px"> $user = new WP_User( self::$author_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user->display_name, $author_name );
- $this->assertEquals( 'test_author', $author_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user->display_name, $author_name );
+ $this->assertSame( 'test_author', $author_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_the_author_meta() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test_author', get_the_author_meta( 'login' ) );
- $this->assertEquals( 'test_author', get_the_author_meta( 'user_login' ) );
- $this->assertEquals( 'test_author', get_the_author_meta( 'display_name' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test_author', get_the_author_meta( 'login' ) );
+ $this->assertSame( 'test_author', get_the_author_meta( 'user_login' ) );
+ $this->assertSame( 'test_author', get_the_author_meta( 'display_name' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test_author', trim( get_the_author_meta( 'description' ) ) );
- $this->assertEquals( 'test_author', get_the_author_meta( 'user_description' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test_author', trim( get_the_author_meta( 'description' ) ) );
+ $this->assertSame( 'test_author', get_the_author_meta( 'user_description' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> add_user_meta( self::$author_id, 'user_description', 'user description' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'user description', get_user_meta( self::$author_id, 'user_description', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'user description', get_user_meta( self::$author_id, 'user_description', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // user_description in meta is ignored. The content of description is returned instead.
</span><span class="cx" style="display: block; padding: 0 10px"> // See #20285.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test_author', get_the_author_meta( 'user_description' ) );
- $this->assertEquals( 'test_author', trim( get_the_author_meta( 'description' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test_author', get_the_author_meta( 'user_description' ) );
+ $this->assertSame( 'test_author', trim( get_the_author_meta( 'description' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> update_user_meta( self::$author_id, 'user_description', '' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_user_meta( self::$author_id, 'user_description', true ) );
- $this->assertEquals( 'test_author', get_the_author_meta( 'user_description' ) );
- $this->assertEquals( 'test_author', trim( get_the_author_meta( 'description' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_user_meta( self::$author_id, 'user_description', true ) );
+ $this->assertSame( 'test_author', get_the_author_meta( 'user_description' ) );
+ $this->assertSame( 'test_author', trim( get_the_author_meta( 'description' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_the_author_meta( 'does_not_exist' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_the_author_meta( 'does_not_exist' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_the_author_meta_no_authordata() {
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $GLOBALS['authordata'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_the_author_meta( 'id' ) );
- $this->assertEquals( '', get_the_author_meta( 'user_login' ) );
- $this->assertEquals( '', get_the_author_meta( 'does_not_exist' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_the_author_meta( 'id' ) );
+ $this->assertSame( '', get_the_author_meta( 'user_login' ) );
+ $this->assertSame( '', get_the_author_meta( 'does_not_exist' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_the_author_posts() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Test with no global post, result should be 0 because no author is found.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, get_the_author_posts() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, get_the_author_posts() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['post'] = self::$post_id;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1, get_the_author_posts() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsusercapabilitiesphp"></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/user/capabilities.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user/capabilities.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/user/capabilities.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -342,13 +342,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $multi_primitive = array_keys( $this->_getMultiSitePrimitiveCaps() );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $single_primitive );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $multi_primitive );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $single_primitive, $multi_primitive );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $single_primitive, $multi_primitive );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $single_meta = array_keys( $this->_getSingleSiteMetaCaps() );
</span><span class="cx" style="display: block; padding: 0 10px"> $multi_meta = array_keys( $this->_getMultiSiteMetaCaps() );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $single_meta );
</span><span class="cx" style="display: block; padding: 0 10px"> sort( $multi_meta );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $single_meta, $multi_meta );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $single_meta, $multi_meta );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -378,7 +378,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $diff = array_diff( array_keys( $user_caps ), array_keys( $caps ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $diff, "User with {$role} role has capabilities that aren't being tested" );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $diff, "User with {$role} role has capabilities that aren't being tested" );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -521,7 +521,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $user->exists(), "User with {$role} role does not exist" );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the role name is correct.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $role ), $user->roles, "User should only have the {$role} role" );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $role ), $user->roles, "User should only have the {$role} role" );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $caps as $cap => $roles ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( in_array( $role, $roles, true ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -761,7 +761,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $user->exists(), 'User does not exist' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the role name is correct.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $user->roles, 'User should not have any roles' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $user->roles, 'User should not have any roles' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $caps = $this->getAllCapsAndRoles();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -783,7 +783,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $user->add_role( 'contributor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // User should have two roles now.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'subscriber', 'contributor' ), $user->roles );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'subscriber', 'contributor' ), $user->roles );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $caps = $this->getAllCapsAndRoles();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -799,7 +799,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user->remove_role( 'contributor' );
</span><span class="cx" style="display: block; padding: 0 10px"> // User should have one role now.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'subscriber' ), $user->roles );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'subscriber' ), $user->roles );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -821,7 +821,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $user->exists(), 'User does not exist' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the role name is correct.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $role_name ), $user->roles );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $role_name ), $user->roles );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $caps = $this->getAllCapsAndRoles();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -860,7 +860,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $user->exists(), 'User does not exist' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the role name is correct.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $role_name ), $user->roles );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $role_name ), $user->roles );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $caps = $this->getPrimitiveCapsAndRoles();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -901,7 +901,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user = new WP_User( $id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $user->exists(), "Problem getting user $id" );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $role_name ), $user->roles );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $role_name ), $user->roles );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The user should have all the above caps.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $user->has_cap( $role_name ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -951,7 +951,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user = new WP_User( $id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $user->exists(), "Problem getting user $id" );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( $role_name ), $user->roles );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( $role_name ), $user->roles );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The user should have all the above caps.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $user->has_cap( $role_name ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -988,8 +988,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $user_2->exists(), "Problem getting user $id_2" );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure they're both still contributors.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'contributor' ), $user_1->roles );
- $this->assertEquals( array( 'contributor' ), $user_2->roles );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'contributor' ), $user_1->roles );
+ $this->assertSame( array( 'contributor' ), $user_2->roles );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the extra cap on both users.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $user_1->has_cap( 'publish_posts' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1030,8 +1030,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $user_2->exists(), "Problem getting user $id_2" );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure they're both still contributors.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'contributor' ), $user_1->roles );
- $this->assertEquals( array( 'contributor' ), $user_2->roles );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'contributor' ), $user_1->roles );
+ $this->assertSame( array( 'contributor' ), $user_2->roles );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check the removed cap on both users.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $user_1->has_cap( 'publish_posts' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1053,16 +1053,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // They get promoted to editor - level should get bumped to 7.
</span><span class="cx" style="display: block; padding: 0 10px"> $user->set_role( 'editor' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 7, $user->user_level );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 7, $user->user_level );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Demoted to contributor - level is reduced to 1.
</span><span class="cx" style="display: block; padding: 0 10px"> $user->set_role( 'contributor' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $user->user_level );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $user->user_level );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If they have two roles, user_level should be the max of the two.
</span><span class="cx" style="display: block; padding: 0 10px"> $user->add_role( 'editor' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'contributor', 'editor' ), $user->roles );
- $this->assertEquals( 7, $user->user_level );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'contributor', 'editor' ), $user->roles );
+ $this->assertSame( 7, $user->user_level );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_user_remove_all_caps() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1153,8 +1153,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> register_post_type( 'something', array( 'capabilities' => array( 'edit_posts' => 'draw_somethings' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $something = get_post_type_object( 'something' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'draw_somethings', $something->cap->edit_posts );
- $this->assertEquals( 'draw_somethings', $something->cap->create_posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'draw_somethings', $something->cap->edit_posts );
+ $this->assertSame( 'draw_somethings', $something->cap->create_posts );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> register_post_type(
</span><span class="cx" style="display: block; padding: 0 10px"> 'something',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1167,8 +1167,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $something = get_post_type_object( 'something' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'draw_somethings', $something->cap->edit_posts );
- $this->assertEquals( 'create_somethings', $something->cap->create_posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'draw_somethings', $something->cap->edit_posts );
+ $this->assertSame( 'create_somethings', $something->cap->create_posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> _unregister_post_type( 'something' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test meta authorization callbacks.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1229,7 +1229,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $contributor->has_cap( 'publish_post', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $contributor->has_cap( 'edit_post', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $contributor->has_cap( 'delete_post', $post ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'publish' === $status, $contributor->has_cap( 'read_post', $post ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'publish' === $status, $contributor->has_cap( 'read_post', $post ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1252,7 +1252,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> register_post_type( 'foobar' );
</span><span class="cx" style="display: block; padding: 0 10px"> $cap = get_post_type_object( 'foobar' )->cap;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'edit_posts', $cap->create_posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'edit_posts', $cap->create_posts );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $admin->has_cap( $cap->create_posts ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $author->has_cap( $cap->create_posts ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1266,7 +1266,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> register_post_type( 'foobar', array( 'capability_type' => array( 'foobar', 'foobars' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $cap = get_post_type_object( 'foobar' )->cap;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'edit_foobars', $cap->create_posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'edit_foobars', $cap->create_posts );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $admin->has_cap( $cap->create_posts ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $author->has_cap( $cap->create_posts ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1288,8 +1288,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_post_type( 'foobar' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $cap = get_post_type_object( 'attachment' )->cap;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'upload_files', $cap->create_posts );
- $this->assertEquals( 'edit_posts', $cap->edit_posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'upload_files', $cap->create_posts );
+ $this->assertSame( 'edit_posts', $cap->edit_posts );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $author->has_cap( $cap->create_posts ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $author->has_cap( $cap->edit_posts ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1362,7 +1362,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $expected as $meta_cap => $primitive_cap ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $caps = map_meta_cap( $tax->cap->$meta_cap, $user->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> $primitive_cap,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1471,7 +1471,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $expected as $meta_cap => $primitive_cap ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $caps = map_meta_cap( $tax->cap->$meta_cap, $user->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> $primitive_cap,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1526,7 +1526,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $user->caps );
</span><span class="cx" style="display: block; padding: 0 10px"> $user->set_role( 'administrator' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $user->caps );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $caps, $user->caps );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $caps, $user->caps );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_current_user_can_for_blog() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1567,7 +1567,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> current_user_can_for_blog( $blog_id, 'edit_posts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $orig_blog_id, get_current_blog_id() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $orig_blog_id, get_current_blog_id() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function _nullify_current_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1814,7 +1814,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $author = self::$users['author'];
</span><span class="cx" style="display: block; padding: 0 10px"> $contributor = self::$users['contributor'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'edit_pages', $cpt->cap->edit_posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'edit_pages', $cpt->cap->edit_posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( user_can( $admin->ID, $cpt->cap->edit_posts ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( user_can( $editor->ID, $cpt->cap->edit_posts ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( user_can( $author->ID, $cpt->cap->edit_posts ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1874,7 +1874,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_logout();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, get_current_user_id() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, get_current_user_id() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2192,9 +2192,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_block_caps( $role, $cap, $use_post, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $use_post ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, self::$users[ $role ]->has_cap( $cap, self::$block_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, self::$users[ $role ]->has_cap( $cap, self::$block_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, self::$users[ $role ]->has_cap( $cap ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, self::$users[ $role ]->has_cap( $cap ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsusercountUsersphp"></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/user/countUsers.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user/countUsers.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/user/countUsers.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,7 +52,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Test user counts.
</span><span class="cx" style="display: block; padding: 0 10px"> $count = count_users( $strategy );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 8, $count['total_users'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 8, $count['total_users'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'administrator' => 2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -132,7 +132,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Test users counts on root site.
</span><span class="cx" style="display: block; padding: 0 10px"> $count = count_users( $strategy );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 8, $count['total_users'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 8, $count['total_users'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'administrator' => 2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,7 +150,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $count = count_users( $strategy );
</span><span class="cx" style="display: block; padding: 0 10px"> restore_current_blog();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $count['total_users'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $count['total_users'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'administrator' => 1,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -165,7 +165,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $count = count_users( $strategy );
</span><span class="cx" style="display: block; padding: 0 10px"> restore_current_blog();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $count['total_users'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $count['total_users'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'administrator' => 1,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -227,7 +227,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> get_userdata( $editor )->add_role( 'author' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'editor',
</span><span class="cx" style="display: block; padding: 0 10px"> 'author',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -238,7 +238,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Test user counts.
</span><span class="cx" style="display: block; padding: 0 10px"> $count = count_users( $strategy );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, $count['total_users'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, $count['total_users'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'administrator' => 2,
</span></span></pre></div>
<a id="trunktestsphpunittestsusergetActiveBlogForUserphp"></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/user/getActiveBlogForUser.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user/getActiveBlogForUser.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/user/getActiveBlogForUser.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,7 +54,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_site( $site_id_one );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_site( $site_id_two );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $primary_site_id, $result->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $primary_site_id, $result->id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,7 +71,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_site( $primary_site_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $primary_site_id, $result->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $primary_site_id, $result->id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -94,7 +94,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_site( $site_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $current_site_id, $result->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $current_site_id, $result->id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsusermapMetaCapphp"></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/user/mapMetaCap.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user/mapMetaCap.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/user/mapMetaCap.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -42,7 +42,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 13905
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_capability_type_post_with_invalid_id() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'do_not_allow' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( 'edit_post', self::$user_id, self::$post_id + 1 )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,29 +60,29 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $post_type_object->map_meta_cap );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'edit_others_posts', 'edit_private_posts' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( 'edit_post', self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'edit_others_posts', 'edit_private_posts' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( $post_type_object->cap->edit_post, self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'read_private_posts' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( 'read_post', self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'read_private_posts' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( $post_type_object->cap->read_post, self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'delete_others_posts', 'delete_private_posts' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( 'delete_post', self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'delete_others_posts', 'delete_private_posts' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( $post_type_object->cap->delete_post, self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -99,29 +99,29 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type_object = get_post_type_object( self::$post_type );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'edit_others_books', 'edit_private_books' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( 'edit_post', self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'edit_others_books', 'edit_private_books' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( $post_type_object->cap->edit_post, self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'read_private_books' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( 'read_post', self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'read_private_books' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( $post_type_object->cap->read_post, self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'delete_others_books', 'delete_private_books' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( 'delete_post', self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'delete_others_books', 'delete_private_books' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( $post_type_object->cap->delete_post, self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -140,29 +140,29 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $post_type_object->map_meta_cap );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'edit_post' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( 'edit_post', self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'edit_post' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( $post_type_object->cap->edit_post, self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'read_post' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( 'read_post', self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'read_post' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( $post_type_object->cap->read_post, self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'delete_post' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( 'delete_post', self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'delete_post' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( $post_type_object->cap->delete_post, self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -185,29 +185,29 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $post_type_object->map_meta_cap );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'edit_others_books', 'edit_private_posts' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( 'edit_post', self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'edit_others_books', 'edit_private_posts' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( $post_type_object->cap->edit_post, self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'read_private_posts' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( 'read_post', self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'read_private_posts' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( $post_type_object->cap->read_post, self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'delete_others_posts', 'delete_private_posts' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( 'delete_post', self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'delete_others_posts', 'delete_private_posts' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( $post_type_object->cap->delete_post, self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -230,29 +230,29 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $post_type_object->map_meta_cap );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'edit_book' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( 'edit_post', self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'edit_book' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( $post_type_object->cap->edit_post, self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'read_book' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( 'read_post', self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'read_book' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( $post_type_object->cap->read_post, self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'delete_book' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( 'delete_post', self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'delete_book' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( $post_type_object->cap->delete_post, self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -276,29 +276,29 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $post_type_object->map_meta_cap );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'edit_others_posts', 'edit_private_posts' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( 'edit_post', self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'edit_others_posts', 'edit_private_posts' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( $post_type_object->cap->edit_post, self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'read_private_posts' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( 'read_post', self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'read_private_posts' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( $post_type_object->cap->read_post, self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'delete_others_posts', 'delete_private_posts' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( 'delete_post', self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame(
</ins><span class="cx" style="display: block; padding: 0 10px"> array( 'delete_others_posts', 'delete_private_posts' ),
</span><span class="cx" style="display: block; padding: 0 10px"> map_meta_cap( $post_type_object->cap->delete_post, self::$user_id, self::$post_id )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -319,7 +319,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type_object = get_post_type_object( self::$post_type );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $post_type_object->map_meta_cap );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'delete_posts', $post_type_object->cap->delete_posts );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'delete_posts', $post_type_object->cap->delete_posts );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_unfiltered_html_cap() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -328,10 +328,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_multisite() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'do_not_allow' ), map_meta_cap( 'unfiltered_html', 0 ) );
- $this->assertEquals( array( 'unfiltered_html' ), map_meta_cap( 'unfiltered_html', self::$user_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'do_not_allow' ), map_meta_cap( 'unfiltered_html', 0 ) );
+ $this->assertSame( array( 'unfiltered_html' ), map_meta_cap( 'unfiltered_html', self::$user_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'unfiltered_html' ), map_meta_cap( 'unfiltered_html', self::$user_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'unfiltered_html' ), map_meta_cap( 'unfiltered_html', self::$user_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -347,8 +347,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( DISALLOW_UNFILTERED_HTML );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'update_core' ), map_meta_cap( 'update_core', self::$user_id ) );
- $this->assertEquals( array( 'edit_plugins' ), map_meta_cap( 'edit_plugins', self::$user_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'update_core' ), map_meta_cap( 'update_core', self::$user_id ) );
+ $this->assertSame( array( 'edit_plugins' ), map_meta_cap( 'edit_plugins', self::$user_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -366,8 +366,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $editor = self::factory()->user->create( array( 'role' => 'editor' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'edit_others_posts', 'edit_published_posts' ), map_meta_cap( 'edit_post', $editor, $post_id ) );
- $this->assertEquals( array( 'delete_others_posts', 'delete_published_posts' ), map_meta_cap( 'delete_post', $editor, $post_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'edit_others_posts', 'edit_published_posts' ), map_meta_cap( 'edit_post', $editor, $post_id ) );
+ $this->assertSame( array( 'delete_others_posts', 'delete_published_posts' ), map_meta_cap( 'delete_post', $editor, $post_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -388,7 +388,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $caps = map_meta_cap( 'delete_page', self::$user_id, $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> delete_option( 'page_on_front' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'manage_options' ), $caps );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'manage_options' ), $caps );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -408,6 +408,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $caps = map_meta_cap( 'delete_page', self::$user_id, $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> delete_option( 'page_for_posts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 'manage_options' ), $caps );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 'manage_options' ), $caps );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsusermultisitephp"></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/user/multisite.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user/multisite.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/user/multisite.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,7 +52,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $blog_ids_of_user = array_keys( get_blogs_of_user( $user1_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // User should be a member of the created sites and the network's initial site.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $blog_ids, $blog_ids_of_user );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $blog_ids, $blog_ids_of_user );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( remove_user_from_blog( $user1_id, $blog_ids[0] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( remove_user_from_blog( $user1_id, $blog_ids[2] ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,11 +67,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The user should still be a member of all remaining sites.
</span><span class="cx" style="display: block; padding: 0 10px"> $blog_ids_of_user = array_keys( $blogs_of_user );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $blog_ids, $blog_ids_of_user );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $blog_ids, $blog_ids_of_user );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Each site retrieved should match the expected structure.
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $blogs_of_user as $blog_id => $blog ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $blog_id, $blog->userblog_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $blog_id, $blog->userblog_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $blog->userblog_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $blog->blogname ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $blog->domain ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -91,7 +91,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Passing true as the second parameter should retrieve ALL sites, even if marked.
</span><span class="cx" style="display: block; padding: 0 10px"> $blogs_of_user = get_blogs_of_user( $user1_id, true );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog_ids_of_user = array_keys( $blogs_of_user );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $blog_ids, $blog_ids_of_user );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $blog_ids, $blog_ids_of_user );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check if sites are flagged as expected.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 1, $blogs_of_user[ $blog_ids[0] ]->spam );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -105,7 +105,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Passing false (the default) as the second parameter should retrieve only good sites.
</span><span class="cx" style="display: block; padding: 0 10px"> $blog_ids_of_user = array_keys( get_blogs_of_user( $user1_id, false ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $blog_ids, $blog_ids_of_user );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $blog_ids, $blog_ids_of_user );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -369,7 +369,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_should_return_false_for_object_user_id() {
</span><span class="cx" style="display: block; padding: 0 10px"> $u_obj = self::factory()->user->create_and_get();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wpmu_delete_user( $u_obj ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $u_obj->ID, username_exists( $u_obj->user_login ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $u_obj->ID, username_exists( $u_obj->user_login ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsuserqueryphp"></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/user/query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user/query.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/user/query.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,17 +54,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( '', $users->get( 'fields' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $users->query_vars['fields'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $users->query_vars['fields'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $users->query_vars['fields'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $users->set( 'fields', 'all' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'all', $users->get( 'fields' ) );
- $this->assertEquals( 'all', $users->query_vars['fields'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'all', $users->get( 'fields' ) );
+ $this->assertSame( 'all', $users->query_vars['fields'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $users->set( 'fields', '' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $users->get( 'fields' ) );
- $this->assertEquals( '', $users->query_vars['fields'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $users->get( 'fields' ) );
+ $this->assertSame( '', $users->query_vars['fields'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $users->get( 'does-not-exist' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,7 +78,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $ids = $q->get_results();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( self::$author_ids[0] ), $ids );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertEqualSets( array( self::$author_ids[0] ), $ids );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_include_comma_separated() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,7 +137,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $users = $users->get_results();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // +1 for the default user created during installation.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 13, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 13, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $users as $user ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_User', $user );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -149,7 +149,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $users = $users->get_results();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 13, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 13, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $users as $user ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_User', $user );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -502,7 +502,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // +1 for the default user created by the test suite.
</span><span class="cx" style="display: block; padding: 0 10px"> $users = new WP_User_Query( array( 'blog_id' => get_current_blog_id() ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $users = $users->get_results();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 13, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 13, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $users = new WP_User_Query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -511,7 +511,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $users = $users->get_results();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $users = new WP_User_Query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -520,7 +520,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $users = $users->get_results();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $users = new WP_User_Query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -529,7 +529,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $users = $users->get_results();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 13, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 13, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -557,7 +557,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // All values get reset.
</span><span class="cx" style="display: block; padding: 0 10px"> $query->prepare_query( array( 'number' => 8 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $query->query_limit );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'LIMIT 0, 8', $query->query_limit );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'LIMIT 0, 8', $query->query_limit );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // All values get reset.
</span><span class="cx" style="display: block; padding: 0 10px"> $query->prepare_query( array( 'fields' => 'all' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -566,7 +566,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $_query_vars = $query->query_vars;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $query->prepare_query();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $_query_vars, $query->query_vars );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $_query_vars, $query->query_vars );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $query->prepare_query( array( 'number' => -1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEquals( 'LIMIT -1', $query->query_limit );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1142,7 +1142,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_count = 10; // 13 total users minus 3 from query.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( "AND user_nicename NOT IN ( 'peter','paul','mary' )", $q->query_where );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_count, $found_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_count, $found_count );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1243,7 +1243,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_count = 10; // 13 total users minus 3 from query.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( "AND user_login NOT IN ( '$user_login1','$user_login2','$user_login3' )", $q->query_where );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_count, $found_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_count, $found_count );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1314,7 +1314,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_user_search = new WP_User_Query( array( 'role' => 'subscriber' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $users = $wp_user_search->get_results();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1323,7 +1323,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_multiple_roles_by_user_query() {
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_user_search = new WP_User_Query( array( 'role__in' => array( 'subscriber', 'editor' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $users = $wp_user_search->get_results();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 5, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 5, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1336,7 +1336,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1372,7 +1372,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1392,7 +1392,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $users = new WP_User_Query( array( 'role' => array( 'subscriber', 'editor' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $users = $users->get_results();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $users as $user ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_User', $user );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1407,7 +1407,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $users = $users->get_results();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // +1 for the default user created during installation.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 8, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 8, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $users as $user ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_User', $user );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1436,7 +1436,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1482,7 +1482,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check results.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( self::$editor_ids[0], (int) $users[0]->ID );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1497,7 +1497,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // +1 for the default user created during installation.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 11, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 11, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $users = get_users(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1506,7 +1506,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // +1 for the default user created during installation.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1524,7 +1524,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 5, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 5, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $users = get_users(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1533,7 +1533,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1550,7 +1550,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1568,7 +1568,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // +1 for the default user created during installation.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 12, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 12, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $users = get_users(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1577,7 +1577,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // +1 for the default user created during installation.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, count( $users ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, count( $users ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1690,7 +1690,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $ids = $q->get_results();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Must not include user that has the same string in other fields.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), $ids );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), $ids );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1717,7 +1717,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( array( 555 ), $q->results );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure manually setting total_users doesn't get overwritten.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $q->total_users );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $q->total_users );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public static function filter_users_pre_query( $posts, $query ) {
</span></span></pre></div>
<a id="trunktestsphpunittestsuserslashesphp"></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/user/slashes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user/slashes.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/user/slashes.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,11 +46,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $id = add_user();
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_user_to_edit( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->slash_1, $user->first_name );
- $this->assertEquals( $this->slash_3, $user->last_name );
- $this->assertEquals( $this->slash_5, $user->nickname );
- $this->assertEquals( $this->slash_7, $user->display_name );
- $this->assertEquals( $this->slash_3, $user->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->slash_1, $user->first_name );
+ $this->assertSame( $this->slash_3, $user->last_name );
+ $this->assertSame( $this->slash_5, $user->nickname );
+ $this->assertSame( $this->slash_7, $user->display_name );
+ $this->assertSame( $this->slash_3, $user->description );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $_GET = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,11 +71,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $id = add_user();
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_user_to_edit( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->slash_2, $user->first_name );
- $this->assertEquals( $this->slash_4, $user->last_name );
- $this->assertEquals( $this->slash_6, $user->nickname );
- $this->assertEquals( $this->slash_2, $user->display_name );
- $this->assertEquals( $this->slash_4, $user->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->slash_2, $user->first_name );
+ $this->assertSame( $this->slash_4, $user->last_name );
+ $this->assertSame( $this->slash_6, $user->nickname );
+ $this->assertSame( $this->slash_2, $user->display_name );
+ $this->assertSame( $this->slash_4, $user->description );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -100,11 +100,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $id = edit_user( $id );
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_user_to_edit( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->slash_1, $user->first_name );
- $this->assertEquals( $this->slash_3, $user->last_name );
- $this->assertEquals( $this->slash_5, $user->nickname );
- $this->assertEquals( $this->slash_7, $user->display_name );
- $this->assertEquals( $this->slash_3, $user->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->slash_1, $user->first_name );
+ $this->assertSame( $this->slash_3, $user->last_name );
+ $this->assertSame( $this->slash_5, $user->nickname );
+ $this->assertSame( $this->slash_7, $user->display_name );
+ $this->assertSame( $this->slash_3, $user->description );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $_GET = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -122,11 +122,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $id = edit_user( $id );
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_user_to_edit( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->slash_2, $user->first_name );
- $this->assertEquals( $this->slash_4, $user->last_name );
- $this->assertEquals( $this->slash_6, $user->nickname );
- $this->assertEquals( $this->slash_2, $user->display_name );
- $this->assertEquals( $this->slash_4, $user->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->slash_2, $user->first_name );
+ $this->assertSame( $this->slash_4, $user->last_name );
+ $this->assertSame( $this->slash_6, $user->nickname );
+ $this->assertSame( $this->slash_2, $user->display_name );
+ $this->assertSame( $this->slash_4, $user->description );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -148,11 +148,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_user_to_edit( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_1 ), $user->first_name );
- $this->assertEquals( wp_unslash( $this->slash_3 ), $user->last_name );
- $this->assertEquals( wp_unslash( $this->slash_5 ), $user->nickname );
- $this->assertEquals( wp_unslash( $this->slash_7 ), $user->display_name );
- $this->assertEquals( wp_unslash( $this->slash_3 ), $user->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_1 ), $user->first_name );
+ $this->assertSame( wp_unslash( $this->slash_3 ), $user->last_name );
+ $this->assertSame( wp_unslash( $this->slash_5 ), $user->nickname );
+ $this->assertSame( wp_unslash( $this->slash_7 ), $user->display_name );
+ $this->assertSame( wp_unslash( $this->slash_3 ), $user->description );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $id = wp_insert_user(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -169,11 +169,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_user_to_edit( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_2 ), $user->first_name );
- $this->assertEquals( wp_unslash( $this->slash_4 ), $user->last_name );
- $this->assertEquals( wp_unslash( $this->slash_6 ), $user->nickname );
- $this->assertEquals( wp_unslash( $this->slash_2 ), $user->display_name );
- $this->assertEquals( wp_unslash( $this->slash_4 ), $user->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_2 ), $user->first_name );
+ $this->assertSame( wp_unslash( $this->slash_4 ), $user->last_name );
+ $this->assertSame( wp_unslash( $this->slash_6 ), $user->nickname );
+ $this->assertSame( wp_unslash( $this->slash_2 ), $user->display_name );
+ $this->assertSame( wp_unslash( $this->slash_4 ), $user->description );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -194,11 +194,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_user_to_edit( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_1 ), $user->first_name );
- $this->assertEquals( wp_unslash( $this->slash_3 ), $user->last_name );
- $this->assertEquals( wp_unslash( $this->slash_5 ), $user->nickname );
- $this->assertEquals( wp_unslash( $this->slash_7 ), $user->display_name );
- $this->assertEquals( wp_unslash( $this->slash_3 ), $user->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_1 ), $user->first_name );
+ $this->assertSame( wp_unslash( $this->slash_3 ), $user->last_name );
+ $this->assertSame( wp_unslash( $this->slash_5 ), $user->nickname );
+ $this->assertSame( wp_unslash( $this->slash_7 ), $user->display_name );
+ $this->assertSame( wp_unslash( $this->slash_3 ), $user->description );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $id = wp_update_user(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -213,11 +213,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_user_to_edit( $id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_unslash( $this->slash_2 ), $user->first_name );
- $this->assertEquals( wp_unslash( $this->slash_4 ), $user->last_name );
- $this->assertEquals( wp_unslash( $this->slash_6 ), $user->nickname );
- $this->assertEquals( wp_unslash( $this->slash_2 ), $user->display_name );
- $this->assertEquals( wp_unslash( $this->slash_4 ), $user->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_unslash( $this->slash_2 ), $user->first_name );
+ $this->assertSame( wp_unslash( $this->slash_4 ), $user->last_name );
+ $this->assertSame( wp_unslash( $this->slash_6 ), $user->nickname );
+ $this->assertSame( wp_unslash( $this->slash_2 ), $user->display_name );
+ $this->assertSame( wp_unslash( $this->slash_4 ), $user->description );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsuserupdateUserCachesphp"></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/user/updateUserCaches.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user/updateUserCaches.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/user/updateUserCaches.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,7 +24,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_user_caches( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 12345, wp_cache_get( 'foo', 'userlogins' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 12345, wp_cache_get( 'foo', 'userlogins' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_should_store_user_id_in_useremail_bucket() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_user_caches( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 12345, wp_cache_get( 'foo@example.com', 'useremail' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 12345, wp_cache_get( 'foo@example.com', 'useremail' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_should_store_user_id_in_userslugs_bucket() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,7 +48,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_user_caches( $data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 12345, wp_cache_get( 'bar', 'userslugs' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 12345, wp_cache_get( 'bar', 'userslugs' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsuserwpAuthenticateSpamCheckphp"></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/user/wpAuthenticateSpamCheck.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user/wpAuthenticateSpamCheck.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/user/wpAuthenticateSpamCheck.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,7 +14,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $actual_user = wp_authenticate_spam_check( $user );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_user( $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user->user_login, $actual_user->user_login );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user->user_login, $actual_user->user_login );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,7 +26,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $actual_user = wp_authenticate_spam_check( $user );
</span><span class="cx" style="display: block; padding: 0 10px"> wpmu_delete_user( $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user->user_login, $actual_user->user_login );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user->user_login, $actual_user->user_login );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsuserwpDeleteUserphp"></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/user/wpDeleteUser.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user/wpDeleteUser.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/user/wpDeleteUser.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -12,11 +12,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get_blogs_of_user() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Logged out users don't have blogs.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), get_blogs_of_user( 0 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), get_blogs_of_user( 0 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user_id = self::factory()->user->create( array( 'role' => 'subscriber' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $blogs = get_blogs_of_user( $user_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array( 1 ), array_keys( $blogs ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array( 1 ), array_keys( $blogs ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Non-existent users don't have blogs.
</span><span class="cx" style="display: block; padding: 0 10px"> self::delete_user( $user_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,7 +23,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user = new WP_User( $user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $user->exists(), 'WP_User->exists' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), get_blogs_of_user( $user_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), get_blogs_of_user( $user_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,7 +71,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $post_id > 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_id, $post->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_id, $post->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_author' => $user_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -87,7 +87,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $nav_id > 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $nav_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $nav_id, $post->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $nav_id, $post->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_user( $user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $user = new WP_User( $user_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -98,10 +98,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotNull( get_post( $post_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'trash', get_post( $post_id )->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'trash', get_post( $post_id )->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> // 'nav_menu_item' is `delete_with_user = false` so the nav post should remain published.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotNull( get_post( $nav_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'publish', get_post( $nav_id )->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'publish', get_post( $nav_id )->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_delete_post( $nav_id, true );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( get_post( $nav_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_post( $post_id, true );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -149,6 +149,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_should_return_false_for_object_user_id() {
</span><span class="cx" style="display: block; padding: 0 10px"> $u_obj = self::factory()->user->create_and_get();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wp_delete_user( $u_obj ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $u_obj->ID, username_exists( $u_obj->user_login ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $u_obj->ID, username_exists( $u_obj->user_login ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsuserwpSetCurrentUserphp"></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/user/wpSetCurrentUser.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user/wpSetCurrentUser.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/user/wpSetCurrentUser.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -19,7 +19,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $user = wp_set_current_user( self::$user_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( self::$user_id, $user->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user, wp_get_current_user() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user, wp_get_current_user() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( self::$user_id, get_current_user_id() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $user = wp_set_current_user( self::$user_id, 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( self::$user_id, $user->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user, wp_get_current_user() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user, wp_get_current_user() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( self::$user_id, get_current_user_id() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,7 +38,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $user = wp_set_current_user( null, 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( self::$user_id2, $user->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user, wp_get_current_user() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user, wp_get_current_user() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( self::$user_id2, get_current_user_id() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,7 +54,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $user = wp_set_current_user( null, 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( self::$user_id2, $user->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user, wp_get_current_user() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user, wp_get_current_user() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( self::$user_id2, get_current_user_id() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsuserphp"></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/user.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/user.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -101,12 +101,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set and get.
</span><span class="cx" style="display: block; padding: 0 10px"> update_user_option( self::$author_id, $key, $val );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, get_user_option( $key, self::$author_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, get_user_option( $key, self::$author_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Change and get again.
</span><span class="cx" style="display: block; padding: 0 10px"> $val2 = rand_str();
</span><span class="cx" style="display: block; padding: 0 10px"> update_user_option( self::$author_id, $key, $val2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val2, get_user_option( $key, self::$author_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val2, get_user_option( $key, self::$author_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,29 +117,29 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $val = 'value1';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Get a meta key that doesn't exist.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_user_meta( self::$author_id, $key, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_user_meta( self::$author_id, $key, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set and get.
</span><span class="cx" style="display: block; padding: 0 10px"> update_user_meta( self::$author_id, $key, $val );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, get_user_meta( self::$author_id, $key, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, get_user_meta( self::$author_id, $key, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Change and get again.
</span><span class="cx" style="display: block; padding: 0 10px"> $val2 = 'value2';
</span><span class="cx" style="display: block; padding: 0 10px"> update_user_meta( self::$author_id, $key, $val2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val2, get_user_meta( self::$author_id, $key, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val2, get_user_meta( self::$author_id, $key, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Delete and get.
</span><span class="cx" style="display: block; padding: 0 10px"> delete_user_meta( self::$author_id, $key );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_user_meta( self::$author_id, $key, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_user_meta( self::$author_id, $key, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Delete by key AND value.
</span><span class="cx" style="display: block; padding: 0 10px"> update_user_meta( self::$author_id, $key, $val );
</span><span class="cx" style="display: block; padding: 0 10px"> // Incorrect key: key still exists.
</span><span class="cx" style="display: block; padding: 0 10px"> delete_user_meta( self::$author_id, $key, rand_str() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $val, get_user_meta( self::$author_id, $key, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $val, get_user_meta( self::$author_id, $key, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Correct key: deleted.
</span><span class="cx" style="display: block; padding: 0 10px"> delete_user_meta( self::$author_id, $key, $val );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_user_meta( self::$author_id, $key, true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_user_meta( self::$author_id, $key, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -197,11 +197,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( isset( $user->fooooooooo ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user->$key = 'foo';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo', $user->$key );
- $this->assertEquals( 'foo', $user->data->$key ); // This will fail with WP < 3.3.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo', $user->$key );
+ $this->assertSame( 'foo', $user->data->$key ); // This will fail with WP < 3.3.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( get_object_vars( $user ) as $key => $value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, $user->$key );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, $user->$key );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -216,7 +216,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test custom fields.
</span><span class="cx" style="display: block; padding: 0 10px"> $user->customField = 123;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user->customField, 123 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user->customField, 123 );
</ins><span class="cx" style="display: block; padding: 0 10px"> unset( $user->customField );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( isset( $user->customField ) );
</span><span class="cx" style="display: block; padding: 0 10px"> return $user;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -259,7 +259,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $user->foo ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'foo', $user->foo );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'foo', $user->foo );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -269,9 +269,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $user = new WP_User( self::$author_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $user->id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user->ID, $user->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user->ID, $user->id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $user->id = 1234;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user->ID, $user->id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user->ID, $user->id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -297,51 +297,51 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_construction() {
</span><span class="cx" style="display: block; padding: 0 10px"> $user = new WP_User( self::$author_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_User', $user );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$author_id, $user->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$author_id, $user->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user2 = new WP_User( 0, $user->user_login );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_User', $user2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$author_id, $user2->ID );
- $this->assertEquals( $user->user_login, $user2->user_login );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$author_id, $user2->ID );
+ $this->assertSame( $user->user_login, $user2->user_login );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user3 = new WP_User();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_User', $user3 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $user3->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $user3->ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( isset( $user3->user_login ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user3->init( $user->data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$author_id, $user3->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$author_id, $user3->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user4 = new WP_User( $user->user_login );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_User', $user4 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$author_id, $user4->ID );
- $this->assertEquals( $user->user_login, $user4->user_login );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$author_id, $user4->ID );
+ $this->assertSame( $user->user_login, $user4->user_login );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user5 = new WP_User( null, $user->user_login );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_User', $user5 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$author_id, $user5->ID );
- $this->assertEquals( $user->user_login, $user5->user_login );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$author_id, $user5->ID );
+ $this->assertSame( $user->user_login, $user5->user_login );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user6 = new WP_User( $user );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_User', $user6 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$author_id, $user6->ID );
- $this->assertEquals( $user->user_login, $user6->user_login );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$author_id, $user6->ID );
+ $this->assertSame( $user->user_login, $user6->user_login );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user7 = new WP_User( $user->data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_User', $user7 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$author_id, $user7->ID );
- $this->assertEquals( $user->user_login, $user7->user_login );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$author_id, $user7->ID );
+ $this->assertSame( $user->user_login, $user7->user_login );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_get() {
</span><span class="cx" style="display: block; padding: 0 10px"> $user = new WP_User( self::$author_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'author_login', $user->get( 'user_login' ) );
- $this->assertEquals( 'author@email.com', $user->get( 'user_email' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'author_login', $user->get( 'user_login' ) );
+ $this->assertSame( 'author@email.com', $user->get( 'user_email' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, $user->get( 'use_ssl' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $user->get( 'field_that_does_not_exist' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $user->get( 'field_that_does_not_exist' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_user_meta( self::$author_id, 'dashed-key', 'abcdefg' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'abcdefg', $user->get( 'dashed-key' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'abcdefg', $user->get( 'dashed-key' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_has_prop() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -358,7 +358,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $user = new WP_User( self::$author_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_user_meta( self::$author_id, 'description', 'about me' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'about me', $user->get( 'description' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'about me', $user->get( 'description' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user_data = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'ID' => self::$author_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -367,10 +367,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_user( $user_data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user = new WP_User( self::$author_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'test user', $user->get( 'display_name' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'test user', $user->get( 'display_name' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure there is no collateral damage to fields not in $user_data.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'about me', $user->get( 'description' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'about me', $user->get( 'description' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Pass as stdClass.
</span><span class="cx" style="display: block; padding: 0 10px"> $user_data = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -380,12 +380,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_user( (object) $user_data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user = new WP_User( self::$author_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'a test user', $user->get( 'display_name' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'a test user', $user->get( 'display_name' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user->display_name = 'some test user';
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_user( $user );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'some test user', $user->get( 'display_name' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'some test user', $user->get( 'display_name' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test update of fields in _get_additional_user_keys().
</span><span class="cx" style="display: block; padding: 0 10px"> $user_data = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -419,7 +419,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $userdata );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_User', $userdata );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $userdata->ID, self::$sub_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $userdata->ID, self::$sub_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $prefix = $wpdb->get_blog_prefix();
</span><span class="cx" style="display: block; padding: 0 10px"> $cap_key = $prefix . 'capabilities';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( isset( $userdata->$cap_key ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -471,7 +471,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $authordata );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_User', $authordata );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $authordata->ID, self::$author_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $authordata->ID, self::$author_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $old_post_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> setup_postdata( get_post( $old_post_id ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -498,25 +498,25 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // @ticket 23480
</span><span class="cx" style="display: block; padding: 0 10px"> $user1 = WP_User::get_data_by( 'id', -1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $user1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $user1 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user2 = WP_User::get_data_by( 'id', 0 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $user2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $user2 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user3 = WP_User::get_data_by( 'id', null );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $user3 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $user3 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user4 = WP_User::get_data_by( 'id', '' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $user4 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $user4 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user5 = WP_User::get_data_by( 'id', false );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $user5 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $user5 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user6 = WP_User::get_data_by( 'id', $user->user_nicename );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $user6 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $user6 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user7 = WP_User::get_data_by( 'id', 99999 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( false, $user7 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $user7 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -585,7 +585,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Reload the data.
</span><span class="cx" style="display: block; padding: 0 10px"> $pwd_after = get_userdata( $testuserid )->user_pass;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $pwd_before, $pwd_after );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $pwd_before, $pwd_after );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -624,7 +624,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'user_email' => 'taco@burrito.com',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id1, email_exists( 'taco@burrito.com' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id1, email_exists( 'taco@burrito.com' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $id2 = wp_insert_user(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -655,7 +655,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'user_email' => 'blackburn@battlefield4.com',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id1, email_exists( 'blackburn@battlefield4.com' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id1, email_exists( 'blackburn@battlefield4.com' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $id2 = wp_insert_user(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -664,7 +664,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'user_email' => 'miller@battlefield4.com',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id2, email_exists( 'miller@battlefield4.com' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id2, email_exists( 'miller@battlefield4.com' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_wp_error( $id2 ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_user(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -673,7 +673,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'user_email' => 'david@battlefield4.com',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id2, email_exists( 'david@battlefield4.com' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id2, email_exists( 'david@battlefield4.com' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $return = wp_update_user(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -703,7 +703,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = wp_insert_user( $user_data );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $response );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_username', $response->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_username', $response->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'illegal_user_logins', array( $this, '_illegal_user_logins' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -723,7 +723,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = register_new_user( $user_login, $user_email );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $response );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'invalid_username', $response->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'invalid_username', $response->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'illegal_user_logins', array( $this, '_illegal_user_logins' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -746,13 +746,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = wpmu_validate_user_signup( $user_data['user_login'], $user_data['user_email'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $response['errors'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'user_name', $response['errors']->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'user_name', $response['errors']->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'illegal_user_logins', array( $this, '_illegal_user_logins' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response = wpmu_validate_user_signup( $user_data['user_login'], $user_data['user_email'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $response['errors'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $response['errors']->get_error_codes() ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $response['errors']->get_error_codes() ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function _illegal_user_logins_data() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -815,7 +815,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user_id = wp_insert_user( $user_details );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user_id, email_exists( $user_details['user_email'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user_id, email_exists( $user_details['user_email'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that providing an empty password doesn't remove a user's password.
</span><span class="cx" style="display: block; padding: 0 10px"> $user_details['ID'] = $user_id;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1044,7 +1044,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> clean_user_cache( $user );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_userdata( $user->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'key', $user->user_activation_key );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'key', $user->user_activation_key );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that changing something other than the email doesn't remove the key.
</span><span class="cx" style="display: block; padding: 0 10px"> $userdata = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1054,7 +1054,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_update_user( $userdata );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_userdata( $user->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'key', $user->user_activation_key );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'key', $user->user_activation_key );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Now check that changing the email does remove it.
</span><span class="cx" style="display: block; padding: 0 10px"> $userdata = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1076,7 +1076,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> clean_user_cache( $user );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_userdata( $user->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'key', $user->user_activation_key );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'key', $user->user_activation_key );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $userdata = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'ID' => $user->ID,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1154,7 +1154,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $update = wp_update_user( $userdata );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$editor_id, $update );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$editor_id, $update );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1169,11 +1169,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $update = wp_update_user( $userdata );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Was this successful?
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$editor_id, $update );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$editor_id, $update );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify that the email address has been updated.
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_userdata( self::$editor_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user->user_email, 'test2@test.com' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user->user_email, 'test2@test.com' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1468,7 +1468,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = edit_user();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $response );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'pass', $response->get_error_code() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'pass', $response->get_error_code() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check new user with password set.
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['pass1'] = 'password';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1479,7 +1479,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'int', $user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_User', $user );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'nickname1', $user->nickname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'nickname1', $user->nickname );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check updating user with empty password.
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['nickname'] = 'nickname_updated';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1489,7 +1489,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $user_id = edit_user( $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'int', $user_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'nickname_updated', $user->nickname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'nickname_updated', $user->nickname );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check updating user with missing second password.
</span><span class="cx" style="display: block; padding: 0 10px"> $_POST['nickname'] = 'nickname_updated2';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1499,8 +1499,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = edit_user( $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'WP_Error', $response );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'pass', $response->get_error_code() );
- $this->assertEquals( 'nickname_updated', $user->nickname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'pass', $response->get_error_code() );
+ $this->assertSame( 'nickname_updated', $user->nickname );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check updating user with empty password via `check_passwords` action.
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'check_passwords', array( $this, 'action_check_passwords_blank_pw' ), 10, 2 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1508,7 +1508,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> remove_action( 'check_passwords', array( $this, 'action_check_passwords_blank_pw' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'int', $user_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'nickname_updated2', $user->nickname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'nickname_updated2', $user->nickname );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1547,10 +1547,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The new email address gets put into user_meta.
</span><span class="cx" style="display: block; padding: 0 10px"> $new_email_meta = get_user_meta( $user->ID, '_new_email', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'after@example.com', $new_email_meta['newemail'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'after@example.com', $new_email_meta['newemail'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The email address of the user doesn't change. $_POST['email'] should be the email address pre-update.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $_POST['email'], $user->user_email );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $_POST['email'], $user->user_email );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1587,7 +1587,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $new_email_meta );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // $_POST['email'] should be the email address posted from the form.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $_POST['email'], 'after@example.com' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $_POST['email'], 'after@example.com' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1723,11 +1723,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $actual['done'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Contains 'Community Events Location'.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Community Events Location', $actual['data'][1]['group_label'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Community Events Location', $actual['data'][1]['group_label'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Contains location IP.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'IP', $actual['data'][1]['data'][0]['name'] );
- $this->assertEquals( '0.0.0.0', $actual['data'][1]['data'][0]['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'IP', $actual['data'][1]['data'][0]['name'] );
+ $this->assertSame( '0.0.0.0', $actual['data'][1]['data'][0]['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1752,23 +1752,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $actual['done'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Contains 'Community Events Location'.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Community Events Location', $actual['data'][1]['group_label'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Community Events Location', $actual['data'][1]['group_label'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Contains location city.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'City', $actual['data'][1]['data'][0]['name'] );
- $this->assertEquals( 'Cincinnati', $actual['data'][1]['data'][0]['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'City', $actual['data'][1]['data'][0]['name'] );
+ $this->assertSame( 'Cincinnati', $actual['data'][1]['data'][0]['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Contains location country.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Country', $actual['data'][1]['data'][1]['name'] );
- $this->assertEquals( 'US', $actual['data'][1]['data'][1]['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Country', $actual['data'][1]['data'][1]['name'] );
+ $this->assertSame( 'US', $actual['data'][1]['data'][1]['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Contains location latitude.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Latitude', $actual['data'][1]['data'][2]['name'] );
- $this->assertEquals( '39.1271100', $actual['data'][1]['data'][2]['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Latitude', $actual['data'][1]['data'][2]['name'] );
+ $this->assertSame( '39.1271100', $actual['data'][1]['data'][2]['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Contains location longitude.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Longitude', $actual['data'][1]['data'][3]['name'] );
- $this->assertEquals( '-84.5143900', $actual['data'][1]['data'][3]['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Longitude', $actual['data'][1]['data'][3]['name'] );
+ $this->assertSame( '-84.5143900', $actual['data'][1]['data'][3]['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1796,23 +1796,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $actual['done'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Contains Session Tokens.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Session Tokens', $actual['data'][1]['group_label'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Session Tokens', $actual['data'][1]['group_label'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Contains Expiration.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Expiration', $actual['data'][1]['data'][0]['name'] );
- $this->assertEquals( 'January 31, 2020 09:13 AM', $actual['data'][1]['data'][0]['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Expiration', $actual['data'][1]['data'][0]['name'] );
+ $this->assertSame( 'January 31, 2020 09:13 AM', $actual['data'][1]['data'][0]['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Contains IP.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'IP', $actual['data'][1]['data'][1]['name'] );
- $this->assertEquals( '0.0.0.0', $actual['data'][1]['data'][1]['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'IP', $actual['data'][1]['data'][1]['name'] );
+ $this->assertSame( '0.0.0.0', $actual['data'][1]['data'][1]['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Contains IP.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'User Agent', $actual['data'][1]['data'][2]['name'] );
- $this->assertEquals( 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', $actual['data'][1]['data'][2]['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'User Agent', $actual['data'][1]['data'][2]['name'] );
+ $this->assertSame( 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', $actual['data'][1]['data'][2]['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Contains IP.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Last Login', $actual['data'][1]['data'][3]['name'] );
- $this->assertEquals( 'January 29, 2020 09:13 AM', $actual['data'][1]['data'][3]['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Last Login', $actual['data'][1]['data'][3]['name'] );
+ $this->assertSame( 'January 29, 2020 09:13 AM', $actual['data'][1]['data'][3]['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestswalkerphp"></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/walker.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/walker.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/walker.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,8 +26,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = $this->walker->walk( $items, 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->walker->get_number_of_root_elements( $items ) );
- $this->assertEquals( '<li>1</li>', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->walker->get_number_of_root_elements( $items ) );
+ $this->assertSame( '<li>1</li>', $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,8 +41,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = $this->walker->walk( $items, -1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->walker->get_number_of_root_elements( $items ) );
- $this->assertEquals( '<li>1</li>', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->walker->get_number_of_root_elements( $items ) );
+ $this->assertSame( '<li>1</li>', $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,8 +56,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = $this->walker->walk( $items, 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->walker->get_number_of_root_elements( $items ) );
- $this->assertEquals( '<li>1</li>', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->walker->get_number_of_root_elements( $items ) );
+ $this->assertSame( '<li>1</li>', $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,8 +76,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = $this->walker->walk( $items, 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $this->walker->get_number_of_root_elements( $items ) );
- $this->assertEquals( '<li>1</li><li>2</li>', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $this->walker->get_number_of_root_elements( $items ) );
+ $this->assertSame( '<li>1</li><li>2</li>', $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -96,8 +96,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = $this->walker->walk( $items, 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->walker->get_number_of_root_elements( $items ) );
- $this->assertEquals( '<li>1<ul><li>2</li></ul></li>', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->walker->get_number_of_root_elements( $items ) );
+ $this->assertSame( '<li>1<ul><li>2</li></ul></li>', $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -116,8 +116,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = $this->walker->walk( $items, -1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->walker->get_number_of_root_elements( $items ) );
- $this->assertEquals( '<li>1</li><li>2</li>', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->walker->get_number_of_root_elements( $items ) );
+ $this->assertSame( '<li>1</li><li>2</li>', $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -136,8 +136,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = $this->walker->walk( $items, 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->walker->get_number_of_root_elements( $items ) );
- $this->assertEquals( '<li>1</li>', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->walker->get_number_of_root_elements( $items ) );
+ $this->assertSame( '<li>1</li>', $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -160,8 +160,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = $this->walker->walk( $items, 2 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->walker->get_number_of_root_elements( $items ) );
- $this->assertEquals( '<li>1<ul><li>2</li></ul></li>', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->walker->get_number_of_root_elements( $items ) );
+ $this->assertSame( '<li>1<ul><li>2</li></ul></li>', $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -180,8 +180,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = $this->walker->walk( $items, 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $this->walker->get_number_of_root_elements( $items ) );
- $this->assertEquals( '<li>1<ul><li>2</li></ul></li>', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $this->walker->get_number_of_root_elements( $items ) );
+ $this->assertSame( '<li>1<ul><li>2</li></ul></li>', $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -196,8 +196,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = $this->walker->walk( $items, 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $this->walker->get_number_of_root_elements( $items ) );
- $this->assertEquals( '<li>1</li>', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $this->walker->get_number_of_root_elements( $items ) );
+ $this->assertSame( '<li>1</li>', $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -212,15 +212,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = $this->walker->walk( $items, 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $this->walker->get_number_of_root_elements( $items ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $this->walker->get_number_of_root_elements( $items ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // It's not clear what the output of this "should" be.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Currently the item is simply returned.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<li>1</li>', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<li>1</li>', $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // But as we've only asked for the first depth maybe nothing should be returned?
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // $this->assertEquals( '', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // $this->assertSame( '', $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -243,8 +243,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = $this->walker->walk( $items, 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $this->walker->get_number_of_root_elements( $items ) );
- $this->assertEquals( '<li>4</li><li>5</li><li>6</li>', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $this->walker->get_number_of_root_elements( $items ) );
+ $this->assertSame( '<li>4</li><li>5</li><li>6</li>', $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -267,18 +267,18 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = $this->walker->walk( $items, 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $this->walker->get_number_of_root_elements( $items ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $this->walker->get_number_of_root_elements( $items ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // It's not clear what the output of this "should" be.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Currently the first item is simply returned.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '<li>4</li>', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '<li>4</li>', $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // But as we've only asked for the first depth maybe nothing should be returned?
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // $this->assertEquals( '', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // $this->assertSame( '', $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Or maybe all items which are missing parents should simply be treat top level?
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // $this->assertEquals( '<li>4</li><li>5</li><li>6</li>', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // $this->assertSame( '<li>4</li><li>5</li><li>6</li>', $output );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestswidgetscustomhtmlwidgetphp"></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/widgets/custom-html-widget.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/widgets/custom-html-widget.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/widgets/custom-html-widget.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,10 +47,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_construct() {
</span><span class="cx" style="display: block; padding: 0 10px"> $widget = new WP_Widget_Custom_HTML();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'custom_html', $widget->id_base );
- $this->assertEquals( 'widget_custom_html', $widget->widget_options['classname'] );
- $this->assertEquals( 400, $widget->control_options['width'] );
- $this->assertEquals( 350, $widget->control_options['height'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'custom_html', $widget->id_base );
+ $this->assertSame( 'widget_custom_html', $widget->widget_options['classname'] );
+ $this->assertSame( 400, $widget->control_options['width'] );
+ $this->assertSame( 350, $widget->control_options['height'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $widget->widget_options['customize_selective_refresh'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,9 +64,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $widget = new WP_Widget_Custom_HTML();
</span><span class="cx" style="display: block; padding: 0 10px"> $widget->_register();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_action( 'admin_print_scripts-widgets.php', array( $widget, 'enqueue_admin_scripts' ) ) );
- $this->assertEquals( 10, has_action( 'admin_footer-widgets.php', array( 'WP_Widget_Custom_HTML', 'render_control_template_scripts' ) ) );
- $this->assertEquals( 10, has_action( 'admin_head-widgets.php', array( 'WP_Widget_Custom_HTML', 'add_help_text' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_action( 'admin_print_scripts-widgets.php', array( $widget, 'enqueue_admin_scripts' ) ) );
+ $this->assertSame( 10, has_action( 'admin_footer-widgets.php', array( 'WP_Widget_Custom_HTML', 'render_control_template_scripts' ) ) );
+ $this->assertSame( 10, has_action( 'admin_head-widgets.php', array( 'WP_Widget_Custom_HTML', 'add_help_text' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'wp.customHtmlWidgets.idBases.push( "custom_html" );', wp_scripts()->registered['custom-html-widgets']->extra['after'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,8 +117,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( '<p>', $output );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( '<br>', $output );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( '</u>', $output );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $text_widget_instance, $this->widget_text_args[1] );
- $this->assertEquals( $instance, $this->widget_custom_html_content_args[1] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $text_widget_instance, $this->widget_text_args[1] );
+ $this->assertSame( $instance, $this->widget_custom_html_content_args[1] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $widget, $this->widget_text_args[2] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $widget, $this->widget_custom_html_content_args[2] );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'widget_custom_html_content', array( $this, 'filter_widget_custom_html_content' ), 5 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -185,7 +185,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'content' => $instance['content'],
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $widget->update( $instance, array() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $result, $expected );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $result, $expected );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure KSES is applying as expected.
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'map_meta_cap', array( $this, 'grant_unfiltered_html_cap' ), 10, 2 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -193,7 +193,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $instance['content'] = '<script>alert( "Howdy!" );</script>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected['content'] = $instance['content'];
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $widget->update( $instance, array() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $result, $expected );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $result, $expected );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'map_meta_cap', array( $this, 'grant_unfiltered_html_cap' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'map_meta_cap', array( $this, 'revoke_unfiltered_html_cap' ), 10, 2 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -201,7 +201,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $instance['content'] = '<script>alert( "Howdy!" );</script>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected['content'] = wp_kses_post( $instance['content'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $widget->update( $instance, array() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $result, $expected );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $result, $expected );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'map_meta_cap', array( $this, 'revoke_unfiltered_html_cap' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestswidgetsmediaaudiowidgetphp"></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/widgets/media-audio-widget.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/widgets/media-audio-widget.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/widgets/media-audio-widget.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -94,7 +94,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'customize_selective_refresh', $widget->widget_options );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'description', $widget->widget_options );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $widget->widget_options['customize_selective_refresh'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'audio', $widget->widget_options['mime_type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'audio', $widget->widget_options['mime_type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'add_to_widget',
</span></span></pre></div>
<a id="trunktestsphpunittestswidgetsmediagallerywidgetphp"></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/widgets/media-gallery-widget.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/widgets/media-gallery-widget.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/widgets/media-gallery-widget.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -118,7 +118,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Field: title.
</span><span class="cx" style="display: block; padding: 0 10px"> $instance['title'] = 'Hello <b>World</b> ';
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = $widget->update( $instance, array() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Hello World', $instance['title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Hello World', $instance['title'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Field: ids.
</span><span class="cx" style="display: block; padding: 0 10px"> $instance['ids'] = '1,2,3';
</span></span></pre></div>
<a id="trunktestsphpunittestswidgetsmediaimagewidgetphp"></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/widgets/media-image-widget.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/widgets/media-image-widget.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/widgets/media-image-widget.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -101,7 +101,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'customize_selective_refresh', $widget->widget_options );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'description', $widget->widget_options );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $widget->widget_options['customize_selective_refresh'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'image', $widget->widget_options['mime_type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'image', $widget->widget_options['mime_type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'add_to_widget',
</span></span></pre></div>
<a id="trunktestsphpunittestswidgetsmediavideowidgetphp"></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/widgets/media-video-widget.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/widgets/media-video-widget.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/widgets/media-video-widget.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -95,7 +95,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'customize_selective_refresh', $widget->widget_options );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'description', $widget->widget_options );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $widget->widget_options['customize_selective_refresh'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'video', $widget->widget_options['mime_type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'video', $widget->widget_options['mime_type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSets(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'add_to_widget',
</span></span></pre></div>
<a id="trunktestsphpunittestswidgetsmediawidgetphp"></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/widgets/media-widget.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/widgets/media-widget.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/widgets/media-widget.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,10 +76,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array_keys( $widget->l10n )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( count( $widget->l10n ), count( array_filter( $widget->l10n ) ), 'Expected all translation strings to be defined.' );
- $this->assertEquals( 10, has_action( 'admin_print_scripts-widgets.php', array( $widget, 'enqueue_admin_scripts' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( count( $widget->l10n ), count( array_filter( $widget->l10n ) ), 'Expected all translation strings to be defined.' );
+ $this->assertSame( 10, has_action( 'admin_print_scripts-widgets.php', array( $widget, 'enqueue_admin_scripts' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_action( 'wp_enqueue_scripts', array( $widget, 'enqueue_preview_scripts' ) ), 'Did not expect preview scripts to be enqueued when not in customize preview context.' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_action( 'admin_footer-widgets.php', array( $widget, 'render_control_template_scripts' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_action( 'admin_footer-widgets.php', array( $widget, 'render_control_template_scripts' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // With non-default args.
</span><span class="cx" style="display: block; padding: 0 10px"> $id_base = 'media_pdf';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,8 +92,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'height' => 1100,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $widget = $this->get_mocked_class_instance( $id_base, $name, $widget_options, $control_options );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id_base, $widget->id_base );
- $this->assertEquals( $name, $widget->name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id_base, $widget->id_base );
+ $this->assertSame( $name, $widget->name );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Method assertArraySubset doesn't exist in phpunit versions compatible with PHP 5.2.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( method_exists( $this, 'assertArraySubset' ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -128,7 +128,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $widget = $this->get_mocked_class_instance();
</span><span class="cx" style="display: block; padding: 0 10px"> $widget->_register();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_action( 'wp_enqueue_scripts', array( $widget, 'enqueue_preview_scripts' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_action( 'wp_enqueue_scripts', array( $widget, 'enqueue_preview_scripts' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -169,10 +169,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $widget = $this->get_mocked_class_instance();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $widget->sanitize_token_list( 'What A false class with-token <a href="#">and link</a>' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'What A false class with-token a hrefand linka', $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'What A false class with-token a hrefand linka', $result );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $widget->sanitize_token_list( array( 'foo', '<i>bar', '">NO' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $result, 'foo ibar NO' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $result, 'foo ibar NO' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -339,8 +339,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $widget->widget( $args, $instance );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 3, $this->widget_instance_filter_args );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $instance, $this->widget_instance_filter_args[0] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $args, $this->widget_instance_filter_args[1] );
- $this->assertEquals( $widget, $this->widget_instance_filter_args[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $args, $this->widget_instance_filter_args[1] );
+ $this->assertSame( $widget, $this->widget_instance_filter_args[2] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $output = ob_get_clean();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '<h2>Foo</h2>', $output );
</span></span></pre></div>
<a id="trunktestsphpunittestswidgetstextwidgetphp"></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/widgets/text-widget.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/widgets/text-widget.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/widgets/text-widget.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,11 +48,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_construct() {
</span><span class="cx" style="display: block; padding: 0 10px"> $widget = new WP_Widget_Text();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'text', $widget->id_base );
- $this->assertEquals( 'widget_text', $widget->widget_options['classname'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'text', $widget->id_base );
+ $this->assertSame( 'widget_text', $widget->widget_options['classname'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $widget->widget_options['customize_selective_refresh'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 400, $widget->control_options['width'] );
- $this->assertEquals( 350, $widget->control_options['height'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 400, $widget->control_options['width'] );
+ $this->assertSame( 350, $widget->control_options['height'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,8 +65,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $widget = new WP_Widget_Text();
</span><span class="cx" style="display: block; padding: 0 10px"> $widget->_register();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_action( 'admin_print_scripts-widgets.php', array( $widget, 'enqueue_admin_scripts' ) ) );
- $this->assertEquals( 10, has_action( 'admin_footer-widgets.php', array( 'WP_Widget_Text', 'render_control_template_scripts' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_action( 'admin_print_scripts-widgets.php', array( $widget, 'enqueue_admin_scripts' ) ) );
+ $this->assertSame( 10, has_action( 'admin_footer-widgets.php', array( 'WP_Widget_Text', 'render_control_template_scripts' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'wp.textWidgets.idBases.push( "text" );', wp_scripts()->registered['text-widgets']->extra['after'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_action( 'wp_enqueue_scripts', array( $widget, 'enqueue_preview_scripts' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -97,7 +97,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $widget = new WP_Widget_Text();
</span><span class="cx" style="display: block; padding: 0 10px"> $widget->_register();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_action( 'wp_enqueue_scripts', array( $widget, 'enqueue_preview_scripts' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_action( 'wp_enqueue_scripts', array( $widget, 'enqueue_preview_scripts' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -173,9 +173,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '<p>', $output );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '<br />', $output );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $this->widget_text_args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $instance['text'], $this->widget_text_args[0] );
- $this->assertEquals( $instance, $this->widget_text_args[1] );
- $this->assertEquals( $widget, $this->widget_text_args[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $instance['text'], $this->widget_text_args[0] );
+ $this->assertSame( $instance, $this->widget_text_args[1] );
+ $this->assertSame( $widget, $this->widget_text_args[2] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $this->widget_text_content_args );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '[filter:widget_text]', $output );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( '[filter:widget_text_content]', $output );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -200,13 +200,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '<p>', $output );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '<br />', $output );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 3, $this->widget_text_args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_instance['text'], $this->widget_text_args[0] );
- $this->assertEquals( $expected_instance, $this->widget_text_args[1] );
- $this->assertEquals( $widget, $this->widget_text_args[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_instance['text'], $this->widget_text_args[0] );
+ $this->assertSame( $expected_instance, $this->widget_text_args[1] );
+ $this->assertSame( $widget, $this->widget_text_args[2] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 3, $this->widget_text_content_args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_instance['text'] . '[filter:widget_text]', $this->widget_text_content_args[0] );
- $this->assertEquals( $expected_instance, $this->widget_text_content_args[1] );
- $this->assertEquals( $widget, $this->widget_text_content_args[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_instance['text'] . '[filter:widget_text]', $this->widget_text_content_args[0] );
+ $this->assertSame( $expected_instance, $this->widget_text_content_args[1] );
+ $this->assertSame( $widget, $this->widget_text_content_args[2] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( wpautop( $expected_instance['text'] . '[filter:widget_text][filter:widget_text_content]' ), $output );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test with filter=true&visual=true, the upgraded widget, in 4.8.1 and above.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -224,13 +224,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '<p>', $output );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '<br />', $output );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 3, $this->widget_text_args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_instance['text'], $this->widget_text_args[0] );
- $this->assertEquals( $expected_instance, $this->widget_text_args[1] );
- $this->assertEquals( $widget, $this->widget_text_args[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_instance['text'], $this->widget_text_args[0] );
+ $this->assertSame( $expected_instance, $this->widget_text_args[1] );
+ $this->assertSame( $widget, $this->widget_text_args[2] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 3, $this->widget_text_content_args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_instance['text'] . '[filter:widget_text]', $this->widget_text_content_args[0] );
- $this->assertEquals( $expected_instance, $this->widget_text_content_args[1] );
- $this->assertEquals( $widget, $this->widget_text_content_args[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_instance['text'] . '[filter:widget_text]', $this->widget_text_content_args[0] );
+ $this->assertSame( $expected_instance, $this->widget_text_content_args[1] );
+ $this->assertSame( $widget, $this->widget_text_content_args[2] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( wpautop( $expected_instance['text'] . '[filter:widget_text][filter:widget_text_content]' ), $output );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test with filter=true&visual=true, the upgraded widget, in 4.8.1 and above.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -248,9 +248,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '<p>', $output );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '<br />', $output );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 3, $this->widget_text_args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_instance['text'], $this->widget_text_args[0] );
- $this->assertEquals( $expected_instance, $this->widget_text_args[1] );
- $this->assertEquals( $widget, $this->widget_text_args[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_instance['text'], $this->widget_text_args[0] );
+ $this->assertSame( $expected_instance, $this->widget_text_args[1] );
+ $this->assertSame( $widget, $this->widget_text_args[2] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $this->widget_text_content_args );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( wpautop( $expected_instance['text'] . '[filter:widget_text]' ), $output );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -269,9 +269,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( '<p>', $output );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( '<br />', $output );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 3, $this->widget_text_args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_instance['text'], $this->widget_text_args[0] );
- $this->assertEquals( $expected_instance, $this->widget_text_args[1] );
- $this->assertEquals( $widget, $this->widget_text_args[2] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_instance['text'], $this->widget_text_args[0] );
+ $this->assertSame( $expected_instance, $this->widget_text_args[1] );
+ $this->assertSame( $widget, $this->widget_text_args[2] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $this->widget_text_content_args );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $expected_instance['text'] . '[filter:widget_text]', $output );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -344,7 +344,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> $widget->widget( $args, $instance );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = ob_get_clean();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->shortcode_render_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->shortcode_render_count );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( '[example]', $output, 'Expected shortcode to be processed in legacy widget with plugin adding filter' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $this->example_shortcode_content, $output, 'Shortcode was applied without wpautop corrupting it.' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( '<p>' . $this->example_shortcode_content . '</p>', $output, 'Expected shortcode_unautop() to have run.' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -362,7 +362,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> $widget->widget( $args, $instance );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = ob_get_clean();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->shortcode_render_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->shortcode_render_count );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( '[example]', $output, 'Expected shortcode to be processed in legacy widget with plugin adding filter' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $this->example_shortcode_content, $output, 'Shortcode was applied without wpautop corrupting it.' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( '<p>' . $this->example_shortcode_content . '</p>', $output, 'Expected shortcode_unautop() to have run.' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -374,7 +374,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> $widget->widget( $args, $instance );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = ob_get_clean();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->shortcode_render_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->shortcode_render_count );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( '[example]', $output, 'Expected shortcode to be processed in legacy widget with plugin adding filter' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( wpautop( $this->example_shortcode_content ), $output, 'Shortcode was applied *with* wpautop() applying to shortcode output since plugin used legacy filter.' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $this->post_during_shortcode );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -390,16 +390,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Visual Text Widget with only core-added widget_text_content filter for do_shortcode().
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_filter( 'widget_text', 'do_shortcode' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 11, has_filter( 'widget_text_content', 'do_shortcode' ), 'Expected core to have set do_shortcode as widget_text_content filter.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 11, has_filter( 'widget_text_content', 'do_shortcode' ), 'Expected core to have set do_shortcode as widget_text_content filter.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->shortcode_render_count = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> $widget->widget( $args, $instance );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = ob_get_clean();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->shortcode_render_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->shortcode_render_count );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $this->example_shortcode_content, $output, 'Shortcode was applied without wpautop corrupting it.' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( '<p>' . $this->example_shortcode_content . '</p>', $output, 'Expected shortcode_unautop() to have run.' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_filter( 'widget_text', 'do_shortcode' ), 'The widget_text filter still lacks do_shortcode handler.' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 11, has_filter( 'widget_text_content', 'do_shortcode' ), 'The widget_text_content filter still has do_shortcode handler.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 11, has_filter( 'widget_text_content', 'do_shortcode' ), 'The widget_text_content filter still has do_shortcode handler.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $this->post_during_shortcode );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Visual Text Widget with both filters applied added, one from core and another via plugin.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -408,10 +408,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> $widget->widget( $args, $instance );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = ob_get_clean();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $this->shortcode_render_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $this->shortcode_render_count );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $this->example_shortcode_content, $output, 'Shortcode was applied without wpautop corrupting it.' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( '<p>' . $this->example_shortcode_content . '</p>', $output, 'Expected shortcode_unautop() to have run.' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 10, has_filter( 'widget_text', 'do_shortcode' ), 'Expected do_shortcode to be restored to widget_text.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 10, has_filter( 'widget_text', 'do_shortcode' ), 'Expected do_shortcode to be restored to widget_text.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $this->post_during_shortcode );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNull( $this->post_during_shortcode );
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'widget_text', 'do_shortcode' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -423,7 +423,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> $widget->widget( $args, $instance );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = ob_get_clean();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $this->shortcode_render_count );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $this->shortcode_render_count );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( '[example]', $output );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( $this->example_shortcode_content, $output );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_filter( 'widget_text', 'do_shortcode' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -730,7 +730,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'visual' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $widget->update( $instance, array() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $result );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $result );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( ! empty( $expected['filter'] ), 'Expected filter prop to be truthy, to handle case where 4.8 is downgraded to 4.7.' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'map_meta_cap', array( $this, 'grant_unfiltered_html_cap' ), 10, 2 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -738,7 +738,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $instance['text'] = '<script>alert( "Howdy!" );</script>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected['text'] = $instance['text'];
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $widget->update( $instance, array() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $result, 'KSES should apply as expected.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $result, 'KSES should apply as expected.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'map_meta_cap', array( $this, 'grant_unfiltered_html_cap' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'map_meta_cap', array( $this, 'revoke_unfiltered_html_cap' ), 10, 2 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -746,7 +746,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $instance['text'] = '<script>alert( "Howdy!" );</script>';
</span><span class="cx" style="display: block; padding: 0 10px"> $expected['text'] = wp_kses_post( $instance['text'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $widget->update( $instance, array() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $result, 'KSES should not apply since user can unfiltered_html.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $result, 'KSES should not apply since user can unfiltered_html.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'map_meta_cap', array( $this, 'revoke_unfiltered_html_cap' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -765,7 +765,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'filter' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $widget->update( $instance, array() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $instance, $result, 'Updating a widget without visual prop and explicit filter=false leaves visual prop absent' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $instance, $result, 'Updating a widget without visual prop and explicit filter=false leaves visual prop absent' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // --
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -774,7 +774,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'filter' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $widget->update( $instance, array() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $instance, $result, 'Updating a widget without visual prop and explicit filter=true leaves legacy prop absent.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $instance, $result, 'Updating a widget without visual prop and explicit filter=true leaves legacy prop absent.' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // --
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -795,7 +795,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $widget->update( $instance, $old_instance );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $result, 'Updating a pre-existing widget with visual mode forces filter to be true.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $result, 'Updating a pre-existing widget with visual mode forces filter to be true.' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // --
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -816,7 +816,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'visual' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $result, 'Updating a pre-existing visual widget retains visual mode when updated.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $result, 'Updating a pre-existing visual widget retains visual mode when updated.' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // --
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -837,7 +837,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'filter' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $result, 'Updating a pre-existing visual widget retains visual=true and supplies missing filter=true.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $result, 'Updating a pre-existing visual widget retains visual=true and supplies missing filter=true.' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // --
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -890,7 +890,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'filter' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $result, 'Updating a widget that previously had legacy form results in filter allowed to be false.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $result, 'Updating a widget that previously had legacy form results in filter allowed to be false.' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // --
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -906,7 +906,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'visual' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $result, 'Updating a widget that had \'content\' as its filter value persists non-legacy mode. This only existed in WP 4.8.0.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $result, 'Updating a widget that had \'content\' as its filter value persists non-legacy mode. This only existed in WP 4.8.0.' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // --
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -943,7 +943,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'visual' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $result, 'Updating a widget with filter=content (from WP 4.8.0) upgrades to filter=true&visual=true.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $result, 'Updating a widget with filter=content (from WP 4.8.0) upgrades to filter=true&visual=true.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestswidgetsphp"></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/widgets.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/widgets.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/widgets.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -155,7 +155,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num, count( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num, count( $result ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -288,7 +288,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * If the sidebar ID is invalid, the second argument passed to
</span><span class="cx" style="display: block; padding: 0 10px"> * the 'dynamic_sidebar_before' hook will be false.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( false, $this->valid_sidebar );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $this->valid_sidebar );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -349,7 +349,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> $retval = $widget->form( array() );
</span><span class="cx" style="display: block; padding: 0 10px"> $output = ob_get_clean();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'noform', $retval );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'noform', $retval );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'no-options-widget', $output );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -361,13 +361,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = 'Foo';
</span><span class="cx" style="display: block; padding: 0 10px"> $foo_widget = new WP_Widget( $id_base, $name );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id_base, $foo_widget->id_base );
- $this->assertEquals( $name, $foo_widget->name );
- $this->assertEquals( "widget_{$id_base}", $foo_widget->option_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id_base, $foo_widget->id_base );
+ $this->assertSame( $name, $foo_widget->name );
+ $this->assertSame( "widget_{$id_base}", $foo_widget->option_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'classname', $foo_widget->widget_options );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( "widget_{$id_base}", $foo_widget->widget_options['classname'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( "widget_{$id_base}", $foo_widget->widget_options['classname'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'id_base', $foo_widget->control_options );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $id_base, $foo_widget->control_options['id_base'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $id_base, $foo_widget->control_options['id_base'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $id_base = 'bar';
</span><span class="cx" style="display: block; padding: 0 10px"> $name = 'Bar';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -378,8 +378,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'id_base' => 'bar_id_base',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $bar_widget = new WP_Widget( $id_base, $name, $widget_options, $control_options );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $widget_options['classname'], $bar_widget->widget_options['classname'] );
- $this->assertEquals( $control_options['id_base'], $bar_widget->control_options['id_base'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $widget_options['classname'], $bar_widget->widget_options['classname'] );
+ $this->assertSame( $control_options['id_base'], $bar_widget->control_options['id_base'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -389,7 +389,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_widget_get_field_name( $expected, $value_to_test ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $widget = new WP_Widget( 'foo', 'Foo' );
</span><span class="cx" style="display: block; padding: 0 10px"> $widget->_set( 2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $widget->get_field_name( $value_to_test ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $widget->get_field_name( $value_to_test ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -439,7 +439,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_widget_get_field_id( $expected, $value_to_test ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $widget = new WP_Widget( 'foo', 'Foo' );
</span><span class="cx" style="display: block; padding: 0 10px"> $widget->_set( 2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected, $widget->get_field_id( $value_to_test ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected, $widget->get_field_id( $value_to_test ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -535,7 +535,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $option_value = get_option( 'widget_search' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( '_multiwidget', $option_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $option_value['_multiwidget'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $option_value['_multiwidget'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 2, $option_value );
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = $option_value[2];
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $instance );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -545,7 +545,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Pretend this widget is new.
</span><span class="cx" style="display: block; padding: 0 10px"> delete_option( 'widget_nav_menu' );
</span><span class="cx" style="display: block; padding: 0 10px"> $never_used = get_option( 'widget_nav_menu', array() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( array(), (array) $never_used );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( array(), (array) $never_used );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_widgets_init();
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_widget_search = $wp_registered_widgets['search-2']['callback'][0];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -555,12 +555,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 2, $settings );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $option_value as $widget_number => $instance ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $settings[ $widget_number ], $option_value[ $widget_number ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $settings[ $widget_number ], $option_value[ $widget_number ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // After widgets_init(), get_settings() should create the widget option.
</span><span class="cx" style="display: block; padding: 0 10px"> $never_used = get_option( 'widget_nav_menu' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, $never_used['_multiwidget'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, $never_used['_multiwidget'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 0, $never_used );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -592,7 +592,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $option_value = get_option( $wp_widget_search->option_name );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( '_multiwidget', $option_value );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $overridden_title, $option_value[2]['title'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $overridden_title, $option_value[2]['title'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -773,7 +773,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = retrieve_widgets( true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $result, $sidebars_widgets );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $result, $sidebars_widgets );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $sidebars_widgets as $widgets ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $widgets );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -798,7 +798,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'recent-comments-2', $sidebars_widgets['wp_inactive_widgets'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Sidebar_widgets option was updated.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $sidebars_widgets, wp_get_sidebars_widgets() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $sidebars_widgets, wp_get_sidebars_widgets() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -823,7 +823,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // $sidebars_widgets matches registered sidebars.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $result, $sidebars_widgets );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $result, $sidebars_widgets );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $sidebars_widgets as $widgets ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $widgets );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -862,7 +862,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_wp_sidebars_widgets = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $result, $sidebars_widgets );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $result, $sidebars_widgets );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $sidebars_widgets as $widgets ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $widgets );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -890,7 +890,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'recent-comments-2', $sidebars_widgets['wp_inactive_widgets'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Sidebar_widgets option was updated.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $sidebars_widgets, wp_get_sidebars_widgets() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $sidebars_widgets, wp_get_sidebars_widgets() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Reset.
</span><span class="cx" style="display: block; padding: 0 10px"> $sidebars_widgets = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -905,7 +905,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_wp_sidebars_widgets = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $result, $sidebars_widgets );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $result, $sidebars_widgets );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $sidebars_widgets as $widgets ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $widgets );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -930,7 +930,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'recent-comments-2', $sidebars_widgets['wp_inactive_widgets'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Sidebar_widgets option was updated.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $sidebars_widgets, wp_get_sidebars_widgets() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $sidebars_widgets, wp_get_sidebars_widgets() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -957,7 +957,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_wp_sidebars_widgets = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $result, $sidebars_widgets );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $result, $sidebars_widgets );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $sidebars_widgets as $widgets ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $widgets );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1037,7 +1037,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'orphaned_widgets_1', $sidebars_widgets );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Sidebar_widgets option was updated.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $sidebars_widgets, wp_get_sidebars_widgets() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $sidebars_widgets, wp_get_sidebars_widgets() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1062,7 +1062,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'fantasy', $filtered_widgets );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $filtered_widgets['fantasy'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'array_version', $filtered_widgets );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 3, $filtered_widgets['array_version'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 3, $filtered_widgets['array_version'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'integer', $filtered_widgets['array_version'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcbasicphp"></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/xmlrpc/basic.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/basic.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/basic.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,7 +13,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> // If disabled, 405 would result.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_login_pass_ok() {
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcclientphp"></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/xmlrpc/client.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/client.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/client.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -12,9 +12,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_ixr_client_allows_query_strings() {
</span><span class="cx" style="display: block; padding: 0 10px"> $client = new IXR_Client( 'http://example.com/server.php?this-is-needed=true#not-this' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'example.com', $client->server );
- $this->assertEquals( 80, $client->port );
- $this->assertEquals( '/server.php?this-is-needed=true', $client->path );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'example.com', $client->server );
+ $this->assertSame( 80, $client->port );
+ $this->assertSame( '/server.php?this-is-needed=true', $client->path );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,9 +22,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_ixr_client_allows_query_strings() {
</span><span class="cx" style="display: block; padding: 0 10px"> $client = new WP_HTTP_IXR_Client( 'http://example.com/server.php?this-is-needed=true#not-this' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'example.com', $client->server );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'example.com', $client->server );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $client->port );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '/server.php?this-is-needed=true', $client->path );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '/server.php?this-is-needed=true', $client->path );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcmtgetRecentPostTitlesphp"></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/xmlrpc/mt/getRecentPostTitles.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/mt/getRecentPostTitles.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/mt/getRecentPostTitles.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mt_getRecentPostTitles( array( 1, 'username', 'password' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_no_posts() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,7 +16,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mt_getRecentPostTitles( array( 1, 'author', 'author' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 500, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 500, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_no_editable_posts() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,7 +26,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mt_getRecentPostTitles( array( 1, 'author', 'author' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $result ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_date() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,8 +44,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'IXR_Date', $result['dateCreated'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'IXR_Date', $result['date_created_gmt'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( strtotime( $post->post_date ), $result['dateCreated']->getTimestamp() );
- $this->assertEquals( $date_gmt, $result['date_created_gmt']->getTimestamp() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( strtotime( $post->post_date ), $result['dateCreated']->getTimestamp() );
+ $this->assertSame( $date_gmt, $result['date_created_gmt']->getTimestamp() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcmweditPostphp"></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/xmlrpc/mw/editPost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/mw/editPost.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/mw/editPost.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,7 +9,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( 1, 'username', 'password', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_edit_own_post() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_title, $out->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_title, $out->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_capable_edit_others_post() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,7 +47,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_title, $out->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_title, $out->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_edit_others_post() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,10 +65,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'title' => $new_title );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $original_title, $out->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $original_title, $out->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_capable_reassign_author() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,7 +104,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'wp_author_id' => $author_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $contributor_id, $out->post_author );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -143,7 +143,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = wp_insert_post( $post );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_post_meta( $post_id, '_thumbnail_id', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_post_meta( $post_id, '_thumbnail_id', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Create attachment.
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = ( DIR_TESTDATA . '/images/a2-small.jpg' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -174,7 +174,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post5 = array( 'wp_post_thumbnail' => '' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'author', 'author', $post5 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_post_meta( $post_id, '_thumbnail_id', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_post_meta( $post_id, '_thumbnail_id', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_theme_support( 'post-thumbnails' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -199,7 +199,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post2['title'], $out->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post2['title'], $out->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post3 = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'description' => 'New Content',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -210,8 +210,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post2['title'], $out->post_title );
- $this->assertEquals( $post3['description'], $out->post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post2['title'], $out->post_title );
+ $this->assertSame( $post3['description'], $out->post_content );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post4 = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'mt_excerpt' => 'New Excerpt',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -222,9 +222,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post2['title'], $out->post_title );
- $this->assertEquals( $post3['description'], $out->post_content );
- $this->assertEquals( $post4['mt_excerpt'], $out->post_excerpt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post2['title'], $out->post_title );
+ $this->assertSame( $post3['description'], $out->post_content );
+ $this->assertSame( $post4['mt_excerpt'], $out->post_excerpt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -259,7 +259,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'post_type' => 'page' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $result->code, 401 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $result->code, 401 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -327,9 +327,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $after = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'future', $after->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'future', $after->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $future_date_string = strftime( '%Y-%m-%d %H:%M:%S', $future_time );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $future_date_string, $after->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $future_date_string, $after->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcmwgetPostphp"></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/xmlrpc/mw/getPost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/mw/getPost.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/mw/getPost.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,7 +24,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_getPost( array( self::$post_id, 'username', 'password' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,7 +32,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_getPost( array( self::$post_id, 'subscriber', 'subscriber' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,7 +41,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_postid() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_getPost( array( 9999, 'author', 'author' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_valid_post() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,13 +78,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check expected values.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result['userid'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_data->post_title, $result['title'] );
- $this->assertEquals( 'publish', $result['post_status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_data->post_title, $result['title'] );
+ $this->assertSame( 'publish', $result['post_status'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result['wp_author_id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_data->post_excerpt, $result['mt_excerpt'] );
- $this->assertEquals( url_to_postid( $result['link'] ), self::$post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_data->post_excerpt, $result['mt_excerpt'] );
+ $this->assertSame( url_to_postid( $result['link'] ), self::$post_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $result['wp_post_thumbnail'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $result['wp_post_thumbnail'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_theme_support( 'post-thumbnails' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -103,7 +103,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'int', $result['wp_post_thumbnail'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $attachment_id, $result['wp_post_thumbnail'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $attachment_id, $result['wp_post_thumbnail'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_theme_support( 'post-thumbnails' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -120,13 +120,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_data = get_post( self::$post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( strtotime( $post_data->post_date ), $result['dateCreated']->getTimestamp() );
- $this->assertEquals( strtotime( $post_data->post_date ), $result['date_modified']->getTimestamp() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( strtotime( $post_data->post_date ), $result['dateCreated']->getTimestamp() );
+ $this->assertSame( strtotime( $post_data->post_date ), $result['date_modified']->getTimestamp() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_date_gmt = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $post_data->post_date, false ), 'Ymd\TH:i:s' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $post_modified_gmt = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $post_data->post_date, false ), 'Ymd\TH:i:s' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_date_gmt, $result['date_created_gmt']->getTimestamp() );
- $this->assertEquals( $post_modified_gmt, $result['date_modified_gmt']->getTimestamp() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_date_gmt, $result['date_created_gmt']->getTimestamp() );
+ $this->assertSame( $post_modified_gmt, $result['date_modified_gmt']->getTimestamp() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcmwgetRecentPostsphp"></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/xmlrpc/mw/getRecentPosts.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/mw/getRecentPosts.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/mw/getRecentPosts.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,7 +25,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'username', 'password' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'subscriber', 'subscriber' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_no_editable_posts() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,7 +44,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'author', 'author' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $result ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_valid_post() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -82,13 +82,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Check expected values.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result['userid'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result['postid'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post->post_title, $result['title'] );
- $this->assertEquals( 'draft', $result['post_status'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post->post_title, $result['title'] );
+ $this->assertSame( 'draft', $result['post_status'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result['wp_author_id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post->post_excerpt, $result['mt_excerpt'] );
- $this->assertEquals( url_to_postid( $result['link'] ), $post->ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post->post_excerpt, $result['mt_excerpt'] );
+ $this->assertSame( url_to_postid( $result['link'] ), $post->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', $result['wp_post_thumbnail'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', $result['wp_post_thumbnail'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_theme_support( 'post-thumbnails' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -112,7 +112,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $result['wp_post_thumbnail'] ) || $result['postid'] === self::$post_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment_id = get_post_meta( $result['postid'], '_thumbnail_id', true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $attachment_id, $result['wp_post_thumbnail'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $attachment_id, $result['wp_post_thumbnail'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -135,10 +135,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'IXR_Date', $result['date_modified'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'IXR_Date', $result['date_modified_gmt'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( strtotime( $post->post_date ), $result['dateCreated']->getTimestamp() );
- $this->assertEquals( $date_gmt, $result['date_created_gmt']->getTimestamp() );
- $this->assertEquals( strtotime( $post->post_date ), $result['date_modified']->getTimestamp() );
- $this->assertEquals( $date_modified_gmt, $result['date_modified_gmt']->getTimestamp() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( strtotime( $post->post_date ), $result['dateCreated']->getTimestamp() );
+ $this->assertSame( $date_gmt, $result['date_created_gmt']->getTimestamp() );
+ $this->assertSame( strtotime( $post->post_date ), $result['date_modified']->getTimestamp() );
+ $this->assertSame( $date_modified_gmt, $result['date_modified_gmt']->getTimestamp() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcmwnewPostphp"></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/xmlrpc/mw/newPost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/mw/newPost.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/mw/newPost.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,7 +9,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'username', 'password', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -18,7 +18,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'subscriber', 'subscriber', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_no_content() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,8 +27,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 500, $result->code );
- $this->assertEquals( 'Content, title, and excerpt are empty.', $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 500, $result->code );
+ $this->assertSame( 'Content, title, and excerpt are empty.', $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_basic_content() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,7 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'contributor', 'contributor', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_capable_other_author() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -97,7 +97,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'contributor', 'contributor', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -112,7 +112,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_empty_author() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,7 +125,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $my_author_id, $out->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Test', $out->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Test', $out->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_post_thumbnail() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -157,7 +157,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_capable_set_post_type_as_page() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -172,8 +172,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Test', $out->post_title );
- $this->assertEquals( 'page', $out->post_type );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Test', $out->post_title );
+ $this->assertSame( 'page', $out->post_type );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -193,8 +193,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'post', $out->post_type );
- $this->assertEquals( 'draft', $out->post_status );
- $this->assertEquals( '0000-00-00 00:00:00', $out->post_date_gmt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'post', $out->post_type );
+ $this->assertSame( 'draft', $out->post_status );
+ $this->assertSame( '0000-00-00 00:00:00', $out->post_date_gmt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpdeletePostphp"></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/xmlrpc/wp/deletePost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/deletePost.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/deletePost.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'username', 'password', 0 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_post() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,7 +16,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'editor', 'editor', 340982340 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,7 +25,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'subscriber', 'subscriber', $post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_post_deleted() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,6 +37,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'trash', $post->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'trash', $post->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpdeleteTermphp"></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/xmlrpc/wp/deleteTerm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/deleteTerm.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/deleteTerm.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,7 +17,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'username', 'password', 'category', 0 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_empty_taxonomy() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,8 +25,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber', '', 0 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
- $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
+ $this->assertSame( __( 'Invalid taxonomy.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_taxonomy() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,8 +34,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber', 'not_existing', 0 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
- $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
+ $this->assertSame( __( 'Invalid taxonomy.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,8 +43,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber', 'category', self::$term_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
- $this->assertEquals( __( 'Sorry, you are not allowed to delete this term.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
+ $this->assertSame( __( 'Sorry, you are not allowed to delete this term.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_empty_term() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,8 +52,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'editor', 'editor', 'category', '' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 500, $result->code );
- $this->assertEquals( __( 'Empty Term.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 500, $result->code );
+ $this->assertSame( __( 'Empty Term.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_term() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -61,8 +61,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'editor', 'editor', 'category', 9999 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $result->code );
- $this->assertEquals( __( 'Invalid term ID.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $result->code );
+ $this->assertSame( __( 'Invalid term ID.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_term_deleted() {
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpeditCommentphp"></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/xmlrpc/wp/editComment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/editComment.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/editComment.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,8 +59,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editComment( array( 1, 'author', 'author', $comment_id, array( 'status' => 'hold' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
- $this->assertEquals( __( 'Sorry, you are not allowed to moderate or edit this comment.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
+ $this->assertSame( __( 'Sorry, you are not allowed to moderate or edit this comment.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_trash_comment() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,7 +77,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $comment_id = wp_insert_comment( $comment_data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '1', get_comment( $comment_id )->comment_approved );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '1', get_comment( $comment_id )->comment_approved );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->myxmlrpcserver->wp_editComment(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -91,6 +91,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'trash', get_comment( $comment_id )->comment_approved );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'trash', get_comment( $comment_id )->comment_approved );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpeditPostphp"></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/xmlrpc/wp/editPost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/editPost.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/editPost.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'username', 'password', 0, array() ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_edit_own_post() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_title, $out->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_title, $out->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_capable_edit_others_post() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,7 +47,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_title, $out->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_title, $out->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_edit_others_post() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,10 +65,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'post_title' => $new_title );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'contributor', 'contributor', $post_id, $post2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $original_title, $out->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $original_title, $out->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_capable_reassign_author() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,7 +104,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array( 'post_author' => $author_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'contributor', 'contributor', $post_id, $post2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $contributor_id, $out->post_author );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -143,7 +143,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = wp_insert_post( $post );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_post_meta( $post_id, '_thumbnail_id', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_post_meta( $post_id, '_thumbnail_id', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Create attachment.
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = ( DIR_TESTDATA . '/images/a2-small.jpg' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -181,13 +181,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post5 = array( 'post_thumbnail' => '' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'author', 'author', $post_id, $post5 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '', get_post_meta( $post_id, '_thumbnail_id', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '', get_post_meta( $post_id, '_thumbnail_id', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Use invalid ID.
</span><span class="cx" style="display: block; padding: 0 10px"> $post6 = array( 'post_thumbnail' => 398420983409 );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'author', 'author', $post_id, $post6 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_theme_support( 'post-thumbnails' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -226,14 +226,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_title, $out->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_title, $out->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $edited_object = get_metadata_by_mid( 'post', $mid_edit );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '87654321', $edited_object->meta_value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '87654321', $edited_object->meta_value );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( get_metadata_by_mid( 'post', $mid_delete ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $created_object = get_post_meta( $post_id, 'custom_field_to_create', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $created_object, '12345678' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $created_object, '12345678' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_capable_unsticky() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -287,7 +287,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the edit went through.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'First edit', get_post( $post_id )->post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'First edit', get_post( $post_id )->post_content );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Modify it again. We think it was last modified yesterday, but we actually just modified it above.
</span><span class="cx" style="display: block; padding: 0 10px"> $struct = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -296,10 +296,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $struct ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 409, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 409, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the edit did not go through.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'First edit', get_post( $post_id )->post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'First edit', get_post( $post_id )->post_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_edit_attachment() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -320,7 +320,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure that the post status is still inherit.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'inherit', get_post( $post_id )->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'inherit', get_post( $post_id )->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_use_invalid_post_status() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -339,7 +339,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure that the post status is still inherit.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'draft', get_post( $post_id )->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'draft', get_post( $post_id )->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -367,7 +367,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Updated', get_post( $post_id )->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Updated', get_post( $post_id )->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $term_ids = wp_list_pluck( get_the_category( $post_id ), 'term_id' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $term_id, $term_ids );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -394,7 +394,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $new_post_content ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Updated', get_post( $post_id )->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Updated', get_post( $post_id )->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $term_ids = wp_list_pluck( get_the_category( $post_id ), 'term_id' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( $term_id, $term_ids );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -436,13 +436,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_post_meta( $post_id, 'enclosure', $enclosure_string );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify that the correct data is there.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $enclosure_string, get_post_meta( $post_id, 'enclosure', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $enclosure_string, get_post_meta( $post_id, 'enclosure', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Attempt to add the enclosure a second time.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->myxmlrpcserver->add_enclosure_if_new( $post_id, $enclosure );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify that there is only a single value in the array and that a duplicate is not present.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( get_post_meta( $post_id, 'enclosure' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( get_post_meta( $post_id, 'enclosure' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // For good measure, check that the expected value is in the array.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( in_array( $enclosure_string, get_post_meta( $post_id, 'enclosure' ), true ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -451,7 +451,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->myxmlrpcserver->add_enclosure_if_new( $post_id, $new_enclosure );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Having added the new enclosure, 2 values are expected in the array.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, count( get_post_meta( $post_id, 'enclosure' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, count( get_post_meta( $post_id, 'enclosure' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check that the new enclosure is in the enclosure meta.
</span><span class="cx" style="display: block; padding: 0 10px"> $new_enclosure_string = "{$new_enclosure['url']}\n{$new_enclosure['length']}\n{$new_enclosure['type']}\n";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -491,10 +491,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $new_post_content ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $after = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'future', $after->post_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'future', $after->post_status );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $future_date_string = strftime( '%Y-%m-%d %H:%M:%S', $future_time );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $future_date_string, $after->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $future_date_string, $after->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -511,7 +511,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $before = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0000-00-00 00:00:00', $before->post_date_gmt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0000-00-00 00:00:00', $before->post_date_gmt );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Edit the post without specifying any dates.
</span><span class="cx" style="display: block; padding: 0 10px"> $new_post_content = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -523,6 +523,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The published date should still be zero.
</span><span class="cx" style="display: block; padding: 0 10px"> $after = get_post( $post_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0000-00-00 00:00:00', $after->post_date_gmt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0000-00-00 00:00:00', $after->post_date_gmt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpeditProfilephp"></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/xmlrpc/wp/editProfile.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/editProfile.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/editProfile.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,7 +9,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editProfile( array( 1, 'username', 'password', array() ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_subscriber_profile() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -30,13 +30,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify that the new values were stored.
</span><span class="cx" style="display: block; padding: 0 10px"> $user_data = get_userdata( $subscriber_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $new_data['first_name'], $user_data->first_name );
- $this->assertEquals( $new_data['last_name'], $user_data->last_name );
- $this->assertEquals( $new_data['url'], $user_data->user_url );
- $this->assertEquals( $new_data['display_name'], $user_data->display_name );
- $this->assertEquals( $new_data['nickname'], $user_data->nickname );
- $this->assertEquals( $new_data['nicename'], $user_data->user_nicename );
- $this->assertEquals( $new_data['bio'], $user_data->description );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $new_data['first_name'], $user_data->first_name );
+ $this->assertSame( $new_data['last_name'], $user_data->last_name );
+ $this->assertSame( $new_data['url'], $user_data->user_url );
+ $this->assertSame( $new_data['display_name'], $user_data->display_name );
+ $this->assertSame( $new_data['nickname'], $user_data->nickname );
+ $this->assertSame( $new_data['nicename'], $user_data->user_nicename );
+ $this->assertSame( $new_data['bio'], $user_data->description );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_ignore_password_change() {
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpeditTermphp"></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/xmlrpc/wp/editTerm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/editTerm.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/editTerm.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,7 +29,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'username', 'password', 'category', 1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_empty_taxonomy() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,8 +37,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', '', array( 'taxonomy' => '' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
- $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
+ $this->assertSame( __( 'Invalid taxonomy.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_taxonomy() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,8 +46,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', self::$parent_term, array( 'taxonomy' => 'not_existing' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
- $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
+ $this->assertSame( __( 'Invalid taxonomy.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,8 +55,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', self::$parent_term, array( 'taxonomy' => 'category' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
- $this->assertEquals( __( 'Sorry, you are not allowed to edit this term.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
+ $this->assertSame( __( 'Sorry, you are not allowed to edit this term.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_term_not_exists() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,8 +64,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', 9999, array( 'taxonomy' => 'category' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $result->code );
- $this->assertEquals( __( 'Invalid term ID.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $result->code );
+ $this->assertSame( __( 'Invalid term ID.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_empty_term() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -73,8 +73,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', '', array( 'taxonomy' => 'category' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 500, $result->code );
- $this->assertEquals( __( 'Empty Term.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 500, $result->code );
+ $this->assertSame( __( 'Empty Term.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_empty_term_name() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -93,8 +93,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
- $this->assertEquals( __( 'The term name cannot be empty.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
+ $this->assertSame( __( 'The term name cannot be empty.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_parent_for_nonhierarchical() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,8 +113,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
- $this->assertEquals( __( 'Cannot set parent term, taxonomy is not hierarchical.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
+ $this->assertSame( __( 'Cannot set parent term, taxonomy is not hierarchical.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_parent_empty() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -178,7 +178,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 500, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 500, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_parent_not_existing() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -198,8 +198,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
- $this->assertEquals( __( 'Parent term does not exist.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
+ $this->assertSame( __( 'Parent term does not exist.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_parent_duplicate_slug() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -219,8 +219,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 500, $result->code );
- $this->assertEquals( htmlspecialchars( sprintf( __( 'The slug “%s” is already in use by another term.' ), $parent_term->slug ) ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 500, $result->code );
+ $this->assertSame( htmlspecialchars( sprintf( __( 'The slug “%s” is already in use by another term.' ), $parent_term->slug ) ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_edit_all_fields() {
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetCommentphp"></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/xmlrpc/wp/getComment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getComment.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getComment.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getComment( array( 1, 'username', 'password', self::$parent_comment_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,7 +44,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getComment( array( 1, 'contributor', 'contributor', self::$parent_comment_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_valid_comment() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -76,11 +76,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result['post_id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( self::$parent_comment_id, $result['comment_id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( 0, $result['parent'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$parent_comment_data['comment_content'], $result['content'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$parent_comment_data['comment_content'], $result['content'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( self::$post_id, $result['post_id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( self::$parent_comment_data['comment_author'], $result['author'] );
- $this->assertEquals( self::$parent_comment_data['comment_author_url'], $result['author_url'] );
- $this->assertEquals( self::$parent_comment_data['comment_author_email'], $result['author_email'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( self::$parent_comment_data['comment_author'], $result['author'] );
+ $this->assertSame( self::$parent_comment_data['comment_author_url'], $result['author_url'] );
+ $this->assertSame( self::$parent_comment_data['comment_author_email'], $result['author_email'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_valid_child_comment() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -98,6 +98,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getComment( array( 1, 'editor', 'editor', 123456789 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetCommentsphp"></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/xmlrpc/wp/getComments.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getComments.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getComments.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,7 +9,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getComments( array( 1, 'username', 'password', array() ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,7 +17,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getComments( array( 1, 'contributor', 'contributor', array() ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_capable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,7 +31,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $results as $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $comment = get_comment( $result['comment_id'], ARRAY_A );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $comment['comment_post_ID'], $result['post_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $comment['comment_post_ID'], $result['post_id'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -134,7 +134,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getComments( array( 1, 'contributor', 'contributor' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_author_capabilities() {
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetMediaItemphp"></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/xmlrpc/wp/getMediaItem.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getMediaItem.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getMediaItem.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,7 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getMediaItem( array( 1, 'username', 'password', 0 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_valid_media_item() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,8 +62,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check expected values.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result['attachment_id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->attachment_data['post_title'], $result['title'] );
- $this->assertEquals( wp_get_attachment_url( $this->attachment_id ), $result['link'] );
- $this->assertEquals( wp_get_attachment_thumb_url( $this->attachment_id ), $result['thumbnail'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->attachment_data['post_title'], $result['title'] );
+ $this->assertSame( wp_get_attachment_url( $this->attachment_id ), $result['link'] );
+ $this->assertSame( wp_get_attachment_thumb_url( $this->attachment_id ), $result['thumbnail'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetOptionsphp"></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/xmlrpc/wp/getOptions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getOptions.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getOptions.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getOptions( array( 1, 'username', 'password' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_valid_username_password() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,7 +16,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getOptions( array( 1, 'subscriber', 'subscriber' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'WordPress', $result['software_name']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'WordPress', $result['software_name']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_option_value() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,7 +25,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getOptions( array( 1, 'administrator', 'administrator', 'default_comment_status' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'default_comment_status' ), $result['default_comment_status']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'default_comment_status' ), $result['default_comment_status']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $result['default_comment_status']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,83 +40,83 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Read-only options.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'WordPress', $result['software_name']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'WordPress', $result['software_name']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['software_name']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $wp_version, $result['software_version']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $wp_version, $result['software_version']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['software_version']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_site_url(), $result['blog_url']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_site_url(), $result['blog_url']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['blog_url']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_login_url(), $result['login_url']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_login_url(), $result['login_url']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['login_url']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_admin_url(), $result['admin_url']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_admin_url(), $result['admin_url']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['admin_url']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'image_default_link_type' ), $result['image_default_link_type']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'image_default_link_type' ), $result['image_default_link_type']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['image_default_link_type']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'image_default_size' ), $result['image_default_size']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'image_default_size' ), $result['image_default_size']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['image_default_size']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'image_default_align' ), $result['image_default_align']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'image_default_align' ), $result['image_default_align']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['image_default_align']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_template(), $result['template']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_template(), $result['template']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['template']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_stylesheet(), $result['stylesheet']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_stylesheet(), $result['stylesheet']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['stylesheet']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( current_theme_supports( 'post-thumbnails' ), $result['post_thumbnail']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( current_theme_supports( 'post-thumbnails' ), $result['post_thumbnail']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['post_thumbnail']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Updatable options.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'gmt_offset' ), $result['time_zone']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'gmt_offset' ), $result['time_zone']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['time_zone']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'blogname' ), $result['blog_title']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'blogname' ), $result['blog_title']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['blog_title']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'blogdescription' ), $result['blog_tagline']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'blogdescription' ), $result['blog_tagline']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['blog_tagline']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'date_format' ), $result['date_format']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'date_format' ), $result['date_format']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['date_format']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'time_format' ), $result['time_format']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'time_format' ), $result['time_format']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['time_format']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'users_can_register' ), $result['users_can_register']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'users_can_register' ), $result['users_can_register']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['users_can_register']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'thumbnail_size_w' ), $result['thumbnail_size_w']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'thumbnail_size_w' ), $result['thumbnail_size_w']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['thumbnail_size_w']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'thumbnail_size_h' ), $result['thumbnail_size_h']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'thumbnail_size_h' ), $result['thumbnail_size_h']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['thumbnail_size_h']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'thumbnail_crop' ), $result['thumbnail_crop']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'thumbnail_crop' ), $result['thumbnail_crop']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['thumbnail_crop']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'medium_size_w' ), $result['medium_size_w']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'medium_size_w' ), $result['medium_size_w']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['medium_size_w']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'medium_size_h' ), $result['medium_size_h']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'medium_size_h' ), $result['medium_size_h']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['medium_size_h']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'large_size_w' ), $result['large_size_w']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'large_size_w' ), $result['large_size_w']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['large_size_w']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'large_size_h' ), $result['large_size_h']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'large_size_h' ), $result['large_size_h']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['large_size_h']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'default_comment_status' ), $result['default_comment_status']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'default_comment_status' ), $result['default_comment_status']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['default_comment_status']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'default_ping_status' ), $result['default_ping_status']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'default_ping_status' ), $result['default_ping_status']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['default_ping_status']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -129,83 +129,83 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Read-only options.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'WordPress', $result['software_name']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'WordPress', $result['software_name']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['software_name']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $wp_version, $result['software_version']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $wp_version, $result['software_version']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['software_version']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_site_url(), $result['blog_url']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_site_url(), $result['blog_url']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['blog_url']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( wp_login_url(), $result['login_url']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( wp_login_url(), $result['login_url']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['login_url']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_admin_url(), $result['admin_url']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_admin_url(), $result['admin_url']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['admin_url']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'image_default_link_type' ), $result['image_default_link_type']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'image_default_link_type' ), $result['image_default_link_type']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['image_default_link_type']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'image_default_size' ), $result['image_default_size']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'image_default_size' ), $result['image_default_size']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['image_default_size']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'image_default_align' ), $result['image_default_align']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'image_default_align' ), $result['image_default_align']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['image_default_align']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_template(), $result['template']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_template(), $result['template']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['template']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_stylesheet(), $result['stylesheet']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_stylesheet(), $result['stylesheet']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['stylesheet']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( current_theme_supports( 'post-thumbnails' ), $result['post_thumbnail']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( current_theme_supports( 'post-thumbnails' ), $result['post_thumbnail']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result['post_thumbnail']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Updatable options.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'gmt_offset' ), $result['time_zone']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'gmt_offset' ), $result['time_zone']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $result['time_zone']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'blogname' ), $result['blog_title']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'blogname' ), $result['blog_title']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $result['blog_title']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'blogdescription' ), $result['blog_tagline']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'blogdescription' ), $result['blog_tagline']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $result['blog_tagline']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'date_format' ), $result['date_format']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'date_format' ), $result['date_format']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $result['date_format']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'time_format' ), $result['time_format']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'time_format' ), $result['time_format']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $result['time_format']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'users_can_register' ), $result['users_can_register']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'users_can_register' ), $result['users_can_register']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $result['users_can_register']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'thumbnail_size_w' ), $result['thumbnail_size_w']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'thumbnail_size_w' ), $result['thumbnail_size_w']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $result['thumbnail_size_w']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'thumbnail_size_h' ), $result['thumbnail_size_h']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'thumbnail_size_h' ), $result['thumbnail_size_h']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $result['thumbnail_size_h']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'thumbnail_crop' ), $result['thumbnail_crop']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'thumbnail_crop' ), $result['thumbnail_crop']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $result['thumbnail_crop']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'medium_size_w' ), $result['medium_size_w']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'medium_size_w' ), $result['medium_size_w']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $result['medium_size_w']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'medium_size_h' ), $result['medium_size_h']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'medium_size_h' ), $result['medium_size_h']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $result['medium_size_h']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'large_size_w' ), $result['large_size_w']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'large_size_w' ), $result['large_size_w']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $result['large_size_w']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'large_size_h' ), $result['large_size_h']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'large_size_h' ), $result['large_size_h']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $result['large_size_h']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'default_comment_status' ), $result['default_comment_status']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'default_comment_status' ), $result['default_comment_status']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $result['default_comment_status']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( get_option( 'default_ping_status' ), $result['default_ping_status']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( get_option( 'default_ping_status' ), $result['default_ping_status']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $result['default_ping_status']['readonly'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetPagephp"></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/xmlrpc/wp/getPage.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getPage.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getPage.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,7 +25,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPage( array( 1, self::$post_id, 'username', 'password' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPage( array( 1, 9999, 'editor', 'editor' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_valid_page() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -73,10 +73,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check expected values.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result['userid'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'future', $result['page_status'] );
- $this->assertEquals( $post_data->post_title, $result['title'] );
- $this->assertEquals( url_to_postid( $result['link'] ), self::$post_id );
- $this->assertEquals( $post_data->post_excerpt, $result['excerpt'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'future', $result['page_status'] );
+ $this->assertSame( $post_data->post_title, $result['title'] );
+ $this->assertSame( url_to_postid( $result['link'] ), self::$post_id );
+ $this->assertSame( $post_data->post_excerpt, $result['excerpt'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result['wp_author_id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -93,7 +93,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $date_gmt = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $post_data->post_date, false ), 'Ymd\TH:i:s' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( strtotime( $post_data->post_date ), $result['dateCreated']->getTimestamp() );
- $this->assertEquals( $date_gmt, $result['date_created_gmt']->getTimestamp() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( strtotime( $post_data->post_date ), $result['dateCreated']->getTimestamp() );
+ $this->assertSame( $date_gmt, $result['date_created_gmt']->getTimestamp() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetPageListphp"></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/xmlrpc/wp/getPageList.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getPageList.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getPageList.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,7 +25,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPageList( array( 1, 'username', 'password' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPageList( array( 1, 'contributor', 'contributor' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_date() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,8 +49,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'IXR_Date', $result->dateCreated );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'IXR_Date', $result->date_created_gmt );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( strtotime( $page->post_date ), $result->dateCreated->getTimestamp() );
- $this->assertEquals( $date_gmt, $result->date_created_gmt->getTimestamp() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( strtotime( $page->post_date ), $result->dateCreated->getTimestamp() );
+ $this->assertSame( $date_gmt, $result->date_created_gmt->getTimestamp() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetPagesphp"></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/xmlrpc/wp/getPages.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getPages.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getPages.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPages( array( 1, 'username', 'password' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,7 +41,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPages( array( 1, 'contributor', 'contributor' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_capable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -50,7 +50,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $results as $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $page = get_post( $result['page_id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $page->post_type, 'page' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $page->post_type, 'page' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetPostphp"></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/xmlrpc/wp/getPost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getPost.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getPost.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,7 +31,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'username', 'password', 1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_valid_post() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,15 +65,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check expected values.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result['post_id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->post_data['post_title'], $result['post_title'] );
- $this->assertEquals( 'draft', $result['post_status'] );
- $this->assertEquals( 'post', $result['post_type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->post_data['post_title'], $result['post_title'] );
+ $this->assertSame( 'draft', $result['post_status'] );
+ $this->assertSame( 'post', $result['post_type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result['post_author'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->post_data['post_excerpt'], $result['post_excerpt'] );
- $this->assertEquals( $this->post_data['post_content'], $result['post_content'] );
- $this->assertEquals( url_to_postid( $result['link'] ), $this->post_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->post_data['post_excerpt'], $result['post_excerpt'] );
+ $this->assertSame( $this->post_data['post_content'], $result['post_content'] );
+ $this->assertSame( url_to_postid( $result['link'] ), $this->post_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $this->post_custom_field['id'], $result['custom_fields'][0]['id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->post_custom_field['key'], $result['custom_fields'][0]['key'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->post_custom_field['key'], $result['custom_fields'][0]['key'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $this->post_custom_field['value'], $result['custom_fields'][0]['value'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_theme_support( 'post-thumbnails' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -85,8 +85,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $result );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // When no fields are requested, only the IDs should be returned.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $result ) );
- $this->assertEquals( array( 'post_id' ), array_keys( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $result ) );
+ $this->assertSame( array( 'post_id' ), array_keys( $result ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_default_fields() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -109,14 +109,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'IXR_Date', $result['post_modified'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInstanceOf( 'IXR_Date', $result['post_modified_gmt'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->post_date_ts, $result['post_date']->getTimestamp() );
- $this->assertEquals( $this->post_date_ts, $result['post_modified']->getTimestamp() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->post_date_ts, $result['post_date']->getTimestamp() );
+ $this->assertSame( $this->post_date_ts, $result['post_modified']->getTimestamp() );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_date_gmt = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $this->post_data['post_date'], false ), 'Ymd\TH:i:s' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $post_modified_gmt = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $this->post_data['post_date'], false ), 'Ymd\TH:i:s' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $post_date_gmt, $result['post_date_gmt']->getTimestamp() );
- $this->assertEquals( $post_modified_gmt, $result['post_modified_gmt']->getTimestamp() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $post_date_gmt, $result['post_date_gmt']->getTimestamp() );
+ $this->assertSame( $post_modified_gmt, $result['post_modified_gmt']->getTimestamp() );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -143,8 +143,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result['guid'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'string', $result['post_mime_type'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'page', $result['post_type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'page', $result['post_type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $parent_page_id, $result['post_parent'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 2, $result['menu_order'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 2, $result['menu_order'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetPostTypephp"></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/xmlrpc/wp/getPostType.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getPostType.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getPostType.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,7 +32,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'username', 'password', 'post' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_post_type_name() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,7 +40,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'editor', 'editor', 'foobar' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_valid_post_type_name() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,7 +55,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'subscriber', 'subscriber', 'post' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_valid_type() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -124,9 +124,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check expected values.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $this->cpt_name, $result['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $this->cpt_name, $result['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $this->cpt_args as $key => $value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $value, $result[ $key ] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $value, $result[ $key ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetPostTypesphp"></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/xmlrpc/wp/getPostTypes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getPostTypes.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getPostTypes.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,7 +7,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPostTypes( array( 1, 'username', 'password', 'post' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,7 +16,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPostTypes( array( 1, 'subscriber', 'subscriber' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $result ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_capable_user() {
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetPostsphp"></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/xmlrpc/wp/getPosts.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getPosts.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getPosts.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'username', 'password' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -19,12 +19,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'subscriber', 'subscriber' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 'post_type' => 'page' );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'subscriber', 'subscriber', $filter ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_capable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,7 +71,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $results );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_posts, count( $results ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_posts, count( $results ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Page through results.
</span><span class="cx" style="display: block; padding: 0 10px"> $posts_found = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,7 +83,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filter['offset'] += $filter['number'];
</span><span class="cx" style="display: block; padding: 0 10px"> } while ( count( $presults ) > 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify that $post_ids matches $posts_found.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( array_diff( $post_ids, $posts_found ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( array_diff( $post_ids, $posts_found ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add comments to some of the posts.
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $post_ids as $key => $post_id ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,7 +117,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $results3 = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter3 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $results3 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $results3 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $results3 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $post->ID, $results3[0]['post_id'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_post_type( $cpt_name );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -159,13 +159,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 's' => 'Third' );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $results );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $results ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $results ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Search for one of them.
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 's' => 'First:' );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $results );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $results ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $results ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetProfilephp"></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/xmlrpc/wp/getProfile.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getProfile.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getProfile.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,7 +9,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getProfile( array( 1, 'username', 'password' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_subscriber() {
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetRevisionsphp"></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/xmlrpc/wp/getRevisions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getRevisions.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getRevisions.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'username', 'password', 0 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -18,7 +18,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'subscriber', 'subscriber', $post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_capable_user() {
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetTaxonomiesphp"></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/xmlrpc/wp/getTaxonomies.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getTaxonomies.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getTaxonomies.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTaxonomies( array( 1, 'username', 'password' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_taxonomy_validated() {
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetTaxonomyphp"></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/xmlrpc/wp/getTaxonomy.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getTaxonomy.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getTaxonomy.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'username', 'password', 'category' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_empty_taxonomy() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,8 +16,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'editor', 'editor', '' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
- $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
+ $this->assertSame( __( 'Invalid taxonomy.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_taxonomy() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,8 +25,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'editor', 'editor', 'not_existing' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
- $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
+ $this->assertSame( __( 'Invalid taxonomy.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,8 +34,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'subscriber', 'subscriber', 'category' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
- $this->assertEquals( __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
+ $this->assertSame( __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_taxonomy_validated() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,13 +51,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'editor', 'editor', 'category' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $taxonomy = get_taxonomy( 'category' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'category', $result['name'], 'name' );
- $this->assertEquals( true, $result['_builtin'], '_builtin' );
- $this->assertEquals( $taxonomy->show_ui, $result['show_ui'], 'show_ui' );
- $this->assertEquals( $taxonomy->public, $result['public'], 'public' );
- $this->assertEquals( $taxonomy->hierarchical, $result['hierarchical'], 'hierarchical' );
- $this->assertEquals( (array) $taxonomy->labels, $result['labels'], 'labels' );
- $this->assertEquals( (array) $taxonomy->cap, $result['cap'], 'capabilities' );
- $this->assertEquals( (array) $taxonomy->object_type, $result['object_type'], 'object_types' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'category', $result['name'], 'name' );
+ $this->assertTrue( $result['_builtin'], '_builtin' );
+ $this->assertSame( $taxonomy->show_ui, $result['show_ui'], 'show_ui' );
+ $this->assertSame( $taxonomy->public, $result['public'], 'public' );
+ $this->assertSame( $taxonomy->hierarchical, $result['hierarchical'], 'hierarchical' );
+ $this->assertSame( (array) $taxonomy->labels, $result['labels'], 'labels' );
+ $this->assertSame( (array) $taxonomy->cap, $result['cap'], 'capabilities' );
+ $this->assertSame( (array) $taxonomy->object_type, $result['object_type'], 'object_types' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetTermphp"></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/xmlrpc/wp/getTerm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getTerm.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getTerm.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -18,7 +18,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'username', 'password', 'category', 1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_empty_taxonomy() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,8 +26,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', '', 0 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
- $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
+ $this->assertSame( __( 'Invalid taxonomy.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_taxonomy() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -35,8 +35,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'not_existing', 0 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
- $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
+ $this->assertSame( __( 'Invalid taxonomy.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,8 +44,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'subscriber', 'subscriber', 'category', self::$term_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
- $this->assertEquals( __( 'Sorry, you are not allowed to assign this term.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
+ $this->assertSame( __( 'Sorry, you are not allowed to assign this term.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,8 +54,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'category', '' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 500, $result->code );
- $this->assertEquals( __( 'Empty Term.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 500, $result->code );
+ $this->assertSame( __( 'Empty Term.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_term() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,8 +63,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'category', 9999 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $result->code );
- $this->assertEquals( __( 'Invalid term ID.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $result->code );
+ $this->assertSame( __( 'Invalid term ID.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_valid_term() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,11 +92,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result['parent'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check data.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, $result['count'] );
- $this->assertEquals( $term['name'], $result['name'] );
- $this->assertEquals( $term['slug'], $result['slug'] );
- $this->assertEquals( 'category', $result['taxonomy'] );
- $this->assertEquals( $term['description'], $result['description'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, $result['count'] );
+ $this->assertSame( $term['name'], $result['name'] );
+ $this->assertSame( $term['slug'], $result['slug'] );
+ $this->assertSame( 'category', $result['taxonomy'] );
+ $this->assertSame( $term['description'], $result['description'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -123,6 +123,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result['custom_fields'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $term_meta = get_term_meta( self::$term_id, '', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $term_meta['foo'][0], $result['custom_fields'][0]['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $term_meta['foo'][0], $result['custom_fields'][0]['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetTermsphp"></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/xmlrpc/wp/getTerms.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getTerms.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getTerms.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'username', 'password', 'category' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_empty_taxonomy() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,8 +16,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', '' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
- $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
+ $this->assertSame( __( 'Invalid taxonomy.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_taxonomy() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,8 +25,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'not_existing' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
- $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
+ $this->assertSame( __( 'Invalid taxonomy.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,8 +34,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'subscriber', 'subscriber', 'category' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
- $this->assertEquals( __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
+ $this->assertSame( __( 'Sorry, you are not allowed to assign terms in this taxonomy.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_valid_terms() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,9 +77,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $results );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_terms, count( $results ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_terms, count( $results ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $results as $term ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $tax_name, $term['taxonomy'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $tax_name, $term['taxonomy'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test paged results.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -86,20 +86,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 'number' => 5 );
</span><span class="cx" style="display: block; padding: 0 10px"> $results2 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $results );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 5, count( $results2 ) );
- $this->assertEquals( $results[1]['term_id'], $results2[1]['term_id'] ); // Check one of the terms.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 5, count( $results2 ) );
+ $this->assertSame( $results[1]['term_id'], $results2[1]['term_id'] ); // Check one of the terms.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $filter['offset'] = 10;
</span><span class="cx" style="display: block; padding: 0 10px"> $results3 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $results3 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $num_terms - 10, count( $results3 ) );
- $this->assertEquals( $results[11]['term_id'], $results3[1]['term_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $num_terms - 10, count( $results3 ) );
+ $this->assertSame( $results[11]['term_id'], $results3[1]['term_id'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Test hide_empty (since none have been attached to posts yet, all should be hidden.
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 'hide_empty' => true );
</span><span class="cx" style="display: block; padding: 0 10px"> $results4 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $results4 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( $results4 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( $results4 ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $GLOBALS['wp_taxonomies'][ $tax_name ] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -140,8 +140,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 'search' => $name );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $filter ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $results );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $results ) );
- $this->assertEquals( $name, $results[0]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $results ) );
+ $this->assertSame( $name, $results[0]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $name_id, $results[0]['term_id'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Search by partial name.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -148,8 +148,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 'search' => substr( $name, 0, 10 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $results2 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $filter ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $results2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 1, count( $results2 ) );
- $this->assertEquals( $name, $results2[0]['name'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 1, count( $results2 ) );
+ $this->assertSame( $name, $results2[0]['name'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $name_id, $results2[0]['term_id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetUserphp"></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/xmlrpc/wp/getUser.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getUser.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getUser.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,13 +27,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'username', 'password', 1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_user() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'administrator', 'administrator', 34902348908234 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -42,7 +42,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'subscriber', 'subscriber', $editor_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_subscriber_self() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,17 +92,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check expected values.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $user_id, $result['user_id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $user_data['user_login'], $result['username'] );
- $this->assertEquals( $user_data['first_name'], $result['first_name'] );
- $this->assertEquals( $user_data['last_name'], $result['last_name'] );
- $this->assertEquals( $registered_date, $result['registered']->getTimestamp() );
- $this->assertEquals( $user_data['description'], $result['bio'] );
- $this->assertEquals( $user_data['user_email'], $result['email'] );
- $this->assertEquals( $user_data['nickname'], $result['nickname'] );
- $this->assertEquals( $user_data['user_nicename'], $result['nicename'] );
- $this->assertEquals( $user_data['user_url'], $result['url'] );
- $this->assertEquals( $user_data['display_name'], $result['display_name'] );
- $this->assertEquals( $user_data['user_login'], $result['username'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $user_data['user_login'], $result['username'] );
+ $this->assertSame( $user_data['first_name'], $result['first_name'] );
+ $this->assertSame( $user_data['last_name'], $result['last_name'] );
+ $this->assertSame( $registered_date, $result['registered']->getTimestamp() );
+ $this->assertSame( $user_data['description'], $result['bio'] );
+ $this->assertSame( $user_data['user_email'], $result['email'] );
+ $this->assertSame( $user_data['nickname'], $result['nickname'] );
+ $this->assertSame( $user_data['user_nicename'], $result['nicename'] );
+ $this->assertSame( $user_data['user_url'], $result['url'] );
+ $this->assertSame( $user_data['display_name'], $result['display_name'] );
+ $this->assertSame( $user_data['user_login'], $result['username'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( $user_data['role'], $result['roles'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_user( $user_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -116,7 +116,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $editor_id, $result['user_id'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_fields = array( 'user_id' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $expected_fields, array_keys( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $expected_fields, array_keys( $result ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_basic_fields() {
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpgetUsersphp"></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/xmlrpc/wp/getUsers.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/getUsers.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/getUsers.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,7 +9,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'username', 'password' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $results );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $results->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $results->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,7 +17,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'subscriber', 'subscriber' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $results );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $results->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $results->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_capable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,7 +51,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filter = array( 'role' => 'invalidrole' );
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $results );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $results->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $results->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_role_filter() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -102,7 +102,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } while ( count( $presults ) > 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify that $user_ids matches $users_found.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 0, count( array_diff( $user_ids, $users_found ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 0, count( array_diff( $user_ids, $users_found ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_order_filters() {
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpnewCommentphp"></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/xmlrpc/wp/newComment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/newComment.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/newComment.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,7 +41,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_new_comment_post_closed() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,7 +52,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'closed', $post->comment_status );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'closed', $post->comment_status );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newComment(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,7 +67,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_new_comment_duplicated() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,7 +92,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newComment( $comment_args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpnewPostphp"></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/xmlrpc/wp/newPost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/newPost.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/newPost.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'username', 'password', array() ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,7 +16,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'subscriber', 'subscriber', array() ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_no_content() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,8 +24,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', array() ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 500, $result->code );
- $this->assertEquals( 'Content, title, and excerpt are empty.', $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 500, $result->code );
+ $this->assertSame( 'Content, title, and excerpt are empty.', $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_basic_content() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -69,7 +69,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_capable_private() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,7 +92,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_capable_other_author() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,7 +117,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_author() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -129,7 +129,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 404, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 404, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_empty_author() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -142,7 +142,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $out = get_post( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $my_author_id, $out->post_author );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'Test', $out->post_title );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'Test', $out->post_title );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_post_thumbnail() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -174,7 +174,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'draft', get_post_status( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'draft', get_post_status( $result ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_sticky() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,7 +186,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_capable_sticky() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -211,7 +211,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_post_format() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -223,7 +223,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'quote', get_post_format( $result ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'quote', get_post_format( $result ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_post_format() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -249,7 +249,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post2 = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_title' => 'Test',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -259,7 +259,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result2 = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result2->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result2->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_term_id() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -273,7 +273,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_terms() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -338,7 +338,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result2 = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result2->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result2->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -355,7 +355,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $fetched_post = get_post( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( current_time( 'Y-m-d' ), substr( $fetched_post->post_date, 0, 10 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( current_time( 'Y-m-d' ), substr( $fetched_post->post_date, 0, 10 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -372,7 +372,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $fetched_post = get_post( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( '0000-00-00', substr( $fetched_post->post_date_gmt, 0, 10 ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( '0000-00-00', substr( $fetched_post->post_date_gmt, 0, 10 ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -389,7 +389,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $fetched_post = get_post( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $date_string, $fetched_post->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $date_string, $fetched_post->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -406,7 +406,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $fetched_post = get_post( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $date_string, $fetched_post->post_date_gmt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $date_string, $fetched_post->post_date_gmt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -423,7 +423,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $fetched_post = get_post( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $date_string, $fetched_post->post_date );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $date_string, $fetched_post->post_date );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -440,7 +440,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $fetched_post = get_post( $result );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertStringMatchesFormat( '%d', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $date_string, $fetched_post->post_date_gmt );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $date_string, $fetched_post->post_date_gmt );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpnewTermphp"></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/xmlrpc/wp/newTerm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/newTerm.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/newTerm.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -18,7 +18,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'username', 'password', array() ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_empty_taxonomy() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,8 +26,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => '' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
- $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
+ $this->assertSame( __( 'Invalid taxonomy.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_taxonomy() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -35,8 +35,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'not_existing' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
- $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
+ $this->assertSame( __( 'Invalid taxonomy.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,8 +44,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'subscriber', 'subscriber', array( 'taxonomy' => 'category' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
- $this->assertEquals( __( 'Sorry, you are not allowed to create terms in this taxonomy.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
+ $this->assertSame( __( 'Sorry, you are not allowed to create terms in this taxonomy.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_empty_term() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,8 +63,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
- $this->assertEquals( __( 'The term name cannot be empty.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
+ $this->assertSame( __( 'The term name cannot be empty.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_parent_for_nonhierarchical() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,8 +83,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
- $this->assertEquals( __( 'This taxonomy is not hierarchical.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
+ $this->assertSame( __( 'This taxonomy is not hierarchical.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_parent_invalid() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -103,7 +103,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 500, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 500, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_parent_not_existing() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -122,8 +122,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
- $this->assertEquals( __( 'Parent term does not exist.' ), $result->message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
+ $this->assertSame( __( 'Parent term does not exist.' ), $result->message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwprestoreRevisionphp"></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/xmlrpc/wp/restoreRevision.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/restoreRevision.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/restoreRevision.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -30,7 +30,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function test_invalid_username_password() {
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_restoreRevision( array( 1, 'username', 'password', $this->revision_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 403, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 403, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_incapable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,7 +38,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_restoreRevision( array( 1, 'subscriber', 'subscriber', $this->revision_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertIXRError( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 401, $result->code );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 401, $result->code );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function test_capable_user() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -53,6 +53,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_restoreRevision( array( 1, 'editor', 'editor', $this->revision_id ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'edit2', get_post( $this->post_id )->post_content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'edit2', get_post( $this->post_id )->post_content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsxmlrpcwpsetOptionsphp"></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/xmlrpc/wp/setOptions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/xmlrpc/wp/setOptions.php 2020-09-01 19:20:53 UTC (rev 48936)
+++ trunk/tests/phpunit/tests/xmlrpc/wp/setOptions.php 2020-09-02 00:35:36 UTC (rev 48937)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,7 +13,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $escaped_string_with_quote = esc_html( $string_with_quote ); // Title is passed through esc_html().
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'default_comment_status', 'closed' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( 'closed', get_option( 'default_comment_status' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( 'closed', get_option( 'default_comment_status' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $result = $this->myxmlrpcserver->wp_setOptions(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 1,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertInternalType( 'array', $result );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertEquals( $escaped_string_with_quote, $result['blog_title']['value'] );
- $this->assertEquals( 'open', $result['default_comment_status']['value'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $escaped_string_with_quote, $result['blog_title']['value'] );
+ $this->assertSame( 'open', $result['default_comment_status']['value'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre>
</div>
</div>
</body>
</html>