<!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>[55562] trunk/tests/phpunit/tests: Tests: Use the `data_` prefix for various data provider methods.</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/55562">55562</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/55562","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>2023-03-19 12:03:30 +0000 (Sun, 19 Mar 2023)</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: Use the `data_` prefix for various data provider methods.
This aims to bring more consistency to the test suite, as the vast majority of data providers already use that prefix.
Includes moving some data providers next to the tests they are used in.
Follow-up to <a href="https://core.trac.wordpress.org/changeset/55464">[55464]</a>.
See <a href="https://core.trac.wordpress.org/ticket/57841">#57841</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunktestsphpunittestsadminincludesTemplatephp">trunk/tests/phpunit/tests/admin/includesTemplate.php</a></li>
<li><a href="#trunktestsphpunittestsadminwpPrivacyRequestsTablephp">trunk/tests/phpunit/tests/admin/wpPrivacyRequestsTable.php</a></li>
<li><a href="#trunktestsphpunittestscompatmbStrlenphp">trunk/tests/phpunit/tests/compat/mbStrlen.php</a></li>
<li><a href="#trunktestsphpunittestscompatmbSubstrphp">trunk/tests/phpunit/tests/compat/mbSubstr.php</a></li>
<li><a href="#trunktestsphpunittestsdatedateI18nphp">trunk/tests/phpunit/tests/date/dateI18n.php</a></li>
<li><a href="#trunktestsphpunittestsdatequeryphp">trunk/tests/phpunit/tests/date/query.php</a></li>
<li><a href="#trunktestsphpunittestsdatewpTimezonephp">trunk/tests/phpunit/tests/date/wpTimezone.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="#trunktestsphpunittestsfeedrss2php">trunk/tests/phpunit/tests/feed/rss2.php</a></li>
<li><a href="#trunktestsphpunittestsformattingbalanceTagsphp">trunk/tests/phpunit/tests/formatting/balanceTags.php</a></li>
<li><a href="#trunktestsphpunittestsformattingconvertSmiliesphp">trunk/tests/phpunit/tests/formatting/convertSmilies.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="#trunktestsphpunittestsformattingescXmlphp">trunk/tests/phpunit/tests/formatting/escXml.php</a></li>
<li><a href="#trunktestsphpunittestsformattinggetBloginfophp">trunk/tests/phpunit/tests/formatting/getBloginfo.php</a></li>
<li><a href="#trunktestsphpunittestsformattinggetUrlInContentphp">trunk/tests/phpunit/tests/formatting/getUrlInContent.php</a></li>
<li><a href="#trunktestsphpunittestsformattinghumanTimeDiffphp">trunk/tests/phpunit/tests/formatting/humanTimeDiff.php</a></li>
<li><a href="#trunktestsphpunittestsformattinglinksAddTargetphp">trunk/tests/phpunit/tests/formatting/linksAddTarget.php</a></li>
<li><a href="#trunktestsphpunittestsformattingnormalizeWhitespacephp">trunk/tests/phpunit/tests/formatting/normalizeWhitespace.php</a></li>
<li><a href="#trunktestsphpunittestsformattingredirectphp">trunk/tests/phpunit/tests/formatting/redirect.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="#trunktestsphpunittestsformattingsanitizeTrackbackUrlsphp">trunk/tests/phpunit/tests/formatting/sanitizeTrackbackUrls.php</a></li>
<li><a href="#trunktestsphpunittestsformattingseemsUtf8php">trunk/tests/phpunit/tests/formatting/seemsUtf8.php</a></li>
<li><a href="#trunktestsphpunittestsformattingurlencodeDeepphp">trunk/tests/phpunit/tests/formatting/urlencodeDeep.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionsdoEnclosephp">trunk/tests/phpunit/tests/functions/doEnclose.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionsgetStatusHeaderDescphp">trunk/tests/phpunit/tests/functions/getStatusHeaderDesc.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionsisNewDayphp">trunk/tests/phpunit/tests/functions/isNewDay.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionsremoveQueryArgphp">trunk/tests/phpunit/tests/functions/removeQueryArg.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionssizeFormatphp">trunk/tests/phpunit/tests/functions/sizeFormat.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionswpListFilterphp">trunk/tests/phpunit/tests/functions/wpListFilter.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionswpListPluckphp">trunk/tests/phpunit/tests/functions/wpListPluck.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionswpListSortphp">trunk/tests/phpunit/tests/functions/wpListSort.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionsphp">trunk/tests/phpunit/tests/functions.php</a></li>
<li><a href="#trunktestsphpunittestshttphttpphp">trunk/tests/phpunit/tests/http/http.php</a></li>
<li><a href="#trunktestsphpunittestsimageeditorphp">trunk/tests/phpunit/tests/image/editor.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="#trunktestsphpunittestsmetaisProtectedMetaphp">trunk/tests/phpunit/tests/meta/isProtectedMeta.php</a></li>
<li><a href="#trunktestsphpunittestsoembedfilterResultphp">trunk/tests/phpunit/tests/oembed/filterResult.php</a></li>
<li><a href="#trunktestsphpunittestsoptionsanitizeOptionphp">trunk/tests/phpunit/tests/option/sanitizeOption.php</a></li>
<li><a href="#trunktestsphpunittestspomopluralFormsphp">trunk/tests/phpunit/tests/pomo/pluralForms.php</a></li>
<li><a href="#trunktestsphpunittestspostnavmenuphp">trunk/tests/phpunit/tests/post/nav-menu.php</a></li>
<li><a href="#trunktestsphpunittestspostqueryphp">trunk/tests/phpunit/tests/post/query.php</a></li>
<li><a href="#trunktestsphpunittestspostwpUniquePostSlugphp">trunk/tests/phpunit/tests/post/wpUniquePostSlug.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestattachmentscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestcommentscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestpostmetafieldsphp">trunk/tests/phpunit/tests/rest-api/rest-post-meta-fields.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestpostscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestrequestphp">trunk/tests/phpunit/tests/rest-api/rest-request.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestserverphp">trunk/tests/phpunit/tests/rest-api/rest-server.php</a></li>
<li><a href="#trunktestsphpunittestsrestapiwpRestTemplatesControllerphp">trunk/tests/phpunit/tests/rest-api/wpRestTemplatesController.php</a></li>
<li><a href="#trunktestsphpunittestsrestapiphp">trunk/tests/phpunit/tests/rest-api.php</a></li>
<li><a href="#trunktestsphpunittestsrewriterewriteTagsphp">trunk/tests/phpunit/tests/rewrite/rewriteTags.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="#trunktestsphpunitteststermwpGenerateTagCloudphp">trunk/tests/phpunit/tests/term/wpGenerateTagCloud.php</a></li>
<li><a href="#trunktestsphpunittestsusercapabilitiesphp">trunk/tests/phpunit/tests/user/capabilities.php</a></li>
<li><a href="#trunktestsphpunittestsuserqueryphp">trunk/tests/phpunit/tests/user/query.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunktestsphpunittestsadminincludesTemplatephp"></a>
<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/includesTemplate.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/includesTemplate.php 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/admin/includesTemplate.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> * @ticket 44941
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::settings_errors
</span><span class="cx" style="display: block; padding: 0 10px"> * @global array $wp_settings_errors
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider settings_errors_css_classes_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_settings_errors_css_classes
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_settings_errors_css_classes( $type, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_settings_errors;
</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"> $this->assertStringNotContainsString( 'notice-notice-', $output );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function settings_errors_css_classes_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_settings_errors_css_classes() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'error', 'notice-error' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'success', 'notice-success' ),
</span></span></pre></div>
<a id="trunktestsphpunittestsadminwpPrivacyRequestsTablephp"></a>
<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/wpPrivacyRequestsTable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/wpPrivacyRequestsTable.php 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/admin/wpPrivacyRequestsTable.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> * @param string|null $search Search term.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $expected Expected in SQL 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">- * @dataProvider data_test_columns_should_be_sortable
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_columns_should_be_sortable
</ins><span class="cx" style="display: block; padding: 0 10px"> * @covers WP_Privacy_Requests_Table::prepare_items
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 43960
</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"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function data_test_columns_should_be_sortable() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_columns_should_be_sortable() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Default order (ID) DESC.
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span></span></pre></div>
<a id="trunktestsphpunittestscompatmbStrlenphp"></a>
<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/mbStrlen.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/compat/mbStrlen.php 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/compat/mbStrlen.php 2023-03-19 12:03:30 UTC (rev 55562)
</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">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider utf8_string_lengths
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_utf8_string_lengths
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_mb_strlen( $input_string, $expected_character_length ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $expected_character_length, _mb_strlen( $input_string, 'UTF-8' ) );
</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">- * @dataProvider utf8_string_lengths
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_utf8_string_lengths
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_mb_strlen_via_regex( $input_string, $expected_character_length ) {
</span><span class="cx" style="display: block; padding: 0 10px"> _wp_can_use_pcre_u( false );
</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">- * @dataProvider utf8_string_lengths
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_utf8_string_lengths
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_8bit_mb_strlen( $input_string, $expected_character_length, $expected_byte_length ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $expected_byte_length, _mb_strlen( $input_string, '8bit' ) );
</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"> * @return 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">- public function utf8_string_lengths() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_utf8_string_lengths() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'input_string' => 'баба',
</span></span></pre></div>
<a id="trunktestsphpunittestscompatmbSubstrphp"></a>
<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/mbSubstr.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/compat/mbSubstr.php 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/compat/mbSubstr.php 2023-03-19 12:03:30 UTC (rev 55562)
</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">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider utf8_substrings
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_utf8_substrings
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_mb_substr( $input_string, $start, $length, $expected_character_substring ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $expected_character_substring, _mb_substr( $input_string, $start, $length, 'UTF-8' ) );
</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">- * @dataProvider utf8_substrings
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_utf8_substrings
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_mb_substr_via_regex( $input_string, $start, $length, $expected_character_substring ) {
</span><span class="cx" style="display: block; padding: 0 10px"> _wp_can_use_pcre_u( false );
</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">- * @dataProvider utf8_substrings
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_utf8_substrings
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_8bit_mb_substr( $input_string, $start, $length, $expected_character_substring, $expected_byte_substring ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $expected_byte_substring, _mb_substr( $input_string, $start, $length, '8bit' ) );
</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"> * @return 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">- public function utf8_substrings() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_utf8_substrings() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'input_string' => 'баба',
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/date/dateI18n.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> * @ticket 25768
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider dst_times
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_should_handle_dst
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $time Time to test in Y-m-d H:i:s format.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $timezone PHP timezone string to use.
</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"> $this->assertSame( $datetime->format( $format ), date_i18n( $format, $wp_timestamp ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function dst_times() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_should_handle_dst() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'Before DST start' => array( '2019-03-31 02:59:00', 'Europe/Helsinki' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'After DST start' => array( '2019-03-31 04:01:00', 'Europe/Helsinki' ),
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/date/query.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -531,7 +531,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 41782
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider mysql_datetime_input_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_build_mysql_datetime
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array|string $datetime Array or string date input.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $expected Expected built result.
</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->assertEqualsWithDelta( strtotime( $expected ), strtotime( $found ), 10, $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">- public function mysql_datetime_input_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_build_mysql_datetime() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( '2019-06-04T08:18:24+03:00', '2019-06-04 05:18:24' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( '2019-06-04T05:18:24+00:00', '2019-06-04 05:18:24' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -564,7 +564,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 41782
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider mysql_datetime_input_provider_custom_timezone
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_build_mysql_datetime_with_custom_timezone
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array|string $datetime Array or string date input.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $expected Expected built result.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -582,7 +582,7 @@
</span><span class="cx" style="display: block; 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">- public function mysql_datetime_input_provider_custom_timezone() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_build_mysql_datetime_with_custom_timezone() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( '2019-06-04T08:18:24+03:00', '2019-06-04 08:18:24' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( '2019-06-04T05:18:24+00:00', '2019-06-04 08:18:24' ),
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/date/wpTimezone.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> * @ticket 24730
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider timezone_offset_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_should_convert_gmt_offset
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param float $gmt_offset Numeric offset from UTC.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $tz_name Expected timezone name.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,40 +39,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">- * @ticket 24730
- */
- public function test_should_return_timezone_string() {
- update_option( 'timezone_string', 'Europe/Helsinki' );
-
- $this->assertSame( 'Europe/Helsinki', wp_timezone_string() );
-
- $timezone = wp_timezone();
-
- $this->assertSame( 'Europe/Helsinki', $timezone->getName() );
- }
-
- /**
- * Ensures that deprecated timezone strings are handled correctly.
- *
- * @ticket 56468
- */
- public function test_should_return_deprecated_timezone_string() {
- $tz_string = 'America/Buenos_Aires'; // This timezone was deprecated pre-PHP 5.6.
- update_option( 'timezone_string', $tz_string );
-
- $this->assertSame( $tz_string, wp_timezone_string() );
-
- $timezone = wp_timezone();
-
- $this->assertSame( $tz_string, $timezone->getName() );
- }
-
- /**
</del><span class="cx" style="display: block; padding: 0 10px"> * Data provider to test numeric offset conversion.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return 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">- public function timezone_offset_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_should_convert_gmt_offset() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( -12, '-12:00' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( -11.5, '-11:30' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -134,4 +105,33 @@
</span><span class="cx" style="display: block; padding: 0 10px"> array( 14, '+14:00' ),
</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">+
+ /**
+ * @ticket 24730
+ */
+ public function test_should_return_timezone_string() {
+ update_option( 'timezone_string', 'Europe/Helsinki' );
+
+ $this->assertSame( 'Europe/Helsinki', wp_timezone_string() );
+
+ $timezone = wp_timezone();
+
+ $this->assertSame( 'Europe/Helsinki', $timezone->getName() );
+ }
+
+ /**
+ * Ensures that deprecated timezone strings are handled correctly.
+ *
+ * @ticket 56468
+ */
+ public function test_should_return_deprecated_timezone_string() {
+ $tz_string = 'America/Buenos_Aires'; // This timezone was deprecated pre-PHP 5.6.
+ update_option( 'timezone_string', $tz_string );
+
+ $this->assertSame( $tz_string, wp_timezone_string() );
+
+ $timezone = wp_timezone();
+
+ $this->assertSame( $tz_string, $timezone->getName() );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/db/charset.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 21212
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function data_test_get_table_charset() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_get_table_charset() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $table_name = 'test_get_table_charset';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $vars = array();
</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"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider data_test_get_table_charset
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_get_table_charset
</ins><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"> * @covers wpdb::get_table_charset
</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"> * @ticket 21212
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function data_test_get_column_charset() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_get_column_charset() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $table_name = 'test_get_column_charset';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $vars = array();
</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"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider data_test_get_column_charset
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_get_column_charset
</ins><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"> * @covers wpdb::get_col_charset
</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">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider data_test_get_column_charset
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_get_column_charset
</ins><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"> * @covers wpdb::get_col_charset
</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">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider data_test_get_column_charset
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_get_column_charset
</ins><span class="cx" style="display: block; padding: 0 10px"> * @ticket 33501
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers wpdb::get_col_charset
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/db.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> * @param arrray|string|null $last_result The value to assign to `$wpdb->last_result`.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int|string $column The column index to retrieve.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider data_test_get_col
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_get_col
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 45299
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -612,7 +612,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @type arrray|string|null $last_result The value to assign to `$wpdb->last_result`.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type int|string $column The column index to retrieve.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function data_test_get_col() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_get_col() {
</ins><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"> return array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2239,7 +2239,7 @@
</span><span class="cx" style="display: block; 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">- * @dataProvider parse_db_host_data_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_parse_db_host
</ins><span class="cx" style="display: block; padding: 0 10px"> * @ticket 41722
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 54877
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2260,7 +2260,7 @@
</span><span class="cx" style="display: block; 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">- public function parse_db_host_data_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_parse_db_host() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> '', // DB_HOST.
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/feed/rss2.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 4575
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider data_test_get_feed_build_date
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_get_feed_build_date
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_feed_build_date( $url, $element ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->go_to( $url );
</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"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function data_test_get_feed_build_date() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_get_feed_build_date() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( '/?feed=rss2', 'rss' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( '/?feed=commentsrss2', 'rss' ),
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/formatting/balanceTags.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,46 +7,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_BalanceTags extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function nestable_tags() {
- return array(
- array( 'article' ),
- array( 'aside' ),
- array( 'blockquote' ),
- array( 'details' ),
- array( 'div' ),
- array( 'figure' ),
- array( 'object' ),
- array( 'q' ),
- array( 'section' ),
- array( 'span' ),
- );
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @ticket 47014
+ * @dataProvider data_supported_traditional_tag_names
+ */
+ public function test_detects_traditional_tag_names( $tag ) {
+ $normalized = strtolower( $tag );
</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 is a complete(?) listing of valid single/self-closing tags.
- public function single_tags() {
- return array(
- array( 'area' ),
- array( 'base' ),
- array( 'basefont' ),
- array( 'br' ),
- array( 'col' ),
- array( 'command' ),
- array( 'embed' ),
- array( 'frame' ),
- array( 'hr' ),
- array( 'img' ),
- array( 'input' ),
- array( 'isindex' ),
- array( 'link' ),
- array( 'meta' ),
- array( 'param' ),
- array( 'source' ),
- array( 'track' ),
- array( 'wbr' ),
- );
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function supported_traditional_tag_names() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_supported_traditional_tag_names() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'a' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'div' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -58,7 +29,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">- public function supported_custom_element_tag_names() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @ticket 47014
+ * @dataProvider data_supported_custom_element_tag_names
+ */
+ public function test_detects_supported_custom_element_tag_names( $tag ) {
+ $this->assertSame( "<$tag>inside</$tag>", balanceTags( "<$tag>inside", true ) );
+ }
+
+ public function data_supported_custom_element_tag_names() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'custom-element' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'my-custom-element' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,7 +49,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">- public function invalid_tag_names() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @ticket 47014
+ * @dataProvider data_invalid_tag_names
+ */
+ public function test_ignores_invalid_tag_names( $input, $output ) {
+ $this->assertSame( $output, balanceTags( $input, true ) );
+ }
+
+ public function data_invalid_tag_names() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( '<0-day>inside', '<0-day>inside' ), // Can't start with a number - handled by the "<3" fix.
</span><span class="cx" style="display: block; padding: 0 10px"> array( '<UPPERCASE-TAG>inside', '<UPPERCASE-TAG>inside' ), // Custom elements cannot be uppercase.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,11 +65,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"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @ticket 47014
+ * @dataProvider data_unsupported_valid_tag_names
+ */
+ public function test_ignores_unsupported_custom_tag_names( $tag ) {
+ $this->assertSame( "<$tag>inside", balanceTags( "<$tag>inside", true ) );
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * These are valid custom elements but we don't support them yet.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-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">- public function unsupported_valid_tag_names() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_unsupported_valid_tag_names() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // We don't allow ending in a dash.
</span><span class="cx" style="display: block; padding: 0 10px"> array( '<what->inside' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -138,11 +133,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"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @ticket 47014
+ * @dataProvider data_supported_invalid_tag_names
+ */
+ public function test_detects_supported_invalid_tag_names( $tag ) {
+ $this->assertSame( "<$tag>inside</$tag>", balanceTags( "<$tag>inside", true ) );
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * These are invalid custom elements but we support them right now in order to keep the parser simpler.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see https://w3c.github.io/webcomponents/spec/custom/#valid-custom-element-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">- public function supported_invalid_tag_names() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_supported_invalid_tag_names() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Reserved names for custom elements.
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'annotation-xml' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -157,52 +160,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">- * @ticket 47014
- * @dataProvider supported_traditional_tag_names
- */
- public function test_detects_traditional_tag_names( $tag ) {
- $normalized = strtolower( $tag );
-
- $this->assertSame( "<$normalized>inside</$normalized>", balanceTags( "<$tag>inside", true ) );
- }
-
- /**
- * @ticket 47014
- * @dataProvider supported_custom_element_tag_names
- */
- public function test_detects_supported_custom_element_tag_names( $tag ) {
- $this->assertSame( "<$tag>inside</$tag>", balanceTags( "<$tag>inside", true ) );
- }
-
- /**
- * @ticket 47014
- * @dataProvider invalid_tag_names
- */
- public function test_ignores_invalid_tag_names( $input, $output ) {
- $this->assertSame( $output, balanceTags( $input, true ) );
- }
-
- /**
- * @ticket 47014
- * @dataProvider unsupported_valid_tag_names
- */
- public function test_ignores_unsupported_custom_tag_names( $tag ) {
- $this->assertSame( "<$tag>inside", balanceTags( "<$tag>inside", true ) );
- }
-
- /**
- * @ticket 47014
- * @dataProvider supported_invalid_tag_names
- */
- public function test_detects_supported_invalid_tag_names( $tag ) {
- $this->assertSame( "<$tag>inside</$tag>", balanceTags( "<$tag>inside", true ) );
- }
-
- /**
</del><span class="cx" style="display: block; padding: 0 10px"> * If a recognized valid single tag appears unclosed, it should get self-closed
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 1597
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider single_tags
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_single_tags
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_selfcloses_unclosed_known_single_tags( $tag ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( "<$tag />", balanceTags( "<$tag>", true ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -213,12 +174,36 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * should get removed and tag should be self-closed.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 1597
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider single_tags
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_single_tags
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_selfcloses_known_single_tags_having_closing_tag( $tag ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( "<$tag />", balanceTags( "<$tag></$tag>", true ) );
</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">+ // This is a complete(?) listing of valid single/self-closing tags.
+ public function data_single_tags() {
+ return array(
+ array( 'area' ),
+ array( 'base' ),
+ array( 'basefont' ),
+ array( 'br' ),
+ array( 'col' ),
+ array( 'command' ),
+ array( 'embed' ),
+ array( 'frame' ),
+ array( 'hr' ),
+ array( 'img' ),
+ array( 'input' ),
+ array( 'isindex' ),
+ array( 'link' ),
+ array( 'meta' ),
+ array( 'param' ),
+ array( 'source' ),
+ array( 'track' ),
+ array( 'wbr' ),
+ );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 1597
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -274,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"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider nestable_tags
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_nestable_tags
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_balances_nestable_tags( $tag ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $inputs = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -293,6 +278,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">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_nestable_tags() {
+ return array(
+ array( 'article' ),
+ array( 'aside' ),
+ array( 'blockquote' ),
+ array( 'details' ),
+ array( 'div' ),
+ array( 'figure' ),
+ array( 'object' ),
+ array( 'q' ),
+ array( 'section' ),
+ array( 'span' ),
+ );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> public function test_allows_adjacent_nestable_tags() {
</span><span class="cx" style="display: block; padding: 0 10px"> $inputs = array(
</span><span class="cx" style="display: block; padding: 0 10px"> '<blockquote><blockquote>Example quote</blockquote></blockquote>',
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingconvertSmiliesphp"></a>
<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/convertSmilies.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/convertSmilies.php 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/formatting/convertSmilies.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,11 +9,31 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_ConvertSmilies extends WP_UnitTestCase {
</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">+ * @dataProvider data_convert_standard_smilies
+ *
+ * Basic Validation Test to confirm that smilies are converted to image
+ * when use_smilies = 1 and not when use_smilies = 0
+ */
+ public function test_convert_standard_smilies( $in_txt, $converted_txt ) {
+ // Standard smilies, use_smilies: ON.
+ update_option( 'use_smilies', 1 );
+
+ smilies_init();
+
+ $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
+
+ // Standard smilies, use_smilies: OFF.
+ update_option( 'use_smilies', 0 );
+
+ $this->assertSame( $in_txt, convert_smilies( $in_txt ) );
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Basic Test Content DataProvider
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * array ( input_txt, converted_output_txt)
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_smilies_input_output() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_convert_standard_smilies() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $includes_path = includes_url( 'images/smilies/' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,15 +65,29 @@
</span><span class="cx" style="display: block; 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">- * @dataProvider get_smilies_input_output
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_convert_custom_smilies
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Basic Validation Test to confirm that smilies are converted to image
- * when use_smilies = 1 and not when use_smilies = 0
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Validate Custom Smilies are converted to images when use_smilies = 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">- public function test_convert_standard_smilies( $in_txt, $converted_txt ) {
- // Standard smilies, use_smilies: ON.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_convert_custom_smilies( $in_txt, $converted_txt ) {
+ global $wpsmiliestrans;
+
+ // Custom smilies, use_smilies: ON.
</ins><span class="cx" style="display: block; padding: 0 10px"> update_option( 'use_smilies', 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">+ if ( ! isset( $wpsmiliestrans ) ) {
+ smilies_init();
+ }
+
+ $trans_orig = $wpsmiliestrans; // Save original translations array.
+
+ $wpsmiliestrans = array(
+ ':PP' => 'icon_tongue.gif',
+ ':arrow:' => 'icon_arrow.gif',
+ ':monkey:' => 'icon_shock_the_monkey.gif',
+ ':nervou:' => 'icon_nervou.gif',
+ );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> smilies_init();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,6 +96,8 @@
</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><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $in_txt, convert_smilies( $in_txt ) );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $wpsmiliestrans = $trans_orig; // Reset original translations 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">@@ -69,7 +105,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * array ( input_txt, converted_output_txt)
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_custom_smilies_input_output() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_convert_custom_smilies() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $includes_path = includes_url( 'images/smilies/' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -89,46 +125,32 @@
</span><span class="cx" style="display: block; 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">- * @dataProvider get_custom_smilies_input_output
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Validate Conversion of Smilies is ignored in pre-determined tags
+ * pre, code, script, style
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Validate Custom Smilies are converted to images when use_smilies = 1
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @ticket 16448
+ * @dataProvider data_ignore_smilies_in_tags
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_convert_custom_smilies( $in_txt, $converted_txt ) {
- global $wpsmiliestrans;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_ignore_smilies_in_tags( $element ) {
+ $includes_path = includes_url( 'images/smilies/' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Custom smilies, use_smilies: ON.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $in_str = 'Do we ingore smilies ;-) in ' . $element . ' tags <' . $element . ' class="foo">My Content Here :?: </' . $element . '>';
+ $exp_str = "Do we ingore smilies \xf0\x9f\x98\x89 in $element tags <$element class=\"foo\">My Content Here :?: </$element>";
+
+ // Standard smilies, use_smilies: ON.
</ins><span class="cx" style="display: block; padding: 0 10px"> update_option( 'use_smilies', 1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- if ( ! isset( $wpsmiliestrans ) ) {
- smilies_init();
- }
-
- $trans_orig = $wpsmiliestrans; // Save original translations array.
-
- $wpsmiliestrans = array(
- ':PP' => 'icon_tongue.gif',
- ':arrow:' => 'icon_arrow.gif',
- ':monkey:' => 'icon_shock_the_monkey.gif',
- ':nervou:' => 'icon_nervou.gif',
- );
-
</del><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->assertSame( $converted_txt, convert_smilies( $in_txt ) );
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- $this->assertSame( $in_txt, convert_smilies( $in_txt ) );
-
- $wpsmiliestrans = $trans_orig; // Reset original translations array.
</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">-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * DataProvider of HTML elements/tags that smilie matches should be ignored in
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_smilies_ignore_tags() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_ignore_smilies_in_tags() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'pre' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'code' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -139,32 +161,29 @@
</span><span class="cx" style="display: block; 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">- * Validate Conversion of Smilies is ignored in pre-determined tags
- * pre, code, script, style
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Validate Combinations of Smilies separated by single space
+ * are converted correctly
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @ticket 16448
- * @dataProvider get_smilies_ignore_tags
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @ticket 20124
+ * @dataProvider data_smilies_combinations
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_ignore_smilies_in_tags( $element ) {
- $includes_path = includes_url( 'images/smilies/' );
-
- $in_str = 'Do we ingore smilies ;-) in ' . $element . ' tags <' . $element . ' class="foo">My Content Here :?: </' . $element . '>';
- $exp_str = "Do we ingore smilies \xf0\x9f\x98\x89 in $element tags <$element class=\"foo\">My Content Here :?: </$element>";
-
- // Standard smilies, use_smilies: ON.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_smilies_combinations( $in_txt, $converted_txt ) {
+ // Custom smilies, use_smilies: ON.
</ins><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->assertSame( $exp_str, convert_smilies( $in_str ) );
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Standard smilies, use_smilies: OFF.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Custom smilies, use_smilies: OFF.
</ins><span class="cx" style="display: block; padding: 0 10px"> update_option( 'use_smilies', 0 );
</span><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="cx" style="display: block; padding: 0 10px"> * DataProvider of Smilie Combinations
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_smilies_combinations() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_smilies_combinations() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $includes_path = includes_url( 'images/smilies/' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -196,29 +215,44 @@
</span><span class="cx" style="display: block; 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">- * Validate Combinations of Smilies separated by single space
- * are converted correctly
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Validate Smilies are converted for single smilie in
+ * the $wpsmiliestrans global array
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @ticket 20124
- * @dataProvider get_smilies_combinations
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @ticket 25303
+ * @dataProvider data_single_smilies_in_wpsmiliestrans
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_smilies_combinations( $in_txt, $converted_txt ) {
- // Custom smilies, use_smilies: ON.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_single_smilies_in_wpsmiliestrans( $in_txt, $converted_txt ) {
+ global $wpsmiliestrans;
+
+ // Standard smilies, use_smilies: ON.
</ins><span class="cx" style="display: block; padding: 0 10px"> update_option( 'use_smilies', 1 );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( ! isset( $wpsmiliestrans ) ) {
+ smilies_init();
+ }
+
+ $orig_trans = $wpsmiliestrans; // Save original tranlations array.
+
+ $wpsmiliestrans = array(
+ ':)' => 'simple-smile.png',
+ );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> smilies_init();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Custom smilies, use_smilies: OFF.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Standard smilies, use_smilies: OFF.
</ins><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><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $in_txt, convert_smilies( $in_txt ) );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $wpsmiliestrans = $orig_trans; // Reset original translations 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="cx" style="display: block; padding: 0 10px"> * DataProvider of Single Smilies input and converted 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">- public function get_single_smilies_input_output() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_single_smilies_in_wpsmiliestrans() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $includes_path = includes_url( 'images/smilies/' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -238,28 +272,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"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Validate Smilies are converted for single smilie in
- * the $wpsmiliestrans global array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Check that $wp_smiliessearch pattern will match smilies
+ * between spaces, but never capture those spaces.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @ticket 25303
- * @dataProvider get_single_smilies_input_output
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Further check that spaces aren't randomly deleted
+ * or added when replacing the text with an image.
+ *
+ * @ticket 22692
+ * @dataProvider data_spaces_around_smilies
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_single_smilies_in_wpsmiliestrans( $in_txt, $converted_txt ) {
- global $wpsmiliestrans;
-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_spaces_around_smilies( $in_txt, $converted_txt ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Standard smilies, use_smilies: ON.
</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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! isset( $wpsmiliestrans ) ) {
- smilies_init();
- }
-
- $orig_trans = $wpsmiliestrans; // Save original tranlations array.
-
- $wpsmiliestrans = array(
- ':)' => 'simple-smile.png',
- );
-
</del><span class="cx" style="display: block; padding: 0 10px"> smilies_init();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -266,13 +291,9 @@
</span><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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- $this->assertSame( $in_txt, convert_smilies( $in_txt ) );
-
- $wpsmiliestrans = $orig_trans; // Reset original translations array.
</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">- public function get_spaces_around_smilies() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_spaces_around_smilies() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $nbsp = "\xC2\xA0";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -292,28 +313,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">- * Check that $wp_smiliessearch pattern will match smilies
- * between spaces, but never capture those spaces.
- *
- * Further check that spaces aren't randomly deleted
- * or added when replacing the text with an image.
- *
- * @ticket 22692
- * @dataProvider get_spaces_around_smilies
- */
- public function test_spaces_around_smilies( $in_txt, $converted_txt ) {
- // Standard smilies, use_smilies: ON.
- update_option( 'use_smilies', 1 );
-
- smilies_init();
-
- $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
-
- // Standard smilies, use_smilies: OFF.
- update_option( 'use_smilies', 0 );
- }
-
- /**
</del><span class="cx" style="display: block; padding: 0 10px"> * Test to ensure smilies can be removed with a filter
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 35905
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/formatting/date.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,11 +130,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 31809
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider timezone_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_timezone_provider
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::get_gmt_from_date
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_gmt_from_date_correct_time( $timezone_string, $gmt_offset ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_get_gmt_from_date_correct_time( $timezone_string, $gmt_offset ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> update_option( 'timezone_string', $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><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"> * @ticket 31809
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider timezone_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_timezone_provider
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::get_date_from_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">- public function test_date_from_gmt_correct_time( $timezone_string, $gmt_offset ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_get_date_from_gmt_correct_time( $timezone_string, $gmt_offset ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> update_option( 'timezone_string', $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><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"> * @ticket 31809
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider timezone_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_timezone_provider
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::iso8601_to_datetime
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -230,7 +230,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return 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">- public function timezone_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_timezone_provider() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'timezone_string' => 'Europe/Helsinki',
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/formatting/ent2ncr.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_Ent2ncr extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider entities
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_entities
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public 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="lines" style="display: block; padding: 0 10px; color: #888">@@ -19,7 +19,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Get test data from files, one test per line.
</span><span class="cx" style="display: block; padding: 0 10px"> * Comments start with "###".
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function entities() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_entities() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $entities = file( DIR_TESTDATA . '/formatting/entities.txt' );
</span><span class="cx" style="display: block; padding: 0 10px"> $data_provided = array();
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $entities as $line ) {
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/formatting/escXml.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> * Test basic escaping
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider _test_esc_xml_basics_dataprovider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_esc_xml_basics
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $source The source string to be escaped.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $expected The expected escaped value of `$source`.
</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"> * @type string $expected The expected escaped value of `$source`.
</span><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function _test_esc_xml_basics_dataprovider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_esc_xml_basics() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Simple string.
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</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"> * Test that CDATA Sections are not escaped.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider _test_ignores_cdata_sections_dataprovider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_ignores_cdata_sections
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $source The source string to be escaped.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $expected The expected escaped value of `$source`.
</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"> * @type string $expected The expected escaped value of `$source`.
</span><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function _test_ignores_cdata_sections_dataprovider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_ignores_cdata_sections() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // basic CDATA Section containing chars that would otherwise be escaped if not in a CDATA Section
</span><span class="cx" style="display: block; padding: 0 10px"> // not to mention the CDATA Section markup itself :-)
</span></span></pre></div>
<a id="trunktestsphpunittestsformattinggetBloginfophp"></a>
<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/getBloginfo.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/getBloginfo.php 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/formatting/getBloginfo.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> class Tests_Formatting_GetBloginfo extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider locales
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_get_bloginfo_language
</ins><span class="cx" style="display: block; padding: 0 10px"> * @ticket 28303
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_bloginfo_language( $test_locale, $expected ) {
</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"> $locale = $old_locale;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function locales() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_get_bloginfo_language() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Locale, language code.
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'en_US', 'en-US' ),
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/formatting/getUrlInContent.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,11 +8,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_GetUrlInContent extends WP_UnitTestCase {
</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">+ * Validate the get_url_in_content function
+ *
+ * @dataProvider data_get_url_in_content
+ */
+ public function test_get_url_in_content( $in_str, $exp_str ) {
+ $this->assertSame( $exp_str, get_url_in_content( $in_str ) );
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * URL Content Data Provider
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * array ( input_txt, converted_output_txt )
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_input_output() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_get_url_in_content() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( // Empty content.
</span><span class="cx" style="display: block; padding: 0 10px"> '',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,13 +49,4 @@
</span><span class="cx" style="display: block; 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">-
- /**
- * Validate the get_url_in_content function
- *
- * @dataProvider get_input_output
- */
- public function test_get_url_in_content( $in_str, $exp_str ) {
- $this->assertSame( $exp_str, get_url_in_content( $in_str ) );
- }
</del><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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/formatting/humanTimeDiff.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> * @group formatting
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 38773
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider data_test_human_time_diff
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_human_time_diff
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public 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><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"> }
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function data_test_human_time_diff() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_human_time_diff() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> '37 seconds',
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/formatting/linksAddTarget.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,12 +5,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::links_add_target
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_LinksAddTarget extends WP_UnitTestCase {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Validate the normalize_whitespace function
+ *
+ * @dataProvider data_links_add_target
+ */
+ public function test_links_add_target( $content, $target, $tags, $exp_str ) {
+ if ( true === is_null( $target ) ) {
+ $this->assertSame( $exp_str, links_add_target( $content ) );
+ } elseif ( true === is_null( $tags ) ) {
+ $this->assertSame( $exp_str, links_add_target( $content, $target ) );
+ } else {
+ $this->assertSame( $exp_str, links_add_target( $content, $target, $tags ) );
+ }
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Test Content DataProvider
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * array ( input_txt, converted_output_txt)
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_input_output() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_links_add_target() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> END TEXT',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -92,19 +108,4 @@
</span><span class="cx" style="display: block; 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">-
- /**
- * Validate the normalize_whitespace function
- *
- * @dataProvider get_input_output
- */
- public function test_normalize_whitespace( $content, $target, $tags, $exp_str ) {
- if ( true === is_null( $target ) ) {
- $this->assertSame( $exp_str, links_add_target( $content ) );
- } elseif ( true === is_null( $tags ) ) {
- $this->assertSame( $exp_str, links_add_target( $content, $target ) );
- } else {
- $this->assertSame( $exp_str, links_add_target( $content, $target, $tags ) );
- }
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/formatting/normalizeWhitespace.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,12 +5,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::normalize_whitespace
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_NormalizeWhitespace extends WP_UnitTestCase {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Validate the normalize_whitespace function
+ *
+ * @dataProvider data_normalize_whitespace
+ */
+ public function test_normalize_whitespace( $in_str, $exp_str ) {
+ $this->assertSame( $exp_str, normalize_whitespace( $in_str ) );
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * WhitespaceTest Content DataProvider
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * array( input_txt, converted_output_txt)
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_input_output() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_normalize_whitespace() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> ' ',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -42,13 +52,4 @@
</span><span class="cx" style="display: block; 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">-
- /**
- * Validate the normalize_whitespace function
- *
- * @dataProvider get_input_output
- */
- public function test_normalize_whitespace( $in_str, $exp_str ) {
- $this->assertSame( $exp_str, normalize_whitespace( $in_str ) );
- }
</del><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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/formatting/redirect.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> * @ticket 44317
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider get_bad_status_codes
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_wp_redirect_bad_status_code
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::wp_redirect
</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"> wp_redirect( $location, $status );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_bad_status_codes() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_wp_redirect_bad_status_code() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Tests for bad arguments.
</span><span class="cx" style="display: block; padding: 0 10px"> array( '/wp-admin', 404 ),
</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">- * @dataProvider valid_url_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_wp_validate_redirect_valid_url
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::wp_validate_redirect
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,16 +81,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $expected, wp_validate_redirect( $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">- /**
- * @dataProvider invalid_url_provider
- *
- * @covers ::wp_validate_redirect
- */
- public function test_wp_validate_redirect_invalid_url( $url ) {
- $this->assertEquals( false, wp_validate_redirect( $url, false ) );
- }
-
- public function valid_url_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_wp_validate_redirect_valid_url() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'http://example.com', 'http://example.com' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'http://example.com/', 'http://example.com/' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -106,7 +97,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">- public function invalid_url_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @dataProvider data_wp_validate_redirect_invalid_url
+ *
+ * @covers ::wp_validate_redirect
+ */
+ public function test_wp_validate_redirect_invalid_url( $url ) {
+ $this->assertEquals( false, wp_validate_redirect( $url, false ) );
+ }
+
+ public function data_wp_validate_redirect_invalid_url() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // parse_url() fails.
</span><span class="cx" style="display: block; padding: 0 10px"> array( '' ),
</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"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 47980
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider relative_url_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_wp_validate_redirect_relative_url
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::wp_validate_redirect
</span><span class="cx" style="display: block; padding: 0 10px"> */
</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"> * string Expected destination.
</span><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function relative_url_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_wp_validate_redirect_relative_url() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/formatting/sanitizeOrderby.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,12 +8,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_SanitizeOrderby extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider valid_orderbys
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_sanitize_sql_orderby_valid
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_valid( $orderby ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_sanitize_sql_orderby_valid( $orderby ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $orderby, sanitize_sql_orderby( $orderby ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function valid_orderbys() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_sanitize_sql_orderby_valid() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( '1' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( '1 ASC' ),
</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"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider invalid_orderbys
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_sanitize_sql_orderby_invalid
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_invalid( $orderby ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_sanitize_sql_orderby_invalid( $orderby ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( sanitize_sql_orderby( $orderby ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function invalid_orderbys() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_sanitize_sql_orderby_invalid() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( '' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( '1 2' ),
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/formatting/sanitizeTextField.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,6 +7,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::sanitize_textarea_field
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Formatting_SanitizeTextField extends WP_UnitTestCase {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /**
+ * @ticket 32257
+ * @dataProvider data_sanitize_text_field
+ */
+ public function test_sanitize_text_field( $str, $expected ) {
+ if ( is_array( $expected ) ) {
+ $expected_oneline = $expected['oneline'];
+ $expected_multiline = $expected['multiline'];
+ } else {
+ $expected_oneline = $expected;
+ $expected_multiline = $expected;
+ }
+ $this->assertSame( $expected_oneline, sanitize_text_field( $str ) );
+ $this->assertSameIgnoreEOL( $expected_multiline, sanitize_textarea_field( $str ) );
+
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> public function data_sanitize_text_field() {
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -126,21 +144,4 @@
</span><span class="cx" style="display: block; 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">-
- /**
- * @ticket 32257
- * @dataProvider data_sanitize_text_field
- */
- public function test_sanitize_text_field( $str, $expected ) {
- if ( is_array( $expected ) ) {
- $expected_oneline = $expected['oneline'];
- $expected_multiline = $expected['multiline'];
- } else {
- $expected_oneline = $expected;
- $expected_multiline = $expected;
- }
- $this->assertSame( $expected_oneline, sanitize_text_field( $str ) );
- $this->assertSameIgnoreEOL( $expected_multiline, sanitize_textarea_field( $str ) );
-
- }
</del><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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/formatting/sanitizeTrackbackUrls.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> class Tests_Formatting_SanitizeTrackbackUrls extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 21624
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider separators
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_sanitize_trackback_urls_with_multiple_urls
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_sanitize_trackback_urls_with_multiple_urls( $separator ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame(
</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"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function separators() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_sanitize_trackback_urls_with_multiple_urls() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( "\r\n\t " ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( "\r" ),
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingseemsUtf8php"></a>
<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/seemsUtf8.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/seemsUtf8.php 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/formatting/seemsUtf8.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,14 +10,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * `seems_utf8` returns true for utf-8 strings, false otherwise.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider utf8_strings
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_seems_utf8_returns_true_for_utf8_strings
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_returns_true_for_utf8_strings( $utf8_string ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_seems_utf8_returns_true_for_utf8_strings( $utf8_string ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // From http://www.i18nguy.com/unicode-example.html
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( seems_utf8( $utf8_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">- public function utf8_strings() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_seems_utf8_returns_true_for_utf8_strings() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $utf8_strings = file( DIR_TESTDATA . '/formatting/utf-8/utf-8.txt' );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $utf8_strings as &$string ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $string = (array) trim( $string );
</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"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider big5_strings
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_seems_utf8_returns_false_for_non_utf8_strings
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_returns_false_for_non_utf8_strings( $big5_string ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_seems_utf8_returns_false_for_non_utf8_strings( $big5_string ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( seems_utf8( $big5_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">- public function big5_strings() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_seems_utf8_returns_false_for_non_utf8_strings() {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Get data from formatting/big5.txt.
</span><span class="cx" style="display: block; padding: 0 10px"> $big5_strings = file( DIR_TESTDATA . '/formatting/big5.txt' );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $big5_strings as &$string ) {
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/formatting/urlencodeDeep.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> * Data Provider
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function data_test_values() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_urlencode_deep() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'qwerty123456', 'qwerty123456' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( '|!"£$%&/()=?', '%7C%21%22%C2%A3%24%25%26%2F%28%29%3D%3F' ),
</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"> * Validate the urlencode_deep function pair by pair
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider data_test_values
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_urlencode_deep
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $actual
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $expected
</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"> * Test the whole array as input
</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_all_values_in_array() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $data = $this->data_test_values();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $data = $this->data_urlencode_deep();
</ins><span class="cx" style="display: block; padding: 0 10px">
</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></pre></div>
<a id="trunktestsphpunittestsfunctionsdoEnclosephp"></a>
<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/doEnclose.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/doEnclose.php 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/functions/doEnclose.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.3.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">- * @dataProvider data_test_do_enclose
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_do_enclose
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_function_with_explicit_content_input( $content, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create();
</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"> * @since 5.3.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">- * @dataProvider data_test_do_enclose
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_do_enclose
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_function_with_implicit_content_input( $content, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create(
</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">- public function data_test_do_enclose() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_do_enclose() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'null' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'content' => null,
</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"> * @since 5.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_function_should_delete_enclosed_link_when_no_longer_in_post_content() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $data = $this->data_test_do_enclose();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $data = $this->data_do_enclose();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Create a post with a single movie link.
</span><span class="cx" style="display: block; padding: 0 10px"> $post_id = self::factory()->post->create(
</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"> * @since 5.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_function_should_support_post_object_input() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $data = $this->data_test_do_enclose();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $data = $this->data_do_enclose();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post_object = 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">@@ -198,7 +198,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_function_enclosure_links_should_be_filterable() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $data = $this->data_test_do_enclose();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $data = $this->data_do_enclose();
</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(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionsgetStatusHeaderDescphp"></a>
<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/getStatusHeaderDesc.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/getStatusHeaderDesc.php 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/functions/getStatusHeaderDesc.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> class Tests_Functions_GetStatusHeaderDesc extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider _status_strings
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_get_status_header_desc
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $code HTTP status code.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $expected Status description.
</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"> * @return 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">- public function _status_strings() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_get_status_header_desc() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 200, 'OK' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( 301, 'Moved Permanently' ),
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionsisNewDayphp"></a>
<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/isNewDay.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/isNewDay.php 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/functions/isNewDay.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 46627
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider _data_is_new_date
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_is_new_date
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $currentday_string The day of the current post in the loop.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $previousday_string The day of the previous post in the loop.
</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"> $this->assertSame( $expected, is_new_day() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function _data_is_new_date() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_is_new_date() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( '21.05.19', '21.05.19', 0 ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( '21.05.19', '20.05.19', 1 ),
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/functions/removeQueryArg.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> class Tests_Functions_RemoveQueryArg extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider remove_query_arg_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_remove_query_arg
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_remove_query_arg( $keys_to_remove, $url, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = remove_query_arg( $keys_to_remove, $url );
</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"> $this->assertSame( $expected, $actual );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function remove_query_arg_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_remove_query_arg() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'foo', 'edit.php?foo=test1&baz=test1', 'edit.php?baz=test1' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( array( 'foo' ), 'edit.php?foo=test2&baz=test2', 'edit.php?baz=test2' ),
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionssizeFormatphp"></a>
<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/sizeFormat.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/sizeFormat.php 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/functions/sizeFormat.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Functions_SizeFormat extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function _data_size_format() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_size_format() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Invalid values.
</span><span class="cx" style="display: block; padding: 0 10px"> array( array(), 0, false ),
</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">- * @dataProvider _data_size_format
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_size_format
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param $bytes
</span><span class="cx" style="display: block; padding: 0 10px"> * @param $decimals
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/functions/wpListFilter.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> class Tests_Functions_wpListFilter extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider data_test_wp_list_filter
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_wp_list_filter
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $input_list An array of objects to filter.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $args An array of key => value arguments to match
</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"> $this->assertEqualSetsWithIndex( $expected, wp_list_filter( $input_list, $args, $operator ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function data_test_wp_list_filter() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_wp_list_filter() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'string instead of array' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo',
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionswpListPluckphp"></a>
<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/wpListPluck.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/wpListPluck.php 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/functions/wpListPluck.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider data_test_wp_list_pluck
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_wp_list_pluck
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $input_list List of objects or arrays.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int|string $field Field from the object to place instead of the entire object
</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"> $this->assertSameSetsWithIndex( $expected, wp_list_pluck( $input_list, $field, $index_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">- public function data_test_wp_list_pluck() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_wp_list_pluck() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'arrays' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionswpListSortphp"></a>
<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/wpListSort.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/wpListSort.php 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/functions/wpListSort.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> class Tests_Functions_wpListSort extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider data_test_wp_list_sort
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_wp_list_sort
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|array $orderby Either the field name to order by or an array
</span><span class="cx" style="display: block; padding: 0 10px"> * of multiple orderby fields as `$orderby => $order`.
</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"> $this->assertSame( $expected, wp_list_sort( $input_list, $orderby, $order ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function data_test_wp_list_sort() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_wp_list_sort() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'single orderby ascending' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</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">- * @dataProvider data_test_wp_list_sort_preserve_keys
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_wp_list_sort_preserve_keys
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|array $orderby Either the field name to order by or an array
</span><span class="cx" style="display: block; padding: 0 10px"> * of multiple orderby fields as `$orderby => $order`.
</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"> $this->assertSame( $expected, wp_list_sort( $input_list, $orderby, $order, 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">- public function data_test_wp_list_sort_preserve_keys() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_wp_list_sort_preserve_keys() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'single orderby ascending' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/functions.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1767,7 +1767,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Test file path validation
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 42016
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider data_test_validate_file
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_validate_file
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $file File path.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $allowed_files List of allowed files.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1788,7 +1788,7 @@
</span><span class="cx" style="display: block; 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">- public function data_test_validate_file() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_validate_file() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Allowed files:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1910,7 +1910,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Test stream URL validation.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider data_test_wp_is_stream
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_wp_is_stream
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $path The resource path or URL.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $expected Expected result.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1933,7 +1933,7 @@
</span><span class="cx" style="display: block; 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">- public function data_test_wp_is_stream() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_wp_is_stream() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Legitimate stream examples.
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'http://example.com', true ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1954,7 +1954,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Test human_readable_duration().
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 39667
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider data_test_human_readable_duration
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_human_readable_duration
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $input Duration.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $expected Expected human readable duration.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1973,7 +1973,7 @@
</span><span class="cx" style="display: block; 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">- public function data_test_human_readable_duration() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_human_readable_duration() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Valid ii:ss cases.
</span><span class="cx" style="display: block; padding: 0 10px"> array( '0:0', '0 minutes, 0 seconds' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2030,7 +2030,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49404
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider data_test_wp_is_json_media_type
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_wp_is_json_media_type
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_is_json_media_type( $input, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $expected, wp_is_json_media_type( $input ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2037,7 +2037,7 @@
</span><span class="cx" style="display: block; 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">- public function data_test_wp_is_json_media_type() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_wp_is_json_media_type() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'application/ld+json', true ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', true ),
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/http/http.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> * @ticket 20434
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 56231
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider make_absolute_url_testcases
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_make_absolute_url
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers WP_Http::make_absolute_url
</span><span class="cx" style="display: block; padding: 0 10px"> */
</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"> $this->assertSame( $expected, $actual );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function make_absolute_url_testcases() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_make_absolute_url() {
</ins><span class="cx" style="display: block; padding: 0 10px"> // 0: The Location header, 1: The current URL, 3: The expected URL.
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Absolute URL provided.
</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"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider parse_url_testcases
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_wp_parse_url
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::wp_parse_url
</span><span class="cx" style="display: block; padding: 0 10px"> */
</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"> $this->assertSame( $expected, $actual );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function parse_url_testcases() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_wp_parse_url() {
</ins><span class="cx" style="display: block; padding: 0 10px"> // 0: The URL, 1: The expected resulting structure.
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</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"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 36356
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider parse_url_component_testcases
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_wp_parse_url_with_component
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::wp_parse_url
</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"> $this->assertSame( $expected, $actual );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function parse_url_component_testcases() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_wp_parse_url_with_component() {
</ins><span class="cx" style="display: block; padding: 0 10px"> // 0: The URL, 1: The requested component, 2: The expected resulting structure.
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( self::FULL_TEST_URL, PHP_URL_SCHEME, 'http' ),
</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"> * @ticket 36356
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider get_component_from_parsed_url_array_testcases
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_get_component_from_parsed_url_array
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::wp_parse_url
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::_get_component_from_parsed_url_array
</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"> $this->assertSame( $expected, $actual );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_component_from_parsed_url_array_testcases() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_get_component_from_parsed_url_array() {
</ins><span class="cx" style="display: block; padding: 0 10px"> // 0: A URL, 1: PHP URL constant, 2: The expected result.
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</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"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 36356
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider wp_translate_php_url_constant_to_key_testcases
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_wp_translate_php_url_constant_to_key
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::_wp_translate_php_url_constant_to_key
</span><span class="cx" style="display: block; padding: 0 10px"> */
</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"> $this->assertSame( $expected, $actual );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function wp_translate_php_url_constant_to_key_testcases() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_wp_translate_php_url_constant_to_key() {
</ins><span class="cx" style="display: block; padding: 0 10px"> // 0: PHP URL constant, 1: The expected result.
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( PHP_URL_SCHEME, 'scheme' ),
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/image/editor.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> * Test wp_get_webp_info.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 35725
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider _test_wp_get_webp_info
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_wp_get_webp_info
</ins><span class="cx" style="display: block; padding: 0 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_webp_info( $file, $expected ) {
</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"> * Data provider for test_wp_get_webp_info().
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function _test_wp_get_webp_info() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_wp_get_webp_info() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Standard JPEG.
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/kses.php 2023-03-19 12:03:30 UTC (rev 55562)
</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 48376
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 55966
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 56122
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider data_test_safecss_filter_attr
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_safecss_filter_attr
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $css A string of CSS rules.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $expected Expected string of CSS rules.
</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">- public function data_test_safecss_filter_attr() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_safecss_filter_attr() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Empty input, empty output.
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</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"> * @ticket 37134
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider data_test_safecss_filter_attr_filtered
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_safecss_filter_attr_filtered
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $css A string of CSS rules.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $expected Expected string of CSS rules.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1589,7 +1589,7 @@
</span><span class="cx" style="display: block; 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">- public function data_test_safecss_filter_attr_filtered() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_safecss_filter_attr_filtered() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // A single attribute name, with a single value.
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/l10n/loadScriptTextdomain.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> * @ticket 46387
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49145
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider data_test_resolve_relative_path
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_resolve_relative_path
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_resolve_relative_path( $translation_path, $handle, $src, $textdomain, $filter = array() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $filter ) ) {
</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"> $this->assertSame( $expected, load_script_textdomain( $handle, $textdomain, DIR_TESTDATA . '/languages' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function data_test_resolve_relative_path() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_resolve_relative_path() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // @ticket 45528
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span></span></pre></div>
<a id="trunktestsphpunittestsmetaisProtectedMetaphp"></a>
<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/isProtectedMeta.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/meta/isProtectedMeta.php 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/meta/isProtectedMeta.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,13 +7,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Meta_isProtectedMeta extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider protected_data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_is_protected_meta_true
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_protected( $key ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_is_protected_meta_true( $key ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_protected_meta( $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">- public function protected_data() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_is_protected_meta_true() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $protected_keys = array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( '_wp_attachment' ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,13 +29,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">- * @dataProvider unprotected_data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_is_protected_meta_false
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_unprotected( $key ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_is_protected_meta_false( $key ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( is_protected_meta( $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">- public function unprotected_data() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_is_protected_meta_false() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $unprotected_keys = array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'singleword' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'two_words' ),
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/oembed/filterResult.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> $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 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function _data_oembed_test_strings() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_wp_filter_pre_oembed_custom_result() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> '<blockquote></blockquote><iframe title=""></iframe>',
</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">- * @dataProvider _data_oembed_test_strings
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_wp_filter_pre_oembed_custom_result
</ins><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_custom_result( $html, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $data = (object) array(
</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/sanitizeOption.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/option/sanitizeOption.php 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/option/sanitizeOption.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,6 +6,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class Tests_Option_SanitizeOption extends WP_UnitTestCase {
</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">+ * @dataProvider data_sanitize_option
+ *
+ * @covers ::sanitize_option
+ */
+ public function test_sanitize_option( $option_name, $sanitized, $original ) {
+ $this->assertSame( $sanitized, sanitize_option( $option_name, $original ) );
+ }
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Data provider to test all of the sanitize_option() case
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Inner array params: $option_name, $sanitized, $original
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -12,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return 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">- public function sanitize_option_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_sanitize_option() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'admin_email', 'mail@example.com', 'mail@example.com' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'admin_email', get_option( 'admin_email' ), 'invalid' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -86,15 +94,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">- * @dataProvider sanitize_option_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_sanitize_option_upload_path
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::sanitize_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">- public function test_sanitize_option( $option_name, $sanitized, $original ) {
- $this->assertSame( $sanitized, sanitize_option( $option_name, $original ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_sanitize_option_upload_path( $provided, $expected ) {
+ $this->assertSame( $expected, sanitize_option( 'upload_path', $provided ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function upload_path_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_sanitize_option_upload_path() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( '<a href="http://www.example.com">Link</a>', 'Link' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( '<scr' . 'ipt>url</scr' . 'ipt>', 'url' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,15 +112,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">- * @dataProvider upload_path_provider
- *
- * @covers ::sanitize_option
- */
- public function test_sanitize_option_upload_path( $provided, $expected ) {
- $this->assertSame( $expected, sanitize_option( 'upload_path', $provided ) );
- }
-
- /**
</del><span class="cx" style="display: block; padding: 0 10px"> * @ticket 36122
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::sanitize_option
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -133,12 +132,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">- * @dataProvider permalink_structure_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_sanitize_option_permalink_structure
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::sanitize_option
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::get_settings_errors
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_sanitize_permalink_structure( $provided, $expected, $valid ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_sanitize_option_permalink_structure( $provided, $expected, $valid ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $wp_settings_errors;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $old_wp_settings_errors = (array) $wp_settings_errors;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -159,7 +158,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $expected, $actual );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function permalink_structure_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_sanitize_option_permalink_structure() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( '', '', true ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( '%postname', false, false ),
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/pomo/pluralForms.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,15 +39,38 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 41562
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_locales
</ins><span class="cx" style="display: block; padding: 0 10px"> * @group external-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">- public function test_locales_provider() {
- $locales = self::locales_provider();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_regression( $lang, $nplurals, $expression ) {
+ require_once dirname( dirname( __DIR__ ) ) . '/includes/plural-form-function.php';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parenthesized = self::parenthesize_plural_expression( $expression );
+ $old_style = tests_make_plural_form_function( $nplurals, $parenthesized );
+ $plural_forms = new Plural_Forms( $expression );
+
+ $generated_old = array();
+ $generated_new = array();
+
+ foreach ( range( 0, 200 ) as $i ) {
+ $generated_old[] = $old_style( $i );
+ $generated_new[] = $plural_forms->get( $i );
+ }
+
+ $this->assertSame( $generated_old, $generated_new );
+ }
+
+ /**
+ * @ticket 41562
+ * @group external-http
+ */
+ public function test_locales_file_not_empty() {
+ $locales = self::data_locales();
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotEmpty( $locales, 'Unable to retrieve GP_Locales 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">- public static function locales_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function data_locales() {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! class_exists( 'GP_Locales' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = download_url( 'https://raw.githubusercontent.com/GlotPress/GlotPress-WP/develop/locales/locales.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $filename ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,28 +93,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"> * @ticket 41562
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider locales_provider
- * @group external-http
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_simple
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_regression( $lang, $nplurals, $expression ) {
- require_once dirname( dirname( __DIR__ ) ) . '/includes/plural-form-function.php';
-
- $parenthesized = self::parenthesize_plural_expression( $expression );
- $old_style = tests_make_plural_form_function( $nplurals, $parenthesized );
- $plural_forms = new Plural_Forms( $expression );
-
- $generated_old = array();
- $generated_new = array();
-
- foreach ( range( 0, 200 ) as $i ) {
- $generated_old[] = $old_style( $i );
- $generated_new[] = $plural_forms->get( $i );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_simple( $expression, $expected ) {
+ $plural_forms = new Plural_Forms( $expression );
+ $actual = array();
+ foreach ( array_keys( $expected ) as $num ) {
+ $actual[ $num ] = $plural_forms->get( $num );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><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( $generated_old, $generated_new );
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function simple_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function data_simple() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Simple equivalence.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -143,17 +157,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"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Ensures that an exception is thrown when an invalid plural form is encountered.
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @ticket 41562
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider simple_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_exceptions
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_simple( $expression, $expected ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_exceptions( $expression, $expected_message, $call_get ) {
+ $this->expectException( 'Exception' );
+ $this->expectExceptionMessage( $expected_message );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $plural_forms = new Plural_Forms( $expression );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $actual = array();
- foreach ( array_keys( $expected ) as $num ) {
- $actual[ $num ] = $plural_forms->get( $num );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $call_get ) {
+ $plural_forms->get( 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->assertSame( $expected, $actual );
</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"> public function data_exceptions() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -197,24 +213,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">- * Ensures that an exception is thrown when an invalid plural form is encountered.
- *
</del><span class="cx" style="display: block; padding: 0 10px"> * @ticket 41562
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider data_exceptions
</del><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_exceptions( $expression, $expected_message, $call_get ) {
- $this->expectException( 'Exception' );
- $this->expectExceptionMessage( $expected_message );
-
- $plural_forms = new Plural_Forms( $expression );
- if ( $call_get ) {
- $plural_forms->get( 1 );
- }
- }
-
- /**
- * @ticket 41562
- */
</del><span class="cx" style="display: block; padding: 0 10px"> public function test_cache() {
</span><span class="cx" style="display: block; padding: 0 10px"> $mock = $this->getMockBuilder( 'Plural_Forms' )
</span><span class="cx" style="display: block; padding: 0 10px"> ->setMethods( array( 'execute' ) )
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/post/nav-menu.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -966,22 +966,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">- * Provides IRI matching data for _wp_menu_item_classes_by_context() test.
- */
- public function get_iri_current_menu_items() {
- return array(
- array( site_url( '/%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82/' ) ),
- array( site_url( '/%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82' ) ),
- array( '/%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82/' ),
- array( '/%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82' ),
- array( '/привет/' ),
- array( '/привет' ),
- );
- }
-
- /**
</del><span class="cx" style="display: block; padding: 0 10px"> * @ticket 43401
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider get_iri_current_menu_items
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_iri_current_menu_item
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_iri_current_menu_item( $custom_link, $current = true ) {
</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">@@ -1009,6 +995,20 @@
</span><span class="cx" style="display: block; 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">+ * Provides IRI matching data for _wp_menu_item_classes_by_context() test.
+ */
+ public function data_iri_current_menu_item() {
+ return array(
+ array( site_url( '/%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82/' ) ),
+ array( site_url( '/%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82' ) ),
+ array( '/%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82/' ),
+ array( '/%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82' ),
+ array( '/привет/' ),
+ array( '/привет' ),
+ );
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * @ticket 44005
</span><span class="cx" style="display: block; padding: 0 10px"> * @group privacy
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/post/query.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -712,20 +712,10 @@
</span><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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_found_posts_provider() {
- // Count return 0 for null, but 1 for other data you may not expect.
- return array(
- array( null, 0 ),
- array( '', 1 ),
- array( "To life, to life, l'chaim", 1 ),
- array( false, 1 ),
- );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 42860
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider set_found_posts_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_set_found_posts_not_posts_as_an_array
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_set_found_posts_not_posts_as_an_array( $posts, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $q = new WP_Query(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -744,6 +734,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $expected, $q->found_posts );
</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">+ public function data_set_found_posts_not_posts_as_an_array() {
+ // Count return 0 for null, but 1 for other data you may not expect.
+ return array(
+ array( null, 0 ),
+ array( '', 1 ),
+ array( "To life, to life, l'chaim", 1 ),
+ array( false, 1 ),
+ );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 42469
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/post/wpUniquePostSlug.php 2023-03-19 12:03:30 UTC (rev 55562)
</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">- * @dataProvider allowed_post_statuses
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_allowed_post_statuses_should_not_be_forced_to_be_unique
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_allowed_post_statuses_should_not_be_forced_to_be_unique( $status ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $p1 = self::factory()->post->create(
</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"> $this->assertSame( 'foo', $actual );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function allowed_post_statuses() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_allowed_post_statuses_should_not_be_forced_to_be_unique() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'draft' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'pending' ),
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -135,7 +135,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertCount( 3, $routes['/wp/v2/media/(?P<id>[\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">- public static function disposition_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @dataProvider data_parse_disposition
+ */
+ public function test_parse_disposition( $header, $expected ) {
+ $header_list = array( $header );
+ $parsed = WP_REST_Attachments_Controller::get_filename_from_disposition( $header_list );
+ $this->assertSame( $expected, $parsed );
+ }
+
+ public static function data_parse_disposition() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Types.
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'attachment; filename="foo.jpg"', 'foo.jpg' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -167,15 +176,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">- /**
- * @dataProvider disposition_provider
- */
- public function test_parse_disposition( $header, $expected ) {
- $header_list = array( $header );
- $parsed = WP_REST_Attachments_Controller::get_filename_from_disposition( $header_list );
- $this->assertSame( $expected, $parsed );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> public function test_context_param() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Collection.
</span><span class="cx" style="display: block; padding: 0 10px"> $request = new WP_REST_Request( 'OPTIONS', '/wp/v2/media' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1257,7 +1257,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $expected_output['caption']['raw'], $post->post_excerpt );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function attachment_roundtrip_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @dataProvider data_attachment_roundtrip_as_author
+ * @requires function imagejpeg
+ */
+ public function test_attachment_roundtrip_as_author( $raw, $expected ) {
+ wp_set_current_user( self::$author_id );
+ $this->assertFalse( current_user_can( 'unfiltered_html' ) );
+ $this->verify_attachment_roundtrip( $raw, $expected );
+ }
+
+ public static function data_attachment_roundtrip_as_author() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Raw values.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1355,18 +1365,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">- * @dataProvider attachment_roundtrip_provider
</del><span class="cx" style="display: block; padding: 0 10px"> * @requires function imagejpeg
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_post_roundtrip_as_author( $raw, $expected ) {
- wp_set_current_user( self::$author_id );
- $this->assertFalse( current_user_can( 'unfiltered_html' ) );
- $this->verify_attachment_roundtrip( $raw, $expected );
- }
-
- /**
- * @requires function imagejpeg
- */
</del><span class="cx" style="display: block; padding: 0 10px"> public function test_attachment_roundtrip_as_editor_unfiltered_html() {
</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"> if ( is_multisite() ) {
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php 2023-03-19 12:03:30 UTC (rev 55562)
</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->assertSame( self::$post_id, $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">- public function comment_dates_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_comment_dates() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'set date without timezone' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'params' => array(
</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"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider comment_dates_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_comment_dates
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_comment_date( $params, $results ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2338,7 +2338,7 @@
</span><span class="cx" style="display: block; 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">- * @dataProvider comment_dates_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_comment_dates
</ins><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( $params, $results ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor_id );
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/rest-api/rest-post-meta-fields.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2053,7 +2053,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 43392
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 48363
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider _dp_meta_values_are_not_set_to_null_in_response_if_type_safely_serializable
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_meta_values_are_not_set_to_null_in_response_if_type_safely_serializable
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_meta_values_are_not_set_to_null_in_response_if_type_safely_serializable( $type, $stored, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px"> register_post_meta(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2074,7 +2074,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $expected, $response->get_data()['meta']['safe'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function _dp_meta_values_are_not_set_to_null_in_response_if_type_safely_serializable() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_meta_values_are_not_set_to_null_in_response_if_type_safely_serializable() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'boolean', 'true', true ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'boolean', 'false', false ),
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2357,7 +2357,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->check_create_post_response( $response );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function post_dates_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_post_dates() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $all_statuses = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'draft',
</span><span class="cx" style="display: block; padding: 0 10px"> 'publish',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2428,7 +2428,7 @@
</span><span class="cx" style="display: block; 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">- * @dataProvider post_dates_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_post_dates
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_create_post_date( $status, $params, $results ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3477,7 +3477,7 @@
</span><span class="cx" style="display: block; 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">- * @dataProvider post_dates_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_post_dates
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_update_post_date( $status, $params, $results ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$editor_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4032,7 +4032,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $expected_output['excerpt']['raw'], $post->post_excerpt );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function post_roundtrip_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @dataProvider data_post_roundtrip_as_author
+ */
+ public function test_post_roundtrip_as_author( $raw, $expected ) {
+ wp_set_current_user( self::$author_id );
+
+ $this->assertFalse( current_user_can( 'unfiltered_html' ) );
+ $this->verify_post_roundtrip( $raw, $expected );
+ }
+
+ public static function data_post_roundtrip_as_author() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Raw values.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4129,16 +4139,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">- /**
- * @dataProvider post_roundtrip_provider
- */
- public function test_post_roundtrip_as_author( $raw, $expected ) {
- wp_set_current_user( self::$author_id );
-
- $this->assertFalse( current_user_can( 'unfiltered_html' ) );
- $this->verify_post_roundtrip( $raw, $expected );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> public function test_post_roundtrip_as_editor_unfiltered_html() {
</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></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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/rest-api/rest-request.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -57,19 +57,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( array( $value1, $value2 ), $this->request->get_header_as_array( 'Accept' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function header_provider() {
- return array(
- array( 'Test', 'test' ),
- array( 'TEST', 'test' ),
- array( 'Test-Header', 'test_header' ),
- array( 'test-header', 'test_header' ),
- array( 'Test_Header', 'test_header' ),
- array( 'test_header', 'test_header' ),
- );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider header_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_header_canonicalization
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $original Original header key.
</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="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,19 +66,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $expected, $this->request->canonicalize_header_name( $original ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function content_type_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function data_header_canonicalization() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Check basic parsing.
- array( 'application/x-wp-example', 'application/x-wp-example', 'application', 'x-wp-example', '' ),
- array( 'application/x-wp-example; charset=utf-8', 'application/x-wp-example', 'application', 'x-wp-example', 'charset=utf-8' ),
-
- // Check case insensitivity.
- array( 'APPLICATION/x-WP-Example', 'application/x-wp-example', 'application', 'x-wp-example', '' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ array( 'Test', 'test' ),
+ array( 'TEST', 'test' ),
+ array( 'Test-Header', 'test_header' ),
+ array( 'test-header', 'test_header' ),
+ array( 'Test_Header', 'test_header' ),
+ array( 'test_header', 'test_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="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider content_type_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_content_type_parsing
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $header Header value.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $value Full type value.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,6 +99,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $parameters, $parsed['parameters'] );
</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">+ public static function data_content_type_parsing() {
+ return array(
+ // Check basic parsing.
+ array( 'application/x-wp-example', 'application/x-wp-example', 'application', 'x-wp-example', '' ),
+ array( 'application/x-wp-example; charset=utf-8', 'application/x-wp-example', 'application', 'x-wp-example', 'charset=utf-8' ),
+
+ // Check case insensitivity.
+ array( 'APPLICATION/x-WP-Example', 'application/x-wp-example', 'application', 'x-wp-example', '' ),
+ );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> protected function request_with_parameters() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->request->set_url_params(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,20 +186,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $this->request->get_param( 'has_json_params' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function alternate_json_content_type_provider() {
- return array(
- array( 'application/ld+json', 'json', true ),
- array( 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', 'json', true ),
- array( 'application/activity+json', 'json', true ),
- array( 'application/json+oembed', 'json', true ),
- array( 'application/nojson', 'body', false ),
- array( 'application/no.json', 'body', false ),
- );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49404
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider alternate_json_content_type_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_alternate_json_content_type
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $content_type The Content-Type header.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $source The source value.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -217,20 +206,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $accept_json, $this->request->get_param( 'has_json_params' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public static function is_json_content_type_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function data_alternate_json_content_type() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- array( 'application/ld+json', true ),
- array( 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', true ),
- array( 'application/activity+json', true ),
- array( 'application/json+oembed', true ),
- array( 'application/nojson', false ),
- array( 'application/no.json', false ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ array( 'application/ld+json', 'json', true ),
+ array( 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', 'json', true ),
+ array( 'application/activity+json', 'json', true ),
+ array( 'application/json+oembed', 'json', true ),
+ array( 'application/nojson', 'body', false ),
+ array( 'application/no.json', 'body', 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="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49404
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider is_json_content_type_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_is_json_content_type
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $content_type The Content-Type header.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $is_json The is_json value.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -244,6 +233,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $is_json, $this->request->is_json_content_type() );
</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">+ public static function data_is_json_content_type() {
+ return array(
+ array( 'application/ld+json', true ),
+ array( 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', true ),
+ array( 'application/activity+json', true ),
+ array( 'application/json+oembed', true ),
+ array( 'application/nojson', false ),
+ array( 'application/no.json', false ),
+ );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49404
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -310,20 +310,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $this->request->get_param( 'has_json_params' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function non_post_http_methods_with_request_body_provider() {
- return array(
- array( 'PUT' ),
- array( 'PATCH' ),
- array( 'DELETE' ),
- );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Tests that methods supporting request bodies have access to the
</span><span class="cx" style="display: block; padding: 0 10px"> * request's body. For POST this is straightforward via `$_POST`; for
</span><span class="cx" style="display: block; padding: 0 10px"> * other methods `WP_REST_Request` needs to parse the body for us.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider non_post_http_methods_with_request_body_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_non_post_body_parameters
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_non_post_body_parameters( $request_method ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $data = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -345,6 +337,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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_non_post_body_parameters() {
+ return array(
+ array( 'PUT' ),
+ array( 'PATCH' ),
+ array( 'DELETE' ),
+ );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> public function test_parameters_for_json_put() {
</span><span class="cx" style="display: block; padding: 0 10px"> $data = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'foo' => 'bar',
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/rest-api/rest-server.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,6 +49,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parent::tear_down();
</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">+ public function filter_wp_rest_server_class() {
+ return 'Spy_REST_Server';
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> public function test_envelope() {
</span><span class="cx" style="display: block; padding: 0 10px"> $data = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'amount of arbitrary data' => 'alot',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1004,7 +1008,7 @@
</span><span class="cx" style="display: block; 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">- * @dataProvider _dp_response_to_data_embedding
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_response_to_data_embedding
</ins><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_embedding( $expected, $embed ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $response = new WP_REST_Response();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1022,7 +1026,7 @@
</span><span class="cx" style="display: block; 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">- public function _dp_response_to_data_embedding() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_response_to_data_embedding() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'author', 'wp:term', 'https://wordpress.org' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1461,10 +1465,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'data\\with\\slashes', rest_get_server()->last_request->get_header( 'x_my_header' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function filter_wp_rest_server_class() {
- return 'Spy_REST_Server';
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Refreshed nonce should not be present in header when an invalid nonce is passed for logged in user.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapiwpRestTemplatesControllerphp"></a>
<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/wpRestTemplatesController.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/wpRestTemplatesController.php 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/rest-api/wpRestTemplatesController.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> * @ticket 54507
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider get_template_endpoint_urls
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_get_item_works_with_a_single_slash
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_item_works_with_a_single_slash( $endpoint_url ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_current_user( self::$admin_id );
</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"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_template_endpoint_urls() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_get_item_works_with_a_single_slash() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( '/wp/v2/templates/default/my_template' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( '/wp/v2/templates/default//my_template' ),
</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">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 54507
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider get_template_ids_to_sanitize
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_sanitize_template_id
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_sanitize_template_id( $input_id, $sanitized_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $endpoint = new WP_REST_Templates_Controller( 'wp_template' );
</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"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function get_template_ids_to_sanitize() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_sanitize_template_id() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'tt1-blocks/index', 'tt1-blocks//index' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'tt1-blocks//index', 'tt1-blocks//index' ),
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/rest-api.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,6 +27,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parent::tear_down();
</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">+ public function filter_wp_rest_server_class( $class_name ) {
+ return 'Spy_REST_Server';
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Checks that the main classes are loaded.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -822,7 +826,14 @@
</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="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function jsonp_callback_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @dataProvider data_jsonp_callback_check
+ */
+ public function test_jsonp_callback_check( $callback, $expected ) {
+ $this->assertSame( $expected, wp_check_jsonp_callback( $callback ) );
+ }
+
+ public function data_jsonp_callback_check() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Standard names.
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'Springfield', true ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -841,13 +852,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">- * @dataProvider jsonp_callback_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_rest_parse_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">- public function test_jsonp_callback_check( $callback, $expected ) {
- $this->assertSame( $expected, wp_check_jsonp_callback( $callback ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_rest_parse_date( $date, $expected ) {
+ $this->assertEquals( $expected, rest_parse_date( $date ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function rest_date_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_rest_parse_date() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Valid dates with timezones.
</span><span class="cx" style="display: block; padding: 0 10px"> array( '2017-01-16T11:30:00-05:00', gmmktime( 11, 30, 0, 1, 16, 2017 ) + 5 * HOUR_IN_SECONDS ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -873,13 +884,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">- * @dataProvider rest_date_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_rest_parse_date_force_utc
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_rest_parse_date( $date, $expected ) {
- $this->assertEquals( $expected, rest_parse_date( $date ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_rest_parse_date_force_utc( $date, $expected ) {
+ $this->assertSame( $expected, rest_parse_date( $date, true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function rest_date_force_utc_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_rest_parse_date_force_utc() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Valid dates with timezones.
</span><span class="cx" style="display: block; padding: 0 10px"> array( '2017-01-16T11:30:00-05:00', gmmktime( 11, 30, 0, 1, 16, 2017 ) ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -904,17 +915,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">- /**
- * @dataProvider rest_date_force_utc_provider
- */
- public function test_rest_parse_date_force_utc( $date, $expected ) {
- $this->assertSame( $expected, rest_parse_date( $date, true ) );
- }
-
- public function filter_wp_rest_server_class( $class_name ) {
- return 'Spy_REST_Server';
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> public function test_register_rest_route_without_server() {
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['wp_rest_server'] = null;
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'wp_rest_server_class', array( $this, 'filter_wp_rest_server_class' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1783,7 +1783,7 @@
</span><span class="cx" style="display: block; 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">- * @dataProvider rest_ensure_response_data_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_rest_ensure_response_returns_instance_of_wp_rest_response
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param mixed $response The response passed to rest_ensure_response().
</span><span class="cx" style="display: block; padding: 0 10px"> * @param mixed $expected_data The expected data a response should include.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1799,7 +1799,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return 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">- public function rest_ensure_response_data_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_rest_ensure_response_returns_instance_of_wp_rest_response() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( null, null ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( array( 'chocolate' => 'cookies' ), array( 'chocolate' => 'cookies' ) ),
</span></span></pre></div>
<a id="trunktestsphpunittestsrewriterewriteTagsphp"></a>
<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/rewriteTags.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rewrite/rewriteTags.php 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/rewrite/rewriteTags.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,19 +20,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->queryreplace = $wp_rewrite->queryreplace;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function _invalid_rewrite_tags() {
- return array(
- array( 'foo', 'bar' ),
- array( '%', 'bar' ),
- array( '%a', 'bar' ),
- array( 'a%', 'bar' ),
- array( '%%', 'bar' ),
- array( '', 'bar' ),
- );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider _invalid_rewrite_tags
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_add_rewrite_tag_invalid
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $tag Rewrite tag.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $regex Regex.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,6 +35,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSameSets( $this->queryreplace, $wp_rewrite->queryreplace );
</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">+ public function data_add_rewrite_tag_invalid() {
+ return array(
+ array( 'foo', 'bar' ),
+ array( '%', 'bar' ),
+ array( '%a', 'bar' ),
+ array( 'a%', 'bar' ),
+ array( '%%', 'bar' ),
+ array( '', 'bar' ),
+ );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> public function test_add_rewrite_tag_empty_query() {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_rewrite;
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/shortcode.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -404,7 +404,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $test_string, shortcode_unautop( wpautop( $test_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">- public function data_test_strip_shortcodes() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @ticket 10326
+ *
+ * @dataProvider data_strip_shortcodes
+ *
+ * @param string $expected Expected output.
+ * @param string $content Content to run strip_shortcodes() on.
+ */
+ public function test_strip_shortcodes( $expected, $content ) {
+ $this->assertSame( $expected, strip_shortcodes( $content ) );
+ }
+
+ public function data_strip_shortcodes() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'before', 'before[gallery]' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'after', '[gallery]after' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -420,18 +432,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">- * @ticket 10326
- *
- * @dataProvider data_test_strip_shortcodes
- *
- * @param string $expected Expected output.
- * @param string $content Content to run strip_shortcodes() on.
- */
- public function test_strip_shortcodes( $expected, $content ) {
- $this->assertSame( $expected, strip_shortcodes( $content ) );
- }
-
- /**
</del><span class="cx" style="display: block; padding: 0 10px"> * @ticket 37767
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_strip_shortcodes_filter() {
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/sitemaps/functions.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> * Test get_sitemap_url() with plain permalinks.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider plain_permalinks_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_get_sitemap_url_plain_permalinks
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_sitemap_url_plain_permalinks( $name, $subtype_name, $page, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = get_sitemap_url( $name, $subtype_name, $page );
</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"> * Test get_sitemap_url() with pretty permalinks.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider pretty_permalinks_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_get_sitemap_url_pretty_permalinks
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_sitemap_url_pretty_permalinks( $name, $subtype_name, $page, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->set_permalink_structure( '/%postname%/' );
</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"> * @type string|false $4 Sitemap 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">- public function plain_permalinks_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_get_sitemap_url_plain_permalinks() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'posts', 'post', 1, home_url( '/?sitemap=posts&sitemap-subtype=post&paged=1' ) ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'posts', 'post', 0, home_url( '/?sitemap=posts&sitemap-subtype=post&paged=1' ) ),
</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"> * @type string|false $4 Sitemap 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">- public function pretty_permalinks_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_get_sitemap_url_pretty_permalinks() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'posts', 'post', 1, home_url( '/wp-sitemap-posts-post-1.xml' ) ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'posts', 'post', 0, home_url( '/wp-sitemap-posts-post-1.xml' ) ),
</span></span></pre></div>
<a id="trunktestsphpunitteststermwpGenerateTagCloudphp"></a>
<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/wpGenerateTagCloud.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/wpGenerateTagCloud.php 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/term/wpGenerateTagCloud.php 2023-03-19 12:03:30 UTC (rev 55562)
</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"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Testing when passed $tags array is empty
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider empty_tags_data_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_empty_tags
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param $expected Expected output from `wp_generate_tag_cloud()`.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param $args Options for `wp_generate_tag_cloud()`.
</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"> * Testing when no tags are found
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider empty_tags_data_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_empty_tags
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param $expected Expected output from `wp_generate_tag_cloud()`.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param $args Options for `wp_generate_tag_cloud()`.
</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"> * @return 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">- public function empty_tags_data_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_empty_tags() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> // When 'format' => 'array', we should be getting an empty array back.
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/user/capabilities.php 2023-03-19 12:03:30 UTC (rev 55562)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1314,13 +1314,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">- public function authorless_post_statuses() {
- return array( array( 'draft' ), array( 'private' ), array( 'publish' ) );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 27020
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider authorless_post_statuses
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_authorless_post
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_authorless_post( $status ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Make a post without an author.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1349,6 +1345,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'publish' === $status, $contributor->has_cap( 'read_post', $post ) );
</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">+ public function data_authorless_post() {
+ return array( array( 'draft' ), array( 'private' ), array( 'publish' ) );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 16714
</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 2023-03-18 16:33:22 UTC (rev 55561)
+++ trunk/tests/phpunit/tests/user/query.php 2023-03-19 12:03:30 UTC (rev 55562)
</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">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @dataProvider orderby_should_convert_non_prefixed_keys_data
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_orderby_should_convert_non_prefixed_keys
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_orderby_should_convert_non_prefixed_keys( $short_key, $full_key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $q = new WP_User_Query(
</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"> $this->assertStringContainsString( "ORDER BY $full_key", $q->query_orderby );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function orderby_should_convert_non_prefixed_keys_data() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_orderby_should_convert_non_prefixed_keys() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'nicename', 'user_nicename' ),
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'email', 'user_email' ),
</span></span></pre>
</div>
</div>
</body>
</html>