<!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>[54090] trunk/tests/phpunit/tests: Tests: Use the factory method instead of the property.</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/54090">54090</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/54090","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>2022-09-06 22:09:49 +0000 (Tue, 06 Sep 2022)</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 factory method instead of the property.

This replaces all references to the `WP_UnitTestCase_Base::$factory` property with static function calls to the `WP_UnitTestCase_Base::factory()` method.

This is a consistency improvement for the test suite.

Follow up to <a href="https://core.trac.wordpress.org/changeset/35225">[35225]</a>, <a href="https://core.trac.wordpress.org/changeset/35242">[35242]</a>, <a href="https://core.trac.wordpress.org/changeset/49603">[49603]</a>, <a href="https://core.trac.wordpress.org/changeset/54087">[54087]</a>, <a href="https://core.trac.wordpress.org/changeset/54088">[54088]</a>.

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

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunktestsphpunittestsadminincludesScreenphp">trunk/tests/phpunit/tests/admin/includesScreen.php</a></li>
<li><a href="#trunktestsphpunittestsadminincludesThemephp">trunk/tests/phpunit/tests/admin/includesTheme.php</a></li>
<li><a href="#trunktestsphpunittestsauthphp">trunk/tests/phpunit/tests/auth.php</a></li>
<li><a href="#trunktestsphpunittestscategorywalkerCategoryphp">trunk/tests/phpunit/tests/category/walkerCategory.php</a></li>
<li><a href="#trunktestsphpunittestscommentcheckCommentphp">trunk/tests/phpunit/tests/comment/checkComment.php</a></li>
<li><a href="#trunktestsphpunittestscommentcommentsOpenphp">trunk/tests/phpunit/tests/comment/commentsOpen.php</a></li>
<li><a href="#trunktestsphpunittestscommentpingsOpenphp">trunk/tests/phpunit/tests/comment/pingsOpen.php</a></li>
<li><a href="#trunktestsphpunittestscommenttemplatephp">trunk/tests/phpunit/tests/comment/template.php</a></li>
<li><a href="#trunktestsphpunittestscommentphp">trunk/tests/phpunit/tests/comment.php</a></li>
<li><a href="#trunktestsphpunittestscustomizenavmenusphp">trunk/tests/phpunit/tests/customize/nav-menus.php</a></li>
<li><a href="#trunktestsphpunittestsdategetFeedBuildDatephp">trunk/tests/phpunit/tests/date/getFeedBuildDate.php</a></li>
<li><a href="#trunktestsphpunittestsdategetTheModifiedDatephp">trunk/tests/phpunit/tests/date/getTheModifiedDate.php</a></li>
<li><a href="#trunktestsphpunittestsdatexmlrpcphp">trunk/tests/phpunit/tests/date/xmlrpc.php</a></li>
<li><a href="#trunktestsphpunittestsgeneraltemplatephp">trunk/tests/phpunit/tests/general/template.php</a></li>
<li><a href="#trunktestsphpunittestsgeneralwpGetDocumentTitlephp">trunk/tests/phpunit/tests/general/wpGetDocumentTitle.php</a></li>
<li><a href="#trunktestsphpunittestsimagefunctionsphp">trunk/tests/phpunit/tests/image/functions.php</a></li>
<li><a href="#trunktestsphpunittestslinkgetPostTypeArchiveLinkphp">trunk/tests/phpunit/tests/link/getPostTypeArchiveLink.php</a></li>
<li><a href="#trunktestsphpunittestslinkgetThePrivacyPolicyLinkphp">trunk/tests/phpunit/tests/link/getThePrivacyPolicyLink.php</a></li>
<li><a href="#trunktestsphpunittestsmediagetPostGalleriesphp">trunk/tests/phpunit/tests/media/getPostGalleries.php</a></li>
<li><a href="#trunktestsphpunittestsmenuwalkernavmenueditphp">trunk/tests/phpunit/tests/menu/walker-nav-menu-edit.php</a></li>
<li><a href="#trunktestsphpunittestsmenuwalkernavmenuphp">trunk/tests/phpunit/tests/menu/walker-nav-menu.php</a></li>
<li><a href="#trunktestsphpunittestsmenuwpAjaxMenuQuickSearchphp">trunk/tests/phpunit/tests/menu/wpAjaxMenuQuickSearch.php</a></li>
<li><a href="#trunktestsphpunittestsmultisitewpInstallDefaultsphp">trunk/tests/phpunit/tests/multisite/wpInstallDefaults.php</a></li>
<li><a href="#trunktestsphpunittestspostwalkerPagephp">trunk/tests/phpunit/tests/post/walkerPage.php</a></li>
<li><a href="#trunktestsphpunittestspostwpPublishPostphp">trunk/tests/phpunit/tests/post/wpPublishPost.php</a></li>
<li><a href="#trunktestsphpunittestspostphp">trunk/tests/phpunit/tests/post.php</a></li>
<li><a href="#trunktestsphpunittestsprivacywpPrivacySendErasureFulfillmentNotificationphp">trunk/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php</a></li>
<li><a href="#trunktestsphpunittestsprivacywpPrivacySendRequestConfirmationNotificationphp">trunk/tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php</a></li>
<li><a href="#trunktestsphpunittestsqueryconditionalsphp">trunk/tests/phpunit/tests/query/conditionals.php</a></li>
<li><a href="#trunktestsphpunittestsquerynoFoundRowsphp">trunk/tests/phpunit/tests/query/noFoundRows.php</a></li>
<li><a href="#trunktestsphpunittestsquerysearchphp">trunk/tests/phpunit/tests/query/search.php</a></li>
<li><a href="#trunktestsphpunittestsqueryphp">trunk/tests/phpunit/tests/query.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestattachmentscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestcategoriescontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-categories-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestcommentscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestpagescontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-pages-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestpostmetafieldsphp">trunk/tests/phpunit/tests/rest-api/rest-post-meta-fields.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestpoststatusescontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-post-statuses-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestposttypescontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-post-types-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestpostscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestschemasetupphp">trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php</a></li>
<li><a href="#trunktestsphpunittestsrestapiresttagscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-tags-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapiresttaxonomiescontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-taxonomies-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapiresttermmetafieldsphp">trunk/tests/phpunit/tests/rest-api/rest-term-meta-fields.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestuserscontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-users-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapiwpRestMenusControllerphp">trunk/tests/phpunit/tests/rest-api/wpRestMenusController.php</a></li>
<li><a href="#trunktestsphpunitteststaxonomyphp">trunk/tests/phpunit/tests/taxonomy.php</a></li>
<li><a href="#trunktestsphpunitteststermcachephp">trunk/tests/phpunit/tests/term/cache.php</a></li>
<li><a href="#trunktestsphpunitteststermgetTermByphp">trunk/tests/phpunit/tests/term/getTermBy.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>
<li><a href="#trunktestsphpunittestsuserwpDropdownUsersphp">trunk/tests/phpunit/tests/user/wpDropdownUsers.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunktestsphpunittestsadminincludesScreenphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/admin/includesScreen.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/includesScreen.php        2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/admin/includesScreen.php  2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -495,7 +495,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $GLOBALS['hook_suffix'] = $hook;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( 'post.php' === $hook ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $post_id      = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $post_id      = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                                 array(
</span><span class="cx" style="display: block; padding: 0 10px">                                        'post_type' => 'type_shows_in_rest',
</span><span class="cx" style="display: block; padding: 0 10px">                                )
</span></span></pre></div>
<a id="trunktestsphpunittestsadminincludesThemephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/admin/includesTheme.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/includesTheme.php 2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/admin/includesTheme.php   2022-09-06 22:09:49 UTC (rev 54090)
</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">         * @ticket 28121
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_theme_featured_list_api() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                wp_set_current_user( $this->factory->user->create( array( 'role' => 'administrator' ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $featured_list_api = get_theme_feature_list( true );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertNonEmptyMultidimensionalArray( $featured_list_api );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span></span></pre></div>
<a id="trunktestsphpunittestsauthphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/auth.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/auth.php        2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/auth.php  2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -407,7 +407,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'user_email' => 'mail@example.com',
</span><span class="cx" style="display: block; padding: 0 10px">                        'user_pass'  => 'password',
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->user->create( $user_args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->user->create( $user_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertInstanceOf( 'WP_User', wp_authenticate( $user_args['user_email'], $user_args['user_pass'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertInstanceOf( 'WP_User', wp_authenticate( $user_args['user_login'], $user_args['user_pass'] ) );
</span></span></pre></div>
<a id="trunktestsphpunittestscategorywalkerCategoryphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/category/walkerCategory.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/category/walkerCategory.php     2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/category/walkerCategory.php       2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -30,7 +30,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_start_el_with_empty_attributes( $value, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px">                $output   = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $category = $this->factory->category->create_and_get();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $category = self::factory()->category->create_and_get();
</ins><span class="cx" style="display: block; padding: 0 10px">                 $link     = get_term_link( $category );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $args = array(
</span></span></pre></div>
<a id="trunktestsphpunittestscommentcheckCommentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/comment/checkComment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment/checkComment.php        2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/comment/checkComment.php  2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -146,7 +146,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Make sure comment author has an approved comment.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_id'              => $subscriber_id,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_approved'     => '1',
</span></span></pre></div>
<a id="trunktestsphpunittestscommentcommentsOpenphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/comment/commentsOpen.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment/commentsOpen.php        2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/comment/commentsOpen.php  2022-09-06 22:09:49 UTC (rev 54090)
</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">         * @ticket 54159
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_post_exist_status_open() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post = $this->factory->post->create_and_get();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post = self::factory()->post->create_and_get();
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->assertTrue( comments_open( $post ) );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,7 +25,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 54159
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_post_exist_status_closed() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post                 = $this->factory->post->create_and_get();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post                 = self::factory()->post->create_and_get();
</ins><span class="cx" style="display: block; padding: 0 10px">                 $post->comment_status = 'closed';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertFalse( comments_open( $post ) );
</span></span></pre></div>
<a id="trunktestsphpunittestscommentpingsOpenphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/comment/pingsOpen.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment/pingsOpen.php   2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/comment/pingsOpen.php     2022-09-06 22:09:49 UTC (rev 54090)
</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">         * @ticket 54159
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_post_exist_status_open() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post = $this->factory->post->create_and_get();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post = self::factory()->post->create_and_get();
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->assertTrue( pings_open( $post ) );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,7 +25,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 54159
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_post_exist_status_closed() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post              = $this->factory->post->create_and_get();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post              = self::factory()->post->create_and_get();
</ins><span class="cx" style="display: block; padding: 0 10px">                 $post->ping_status = 'closed';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertFalse( pings_open( $post ) );
</span></span></pre></div>
<a id="trunktestsphpunittestscommenttemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/comment/template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment/template.php    2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/comment/template.php      2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -58,7 +58,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_comments_number_text_with_post_id() {
</span><span class="cx" style="display: block; padding: 0 10px">                $post_id = self::$post_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->comment->create_post_comments( $post_id, 6 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->comment->create_post_comments( $post_id, 6 );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $comments_number_text = get_comments_number_text( false, false, false, $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -84,12 +84,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame( __( 'No Comments' ), get_comments_number_text() );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->comment->create_post_comments( $post_id, 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->comment->create_post_comments( $post_id, 1 );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->go_to( $permalink );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame( __( '1 Comment' ), get_comments_number_text() );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->comment->create_post_comments( $post_id, 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->comment->create_post_comments( $post_id, 1 );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->go_to( $permalink );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame( sprintf( _n( '%s Comment', '%s Comments', 2 ), '2' ), get_comments_number_text() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -106,7 +106,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $post_id   = self::$post_id;
</span><span class="cx" style="display: block; padding: 0 10px">                $permalink = get_permalink( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->comment->create_post_comments( $post_id, $number );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->comment->create_post_comments( $post_id, $number );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->go_to( $permalink );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                add_filter( 'gettext_with_context', array( $this, 'enable_comment_number_declension' ), 10, 4 );
</span></span></pre></div>
<a id="trunktestsphpunittestscommentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/comment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/comment.php     2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/comment.php       2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -720,13 +720,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><span class="cx" style="display: block; padding: 0 10px">                 * Set up a comment for testing.
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_author' => self::$user_id,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $comment = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID' => $post,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span></span></pre></div>
<a id="trunktestsphpunittestscustomizenavmenusphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/customize/nav-menus.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/customize/nav-menus.php 2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/customize/nav-menus.php   2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -417,7 +417,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term_id = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term_id = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'wptests_tax',
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'foobar',
</span></span></pre></div>
<a id="trunktestsphpunittestsdategetFeedBuildDatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/date/getFeedBuildDate.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/date/getFeedBuildDate.php       2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/date/getFeedBuildDate.php 2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,7 +55,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertFalse( get_feed_build_date( DATE_RFC3339 ), 'False when unable to determine valid time' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_date' => $datetime->format( 'Y-m-d H:i:s' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,7 +68,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'Fall back to time of last post modified with no posts'
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id_broken = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id_broken = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 $post_broken    = get_post( $post_id_broken );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $post_broken->post_modified_gmt = 0;
</span></span></pre></div>
<a id="trunktestsphpunittestsdategetTheModifiedDatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/date/getTheModifiedDate.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/date/getTheModifiedDate.php     2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/date/getTheModifiedDate.php       2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'post_date'     => '2016-01-21 15:34:36',
</span><span class="cx" style="display: block; padding: 0 10px">                        'post_date_gmt' => '2016-01-21 15:34:36',
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id  = $this->factory->post->create( $details );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id  = self::factory()->post->create( $details );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $format   = 'Y-m-d';
</span><span class="cx" style="display: block; padding: 0 10px">                $expected = '2016-01-21';
</span><span class="cx" style="display: block; padding: 0 10px">                $actual   = get_the_modified_date( $format, $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,7 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'post_date'     => '2016-01-21 15:34:36',
</span><span class="cx" style="display: block; padding: 0 10px">                        'post_date_gmt' => '2016-01-21 15:34:36',
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create( $details );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create( $details );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $post    = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $GLOBALS['post'] = $post;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -111,7 +111,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'post_date'     => '2016-01-21 15:34:36',
</span><span class="cx" style="display: block; padding: 0 10px">                        'post_date_gmt' => '2016-01-21 15:34:36',
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id  = $this->factory->post->create( $details );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id  = self::factory()->post->create( $details );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $format   = 'G';
</span><span class="cx" style="display: block; padding: 0 10px">                $expected = 1453390476;
</span><span class="cx" style="display: block; padding: 0 10px">                $actual   = get_the_modified_time( $format, $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,7 +130,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'post_date'     => '2016-01-21 15:34:36',
</span><span class="cx" style="display: block; padding: 0 10px">                        'post_date_gmt' => '2016-01-21 15:34:36',
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create( $details );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create( $details );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $post    = get_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $GLOBALS['post'] = $post;
</span></span></pre></div>
<a id="trunktestsphpunittestsdatexmlrpcphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/date/xmlrpc.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/date/xmlrpc.php 2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/date/xmlrpc.php   2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -221,7 +221,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $datetimeutc = $datetime->setTimezone( new DateTimeZone( 'UTC' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->make_user_by_role( 'administrator' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $comment_data = array(
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_post_ID'      => $post_id,
</span></span></pre></div>
<a id="trunktestsphpunittestsgeneraltemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/general/template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/general/template.php    2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/general/template.php      2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,7 +104,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @covers ::has_site_icon
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_has_site_icon_returns_true_when_called_for_other_site_with_site_icon_set() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $blog_id = $this->factory->blog->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $blog_id = self::factory()->blog->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 switch_to_blog( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->set_site_icon();
</span><span class="cx" style="display: block; padding: 0 10px">                restore_current_blog();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -119,7 +119,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @covers ::has_site_icon
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_has_site_icon_returns_false_when_called_for_other_site_without_site_icon_set() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $blog_id = $this->factory->blog->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $blog_id = self::factory()->blog->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertFalse( has_site_icon( $blog_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -298,7 +298,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @covers ::has_custom_logo
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_has_custom_logo_returns_true_when_called_for_other_site_with_custom_logo_set() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $blog_id = $this->factory->blog->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $blog_id = self::factory()->blog->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 switch_to_blog( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->set_custom_logo();
</span><span class="cx" style="display: block; padding: 0 10px">                restore_current_blog();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -313,7 +313,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @covers ::has_custom_logo
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_has_custom_logo_returns_false_when_called_for_other_site_without_custom_logo_set() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $blog_id = $this->factory->blog->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $blog_id = self::factory()->blog->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertFalse( has_custom_logo( $blog_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -343,7 +343,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @covers ::get_custom_logo
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_custom_logo_returns_logo_when_called_for_other_site_with_custom_logo_set() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $blog_id = $this->factory->blog->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $blog_id = self::factory()->blog->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 switch_to_blog( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->set_custom_logo();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -466,7 +466,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @covers ::get_site_icon_url
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_site_icon_url_preserves_switched_state() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $blog_id = $this->factory->blog->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $blog_id = self::factory()->blog->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 switch_to_blog( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $expected = $GLOBALS['_wp_switched_stack'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -486,7 +486,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @covers ::has_custom_logo
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_has_custom_logo_preserves_switched_state() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $blog_id = $this->factory->blog->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $blog_id = self::factory()->blog->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 switch_to_blog( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $expected = $GLOBALS['_wp_switched_stack'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -506,7 +506,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @covers ::get_custom_logo
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_custom_logo_preserves_switched_state() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $blog_id = $this->factory->blog->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $blog_id = self::factory()->blog->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 switch_to_blog( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $expected = $GLOBALS['_wp_switched_stack'];
</span></span></pre></div>
<a id="trunktestsphpunittestsgeneralwpGetDocumentTitlephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/general/wpGetDocumentTitle.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/general/wpGetDocumentTitle.php  2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/general/wpGetDocumentTitle.php    2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -101,7 +101,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                update_option( 'show_on_front', 'page' );
</span><span class="cx" style="display: block; padding: 0 10px">                update_option(
</span><span class="cx" style="display: block; padding: 0 10px">                        'page_on_front',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                                 array(
</span><span class="cx" style="display: block; padding: 0 10px">                                        'post_title' => 'front-page',
</span><span class="cx" style="display: block; padding: 0 10px">                                        'post_type'  => 'page',
</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">        public function test_home_title() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $blog_page_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $blog_page_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title' => 'blog-page',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'  => 'page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -205,7 +205,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type' => 'cpt',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span></span></pre></div>
<a id="trunktestsphpunittestsimagefunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/image/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/image/functions.php     2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/image/functions.php       2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -658,7 +658,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->markTestSkipped( $editor->get_error_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">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -735,7 +735,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->markTestSkipped( $editor->get_error_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">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -808,7 +808,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->markTestSkipped( $editor->get_error_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">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -882,7 +882,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->markTestSkipped( $editor->get_error_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">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $pdf_path,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span></span></pre></div>
<a id="trunktestsphpunittestslinkgetPostTypeArchiveLinkphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/link/getPostTypeArchiveLink.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/link/getPostTypeArchiveLink.php 2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/link/getPostTypeArchiveLink.php   2022-09-06 22:09:49 UTC (rev 54090)
</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">         * @ticket 19902
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_post_archive_link_with_post_archive_on_a_blog_page() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page_for_posts = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page_for_posts = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title' => 'blog-page',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'  => 'page',
</span></span></pre></div>
<a id="trunktestsphpunittestslinkgetThePrivacyPolicyLinkphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/link/getThePrivacyPolicyLink.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/link/getThePrivacyPolicyLink.php        2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/link/getThePrivacyPolicyLink.php  2022-09-06 22:09:49 UTC (rev 54090)
</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">         * @ticket 44192
</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_return_empty_string_when_privacy_page_title_empty() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $nameless_page_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $nameless_page_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'  => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title' => '',
</span></span></pre></div>
<a id="trunktestsphpunittestsmediagetPostGalleriesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/media/getPostGalleries.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/media/getPostGalleries.php      2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/media/getPostGalleries.php        2022-09-06 22:09:49 UTC (rev 54090)
</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">         * @ticket 43826
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_returns_empty_array_with_post_with_no_gallery() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => '<p>A post with no gallery</p>',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,7 +49,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @param string $needle  The content of a non-gallery block.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_returns_only_galleries( $content, $needle ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $image_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $image_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'file'           => 'test.jpg',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_parent'    => 0,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -66,7 +66,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $content
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => $content,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -124,7 +124,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_returns_no_srcs_with_shortcode_in_post_with_no_attached_images() {
</span><span class="cx" style="display: block; padding: 0 10px">                // Set up an unattached image.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'file'           => 'test.jpg',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_parent'    => 0,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -133,7 +133,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => '[gallery]',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -173,7 +173,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_returns_no_srcs_with_block_in_post_with_no_attached_images() {
</span><span class="cx" style="display: block; padding: 0 10px">                // Set up an unattached image.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'file'           => 'test.jpg',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_parent'    => 0,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -182,7 +182,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => '<!-- wp:gallery -->',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -231,7 +231,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_returns_no_srcs_with_block_v2_in_post_with_no_attached_images() {
</span><span class="cx" style="display: block; padding: 0 10px">                // Set up an unattached image.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $image_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $image_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'file'           => 'test.jpg',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_parent'    => 0,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -260,7 +260,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <!-- /wp:gallery -->
</span><span class="cx" style="display: block; padding: 0 10px"> BLOB;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => $blob,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -309,19 +309,19 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @group shortcode
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_returns_html_with_shortcode_gallery() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => 'I have no gallery',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id_two = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id_two = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => "[gallery id='$post_id']",
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'file'           => 'test.jpg',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_parent'    => $post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -363,7 +363,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @group blocks
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_returns_html_with_block_gallery() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => 'I have no gallery.',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -370,7 +370,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Set up an unattached image.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $image_id = $this->factory->attachment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $image_id = self::factory()->attachment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'file'           => 'test.jpg',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_parent'    => $post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -387,7 +387,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <!-- /wp:gallery -->
</span><span class="cx" style="display: block; padding: 0 10px"> BLOB;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id_two = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id_two = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => $blob,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -426,7 +426,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @group blocks
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_returns_html_with_block_gallery_v2() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $image_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $image_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'file'           => 'test.jpg',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_parent'    => 0,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -455,7 +455,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <!-- /wp:gallery -->
</span><span class="cx" style="display: block; padding: 0 10px"> BLOB;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => $blob,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -495,17 +495,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @group shortcode
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_respects_post_id_with_shortcode_gallery() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $global_post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $global_post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => 'Global 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">-                $post_id        = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id        = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => '[gallery]',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'file'           => 'test.jpg',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_parent'    => $post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -577,7 +577,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $ids_joined = join( ',', $ids );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $global_post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $global_post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => 'Global Post',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -588,12 +588,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <!-- /wp:gallery -->
</span><span class="cx" style="display: block; padding: 0 10px"> BLOB;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => $blob,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'file'           => 'test.jpg',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_parent'    => $post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -657,7 +657,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px">                $metadata       = array_merge( array( 'file' => 'image1.jpg' ), self::IMG_META );
</span><span class="cx" style="display: block; padding: 0 10px">                $url            = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . 'image1.jpg';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $global_post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $global_post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => 'Global Post',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -683,12 +683,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <!-- /wp:gallery -->
</span><span class="cx" style="display: block; padding: 0 10px"> BLOB;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => $blob,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'file'           => 'test.jpg',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_parent'    => $post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -742,17 +742,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @group shortcode
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_respects_shortcode_id_attribute() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id     = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id     = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => 'No gallery defined',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id_two = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id_two = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => "[gallery id='$post_id']",
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'file'           => 'test.jpg',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_parent'    => $post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -950,7 +950,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_returns_srcs_from_html_with_block_with_no_json_blob() {
</span><span class="cx" style="display: block; padding: 0 10px">                // Set up an unattached image.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $image_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $image_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'file'           => 'test.jpg',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_parent'    => 0,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -972,7 +972,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <!-- /wp:gallery -->
</span><span class="cx" style="display: block; padding: 0 10px"> BLOB;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => $blob,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1022,12 +1022,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @group blocks
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_returns_srcs_with_nested_block_gallery() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id  = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id  = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => 'I have no gallery.',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $image_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $image_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'file'           => 'test.jpg',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_parent'    => $post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1045,7 +1045,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <!-- /wp:columns -->
</span><span class="cx" style="display: block; padding: 0 10px"> BLOB;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id_two = $this->factory->post->create( array( 'post_content' => $blob ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id_two = self::factory()->post->create( array( 'post_content' => $blob ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $galleries = get_post_galleries( $post_id_two, false );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="trunktestsphpunittestsmenuwalkernavmenueditphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/menu/walker-nav-menu-edit.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/menu/walker-nav-menu-edit.php   2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/menu/walker-nav-menu-edit.php     2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,7 +40,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_original_title_prefix_should_not_be_shown_if_empty() {
</span><span class="cx" style="display: block; padding: 0 10px">                $expected = '';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $item = array(
</span><span class="cx" style="display: block; padding: 0 10px">                        'classes'          => array(),
</span></span></pre></div>
<a id="trunktestsphpunittestsmenuwalkernavmenuphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/menu/walker-nav-menu.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/menu/walker-nav-menu.php        2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/menu/walker-nav-menu.php  2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,7 +49,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_noopener_no_referrer_for_target_blank() {
</span><span class="cx" style="display: block; padding: 0 10px">                $actual     = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id    = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id    = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 $post_title = get_the_title( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $item = array(
</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">        public function test_start_el_with_empty_attributes( $value, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px">                $output     = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id    = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id    = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 $post_title = get_the_title( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $item = array(
</span></span></pre></div>
<a id="trunktestsphpunittestsmenuwpAjaxMenuQuickSearchphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/menu/wpAjaxMenuQuickSearch.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/menu/wpAjaxMenuQuickSearch.php  2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/menu/wpAjaxMenuQuickSearch.php    2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,7 +104,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_search_should_return_unassigned_term_items() {
</span><span class="cx" style="display: block; padding: 0 10px">                register_taxonomy( 'wptests_tax', 'post' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'wptests_tax',
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'foobar',
</span></span></pre></div>
<a id="trunktestsphpunittestsmultisitewpInstallDefaultsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/multisite/wpInstallDefaults.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/multisite/wpInstallDefaults.php 2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/multisite/wpInstallDefaults.php   2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,7 +13,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                 * @ticket 40036
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><span class="cx" style="display: block; padding: 0 10px">                public function test_option_should_not_be_empty_by_default() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $blog_id = $this->factory->blog->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $blog_id = self::factory()->blog->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        switch_to_blog( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,7 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        update_site_option( 'first_page', '' );
</span><span class="cx" style="display: block; padding: 0 10px">                        update_site_option( 'first_comment', '' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $blog_id = $this->factory->blog->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $blog_id = self::factory()->blog->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        switch_to_blog( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,7 +65,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        update_site_option( 'first_page', 'Some page content' );
</span><span class="cx" style="display: block; padding: 0 10px">                        update_site_option( 'first_comment', 'Some comment content' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $blog_id = $this->factory->blog->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $blog_id = self::factory()->blog->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        switch_to_blog( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="trunktestsphpunittestspostwalkerPagephp"></a>
<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/walkerPage.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/walkerPage.php     2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/post/walkerPage.php       2022-09-06 22:09:49 UTC (rev 54090)
</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">        public function test_start_el_with_empty_attributes( $value, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px">                $output = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page   = $this->factory->post->create_and_get( array( 'post_type' => 'page' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page   = self::factory()->post->create_and_get( array( 'post_type' => 'page' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $link   = get_permalink( $page );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                add_filter(
</span></span></pre></div>
<a id="trunktestsphpunittestspostwpPublishPostphp"></a>
<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/wpPublishPost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/wpPublishPost.php  2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/post/wpPublishPost.php    2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -142,7 +142,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_wp_publish_post_respects_current_categories() {
</span><span class="cx" style="display: block; padding: 0 10px">                $post_id     = self::$auto_draft_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $category_id = $this->factory->term->create( array( 'taxonomy' => 'category' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $category_id = self::factory()->term->create( array( 'taxonomy' => 'category' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 wp_set_post_categories( $post_id, $category_id );
</span><span class="cx" style="display: block; padding: 0 10px">                wp_publish_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -183,7 +183,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_wp_publish_post_adds_default_category_when_tagged() {
</span><span class="cx" style="display: block; padding: 0 10px">                $post_id = self::$auto_draft_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $tag_id  = $this->factory->term->create( array( 'taxonomy' => 'post_tag' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $tag_id  = self::factory()->term->create( array( 'taxonomy' => 'post_tag' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 wp_set_post_tags( $post_id, array( $tag_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">                wp_publish_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -218,7 +218,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $post_id = self::$auto_draft_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term_id = $this->factory->term->create( array( 'taxonomy' => 'tax_51292' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term_id = self::factory()->term->create( array( 'taxonomy' => 'tax_51292' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 wp_set_object_terms( $post_id, array( $term_id ), 'tax_51292' );
</span><span class="cx" style="display: block; padding: 0 10px">                wp_publish_post( $post_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="trunktestsphpunittestspostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post.php        2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/post.php  2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -454,7 +454,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_pre_wp_unique_post_slug_filter() {
</span><span class="cx" style="display: block; padding: 0 10px">                add_filter( 'pre_wp_unique_post_slug', array( $this, 'filter_pre_wp_unique_post_slug' ), 10, 6 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'title'       => 'An example',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span></span></pre></div>
<a id="trunktestsphpunittestsprivacywpPrivacySendErasureFulfillmentNotificationphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php 2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php   2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -131,7 +131,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 44234
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_should_send_email_with_privacy_policy() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $privacy_policy = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $privacy_policy = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                                'title'       => 'Site Privacy Policy',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -307,7 +307,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 44234
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_should_not_send_email_when_not_user_request() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type' => 'post', // Should be 'user_request'.
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span></span></pre></div>
<a id="trunktestsphpunittestsprivacywpPrivacySendRequestConfirmationNotificationphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php        2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php  2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,7 +55,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 43967
</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_not_send_email_when_not_a_wp_user_request() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type' => 'post',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span></span></pre></div>
<a id="trunktestsphpunittestsqueryconditionalsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/query/conditionals.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/conditionals.php  2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/query/conditionals.php    2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -978,13 +978,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_is_single_with_slug_that_clashes_with_attachment() {
</span><span class="cx" style="display: block; padding: 0 10px">                $this->set_permalink_structure( '/%postname%/' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type' => 'attachment',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title' => get_post( $attachment_id )->post_title,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span></span></pre></div>
<a id="trunktestsphpunittestsquerynoFoundRowsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/query/noFoundRows.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/noFoundRows.php   2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/query/noFoundRows.php     2022-09-06 22:09:49 UTC (rev 54090)
</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">         * @ticket 29552
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_no_found_rows_default_with_nopaging_true() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $p = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $p = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $q = new WP_Query(
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,7 +90,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 29552
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_no_found_rows_default_with_postsperpage_minus1() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $p = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $p = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $q = new WP_Query(
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span></span></pre></div>
<a id="trunktestsphpunittestsquerysearchphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/query/search.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/search.php        2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/query/search.php  2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -266,7 +266,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 31025
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_s_zero() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $p1 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $p1 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status'  => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'   => '1',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -275,7 +275,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $p2 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $p2 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status'  => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'   => '0',
</span></span></pre></div>
<a id="trunktestsphpunittestsqueryphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query.php       2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/query.php 2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -644,19 +644,19 @@
</span><span class="cx" style="display: block; padding: 0 10px">                register_taxonomy( 'tax1', 'post' );
</span><span class="cx" style="display: block; padding: 0 10px">                register_taxonomy( 'tax2', 'post' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term1   = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term1   = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'tax1',
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'term1',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term2   = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term2   = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'tax2',
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'term2',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 wp_set_object_terms( $post_id, 'term1', 'tax1' );
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_object_terms( $post_id, 'term2', 'tax2' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -674,19 +674,19 @@
</span><span class="cx" style="display: block; padding: 0 10px">                register_taxonomy( 'tax1', 'post' );
</span><span class="cx" style="display: block; padding: 0 10px">                register_taxonomy( 'tax2', 'post' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term1   = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term1   = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'tax1',
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'term1',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term2   = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term2   = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'tax2',
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'term2',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 wp_set_object_terms( $post_id, 'term1', 'tax1' );
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_object_terms( $post_id, 'term2', 'tax2' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</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        2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php  2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -185,7 +185,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px">                // Single.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -246,7 +246,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_registered_get_item_params() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1      = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1      = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -266,7 +266,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 43701
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_allow_header_sent_on_options_request() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1      = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1      = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -294,7 +294,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( 0 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1            = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1            = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -302,8 +302,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_excerpt'   => 'A sample caption',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $draft_post     = $this->factory->post->create( array( 'post_status' => 'draft' ) );
-               $id2            = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $draft_post     = self::factory()->post->create( array( 'post_status' => 'draft' ) );
+               $id2            = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        $draft_post,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -311,8 +311,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_excerpt'   => 'A sample caption',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $published_post = $this->factory->post->create( array( 'post_status' => 'publish' ) );
-               $id3            = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $published_post = self::factory()->post->create( array( 'post_status' => 'publish' ) );
+               $id3            = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        $published_post,
</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">        public function test_get_items_logged_in_editor() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1            = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1            = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -342,8 +342,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_excerpt'   => 'A sample caption',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $draft_post     = $this->factory->post->create( array( 'post_status' => 'draft' ) );
-               $id2            = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $draft_post     = self::factory()->post->create( array( 'post_status' => 'draft' ) );
+               $id2            = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        $draft_post,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -351,8 +351,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_excerpt'   => 'A sample caption',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $published_post = $this->factory->post->create( array( 'post_status' => 'publish' ) );
-               $id3            = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $published_post = self::factory()->post->create( array( 'post_status' => 'publish' ) );
+               $id3            = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        $published_post,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -372,7 +372,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_media_type() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1      = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1      = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -395,7 +395,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_mime_type() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1      = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1      = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -418,8 +418,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_parent() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id        = $this->factory->post->create( array( 'post_title' => 'Test Post' ) );
-               $attachment_id  = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id        = self::factory()->post->create( array( 'post_title' => 'Test Post' ) );
+               $attachment_id  = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        $post_id,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -427,7 +427,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_excerpt'   => 'A sample caption',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id2 = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id2 = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -463,7 +463,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_invalid_status_param_is_error_response() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -481,7 +481,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_private_status() {
</span><span class="cx" style="display: block; padding: 0 10px">                // Logged out users can't make the request.
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( 0 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id1 = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id1 = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -505,7 +505,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_multiple_statuses() {
</span><span class="cx" style="display: block; padding: 0 10px">                // Logged out users can't make the request.
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( 0 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id1 = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id1 = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -514,7 +514,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status'    => 'private',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id2 = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id2 = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -550,7 +550,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_valid_date() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1     = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1     = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -559,7 +559,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_excerpt'   => 'A sample caption',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2     = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2     = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -568,7 +568,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_excerpt'   => 'A sample caption',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id3     = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id3     = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -601,7 +601,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 50617
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_valid_modified_date() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -610,7 +610,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_excerpt'   => 'A sample caption',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -619,7 +619,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_excerpt'   => 'A sample caption',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id3 = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id3 = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -661,7 +661,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 55677
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_with_empty_page_runs_count_query_after() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -683,7 +683,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -703,7 +703,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @requires function imagejpeg
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item_sizes() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -734,7 +734,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @requires function imagejpeg
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item_sizes_with_no_url() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -761,8 +761,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item_private_post_not_authenticated() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( 0 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $draft_post = $this->factory->post->create( array( 'post_status' => 'draft' ) );
-               $id1        = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $draft_post = self::factory()->post->create( array( 'post_status' => 'draft' ) );
+               $id1        = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        $draft_post,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -776,7 +776,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item_inherit_status_with_invalid_parent() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        REST_TESTS_IMPOSSIBLY_HIGH_NUMBER,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -793,7 +793,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item_auto_status_with_invalid_parent_not_authenticated_returns_error() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        REST_TESTS_IMPOSSIBLY_HIGH_NUMBER,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -963,7 +963,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_create_item_invalid_edit_permissions() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create( array( 'post_author' => self::$editor_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create( array( 'post_author' => self::$editor_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 wp_set_current_user( self::$author_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'POST', '/wp/v2/media' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'post', $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -972,7 +972,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_create_item_invalid_upload_permissions() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create( array( 'post_author' => self::$editor_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create( array( 'post_author' => self::$editor_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 wp_set_current_user( self::$uploader_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'POST', '/wp/v2/media' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'post', $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -981,7 +981,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_create_item_invalid_post_type() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'attachment',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'inherit',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1046,7 +1046,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1075,8 +1075,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_parent() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $original_parent = $this->factory->post->create( array() );
-               $attachment_id   = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $original_parent = self::factory()->post->create( array() );
+               $attachment_id   = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        $original_parent,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1089,7 +1089,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $attachment = get_post( $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame( $original_parent, $attachment->post_parent );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $new_parent = $this->factory->post->create( array() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $new_parent = self::factory()->post->create( array() );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $request    = new WP_REST_Request( 'POST', '/wp/v2/media/' . $attachment_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'post', $new_parent );
</span><span class="cx" style="display: block; padding: 0 10px">                rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1100,7 +1100,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_invalid_permissions() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$author_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1116,7 +1116,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_invalid_post_type() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'attachment',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'inherit',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1124,7 +1124,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1448,7 +1448,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id    = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id    = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1464,7 +1464,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item_no_trash() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1489,7 +1489,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item_invalid_delete_permissions() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$author_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1504,7 +1504,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_prepare_item() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1523,7 +1523,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_prepare_item_limit_fields() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1614,7 +1614,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertArrayHasKey( 'my_custom_int', $data['schema']['properties'] );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame( $schema, $data['schema']['properties']['my_custom_int'] );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1651,7 +1651,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1677,7 +1677,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_search_item_by_filename() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1684,7 +1684,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_mime_type' => 'image/jpeg',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file2,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1935,7 +1935,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                add_action( 'rest_after_insert_attachment', array( $this, 'filter_rest_after_insert_attachment' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $this->test_file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestcategoriescontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/rest-categories-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-categories-controller.php 2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/rest-api/rest-categories-controller.php   2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -121,7 +121,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSameSets( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px">                // Single.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $category1 = $this->factory->category->create( array( 'name' => 'Season 5' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $category1 = self::factory()->category->create( array( 'name' => 'Season 5' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $request   = new WP_REST_Request( 'OPTIONS', '/wp/v2/categories/' . $category1 );
</span><span class="cx" style="display: block; padding: 0 10px">                $response  = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">                $data      = $response->get_data();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -172,9 +172,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">        public function test_get_items_hide_empty_arg() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id   = $this->factory->post->create();
-               $category1 = $this->factory->category->create( array( 'name' => 'Season 5' ) );
-               $category2 = $this->factory->category->create( array( 'name' => 'The Be Sharps' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id   = self::factory()->post->create();
+               $category1 = self::factory()->category->create( array( 'name' => 'Season 5' ) );
+               $category2 = self::factory()->category->create( array( 'name' => 'The Be Sharps' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $total_categories = self::$total_categories + 2;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -197,15 +197,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">        public function test_get_items_parent_zero_arg() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $parent1 = $this->factory->category->create( array( 'name' => 'Homer' ) );
-               $parent2 = $this->factory->category->create( array( 'name' => 'Marge' ) );
-               $this->factory->category->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $parent1 = self::factory()->category->create( array( 'name' => 'Homer' ) );
+               $parent2 = self::factory()->category->create( array( 'name' => 'Marge' ) );
+               self::factory()->category->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'   => 'Bart',
</span><span class="cx" style="display: block; padding: 0 10px">                                'parent' => $parent1,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->category->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->category->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'   => 'Lisa',
</span><span class="cx" style="display: block; padding: 0 10px">                                'parent' => $parent2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -229,15 +229,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">        public function test_get_items_parent_zero_arg_string() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $parent1 = $this->factory->category->create( array( 'name' => 'Homer' ) );
-               $parent2 = $this->factory->category->create( array( 'name' => 'Marge' ) );
-               $this->factory->category->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $parent1 = self::factory()->category->create( array( 'name' => 'Homer' ) );
+               $parent2 = self::factory()->category->create( array( 'name' => 'Marge' ) );
+               self::factory()->category->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'   => 'Bart',
</span><span class="cx" style="display: block; padding: 0 10px">                                'parent' => $parent1,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->category->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->category->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'   => 'Lisa',
</span><span class="cx" style="display: block; padding: 0 10px">                                'parent' => $parent2,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -261,7 +261,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_by_parent_non_found() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $parent1 = $this->factory->category->create( array( 'name' => 'Homer' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $parent1 = self::factory()->category->create( array( 'name' => 'Homer' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/categories' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'parent', $parent1 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -284,8 +284,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_include_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->category->create();
-               $id2 = $this->factory->category->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->category->create();
+               $id2 = self::factory()->category->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/categories' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -305,8 +305,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">        public function test_get_items_exclude_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->category->create();
-               $id2 = $this->factory->category->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->category->create();
+               $id2 = self::factory()->category->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/categories' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'per_page', self::$per_page );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -325,8 +325,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">        public function test_get_items_orderby_args() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->category->create( array( 'name' => 'Apple' ) );
-               $this->factory->category->create( array( 'name' => 'Banana' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->category->create( array( 'name' => 'Apple' ) );
+               self::factory()->category->create( array( 'name' => 'Banana' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                /*
</span><span class="cx" style="display: block; padding: 0 10px">                 * Tests:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -356,9 +356,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">        public function test_get_items_orderby_id() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->category->create( array( 'name' => 'Cantaloupe' ) );
-               $this->factory->category->create( array( 'name' => 'Apple' ) );
-               $this->factory->category->create( array( 'name' => 'Banana' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->category->create( array( 'name' => 'Cantaloupe' ) );
+               self::factory()->category->create( array( 'name' => 'Apple' ) );
+               self::factory()->category->create( array( 'name' => 'Banana' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Defaults to 'orderby' => 'name', 'order' => 'asc'.
</span><span class="cx" style="display: block; padding: 0 10px">                $request  = new WP_REST_Request( 'GET', '/wp/v2/categories' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -392,9 +392,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_orderby_slugs() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->category->create( array( 'name' => 'Burrito' ) );
-               $this->factory->category->create( array( 'name' => 'Taco' ) );
-               $this->factory->category->create( array( 'name' => 'Chalupa' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->category->create( array( 'name' => 'Burrito' ) );
+               self::factory()->category->create( array( 'name' => 'Taco' ) );
+               self::factory()->category->create( array( 'name' => 'Chalupa' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/categories' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'orderby', 'include_slugs' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -408,20 +408,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">        protected function post_with_categories() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id   = $this->factory->post->create();
-               $category1 = $this->factory->category->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id   = self::factory()->post->create();
+               $category1 = self::factory()->category->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'        => 'DC',
</span><span class="cx" style="display: block; padding: 0 10px">                                'description' => 'Purveyor of fine detective comics',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $category2 = $this->factory->category->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $category2 = self::factory()->category->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'        => 'Marvel',
</span><span class="cx" style="display: block; padding: 0 10px">                                'description' => 'Home of the Marvel Universe',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $category3 = $this->factory->category->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $category3 = self::factory()->category->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'        => 'Image',
</span><span class="cx" style="display: block; padding: 0 10px">                                'description' => 'American independent comic publisher',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -493,25 +493,25 @@
</span><span class="cx" style="display: block; padding: 0 10px">                register_taxonomy( 'batman', 'post', array( 'show_in_rest' => true ) );
</span><span class="cx" style="display: block; padding: 0 10px">                $controller = new WP_REST_Terms_Controller( 'batman' );
</span><span class="cx" style="display: block; padding: 0 10px">                $controller->register_routes();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term1 = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term1 = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Cape',
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'batman',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term2 = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term2 = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Mask',
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'batman',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Car',
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'batman',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 wp_set_object_terms( $post_id, array( $term1, $term2 ), 'batman' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/batman' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -525,8 +525,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">        public function test_get_items_search_args() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->category->create( array( 'name' => 'Apple' ) );
-               $this->factory->category->create( array( 'name' => 'Banana' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->category->create( array( 'name' => 'Apple' ) );
+               self::factory()->category->create( array( 'name' => 'Banana' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                /*
</span><span class="cx" style="display: block; padding: 0 10px">                 * Tests:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -549,8 +549,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">        public function test_get_items_slug_arg() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->category->create( array( 'name' => 'Apple' ) );
-               $this->factory->category->create( array( 'name' => 'Banana' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->category->create( array( 'name' => 'Apple' ) );
+               self::factory()->category->create( array( 'name' => 'Banana' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/categories' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'slug', 'apple' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -562,8 +562,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">        public function test_get_terms_parent_arg() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $category1 = $this->factory->category->create( array( 'name' => 'Parent' ) );
-               $this->factory->category->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $category1 = self::factory()->category->create( array( 'name' => 'Parent' ) );
+               self::factory()->category->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'   => 'Child',
</span><span class="cx" style="display: block; padding: 0 10px">                                'parent' => $category1,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -587,13 +587,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_terms_private_taxonomy() {
</span><span class="cx" style="display: block; padding: 0 10px">                register_taxonomy( 'robin', 'post', array( 'public' => false ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Cape',
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'robin',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Mask',
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'robin',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -632,7 +632,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertStringContainsString( '<' . $next_link . '>; rel="next"', $headers['Link'] );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // 3rd page.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->category->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->category->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 $total_categories++;
</span><span class="cx" style="display: block; padding: 0 10px">                $total_pages++;
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/categories' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -775,7 +775,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_term_private_taxonomy() {
</span><span class="cx" style="display: block; padding: 0 10px">                register_taxonomy( 'robin', 'post', array( 'public' => false ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term1 = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term1 = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Cape',
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'robin',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -789,7 +789,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item_incorrect_taxonomy() {
</span><span class="cx" style="display: block; padding: 0 10px">                register_taxonomy( 'robin', 'post' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term1 = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term1 = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Cape',
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'robin',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -824,7 +824,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_create_item_term_already_exists() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$administrator );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $existing_id = $this->factory->category->create( array( 'name' => 'Existing' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $existing_id = self::factory()->category->create( array( 'name' => 'Existing' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'POST', '/wp/v2/categories' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'name', 'Existing' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -890,7 +890,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_create_item_invalid_parent() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$administrator );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term = get_term_by( 'id', $this->factory->category->create(), 'category' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term = get_term_by( 'id', self::factory()->category->create(), 'category' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'POST', '/wp/v2/categories/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'name', 'My Awesome Term' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -922,7 +922,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'slug'        => 'original-slug',
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term = get_term_by( 'id', $this->factory->category->create( $orig_args ), 'category' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term = get_term_by( 'id', self::factory()->category->create( $orig_args ), 'category' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'POST', '/wp/v2/categories/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'name', 'New Name' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -968,7 +968,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_incorrect_permissions() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$subscriber );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term = get_term_by( 'id', $this->factory->category->create(), 'category' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term = get_term_by( 'id', self::factory()->category->create(), 'category' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'POST', '/wp/v2/categories/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'name', 'Incorrect permissions' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -979,8 +979,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_parent() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$administrator );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $parent = get_term_by( 'id', $this->factory->category->create(), 'category' );
-               $term   = get_term_by( 'id', $this->factory->category->create(), 'category' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $parent = get_term_by( 'id', self::factory()->category->create(), 'category' );
+               $term   = get_term_by( 'id', self::factory()->category->create(), 'category' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'POST', '/wp/v2/categories/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'parent', $parent->term_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -994,12 +994,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_remove_parent() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$administrator );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $old_parent_term = get_term_by( 'id', $this->factory->category->create(), 'category' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $old_parent_term = get_term_by( 'id', self::factory()->category->create(), 'category' );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $new_parent_id   = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $term = get_term_by(
</span><span class="cx" style="display: block; padding: 0 10px">                        'id',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $this->factory->category->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 self::factory()->category->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                                 array(
</span><span class="cx" style="display: block; padding: 0 10px">                                        'parent' => $old_parent_term->term_id,
</span><span class="cx" style="display: block; padding: 0 10px">                                )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1021,7 +1021,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_invalid_parent() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$administrator );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term = get_term_by( 'id', $this->factory->category->create(), 'category' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term = get_term_by( 'id', self::factory()->category->create(), 'category' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'POST', '/wp/v2/categories/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'parent', REST_TESTS_IMPOSSIBLY_HIGH_NUMBER );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1032,7 +1032,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$administrator );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term = get_term_by( 'id', $this->factory->category->create( array( 'name' => 'Deleted Category' ) ), 'category' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term = get_term_by( 'id', self::factory()->category->create( array( 'name' => 'Deleted Category' ) ), 'category' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'DELETE', '/wp/v2/categories/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'force', true );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1046,7 +1046,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item_no_trash() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$administrator );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term = get_term_by( 'id', $this->factory->category->create( array( 'name' => 'Deleted Category' ) ), 'category' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term = get_term_by( 'id', self::factory()->category->create( array( 'name' => 'Deleted Category' ) ), 'category' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request  = new WP_REST_Request( 'DELETE', '/wp/v2/categories/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1076,7 +1076,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item_incorrect_permissions() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$subscriber );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term     = get_term_by( 'id', $this->factory->category->create(), 'category' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term     = get_term_by( 'id', self::factory()->category->create(), 'category' );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $request  = new WP_REST_Request( 'DELETE', '/wp/v2/categories/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertErrorResponse( 'rest_cannot_delete', $response, 403 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1108,7 +1108,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_prepare_taxonomy_term_child() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $child = $this->factory->category->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $child = self::factory()->category->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'parent' => 1,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1170,7 +1170,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertArrayHasKey( 'my_custom_int', $data['schema']['properties'] );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame( $schema, $data['schema']['properties']['my_custom_int'] );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $category_id = $this->factory->category->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $category_id = self::factory()->category->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 $request     = new WP_REST_Request( 'GET', '/wp/v2/categories/' . $category_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span></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   2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php     2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -237,7 +237,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_post_ID'  => self::$password_id,
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $password_comment = $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $password_comment = self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'password', 'toomanysecrets' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -261,7 +261,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_post_ID'  => self::$password_id,
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $password_comment = $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $password_comment = self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'password', 'toomanysecrets' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -284,7 +284,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_post_ID'  => self::$password_id,
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $password_comment = $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $password_comment = self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'password', 'toomanysecrets' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -302,7 +302,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_post_ID'  => self::$password_id,
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $password_comment = $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $password_comment = self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -321,7 +321,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_post_ID'  => self::$password_id,
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $password_comment = $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $password_comment = self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -340,7 +340,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_post_ID'  => self::$private_id,
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $private_comment = $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $private_comment = self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -359,7 +359,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_post_ID'  => self::$private_id,
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $private_comment = $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $private_comment = self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -373,7 +373,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_with_invalid_post() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $comment_id = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment_id = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_approved' => 1,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID'  => REST_TESTS_IMPOSSIBLY_HIGH_NUMBER,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -394,7 +394,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_with_invalid_post_permission() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $comment_id = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment_id = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_approved' => 1,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID'  => REST_TESTS_IMPOSSIBLY_HIGH_NUMBER,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -424,7 +424,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_no_post() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->comment->create_post_comments( 0, 2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->comment->create_post_comments( 0, 2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'post', 0 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -453,8 +453,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_for_post() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $second_post_id = $this->factory->post->create();
-               $this->factory->comment->create_post_comments( $second_post_id, 2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $second_post_id = self::factory()->post->create();
+               self::factory()->comment->create_post_comments( $second_post_id, 2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_query_params(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -478,8 +478,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_post_ID'  => self::$post_id,
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->comment->create( $args );
-               $id2 = $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->comment->create( $args );
+               $id2 = self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -518,8 +518,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_post_ID'  => self::$post_id,
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->comment->create( $args );
-               $id2 = $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->comment->create( $args );
+               $id2 = self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request  = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -574,7 +574,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_post_ID'  => self::$post_id,
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id = $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id = self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -598,7 +598,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_private_post_no_permissions() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create( array( 'post_status' => 'private' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create( array( 'post_status' => 'private' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'post', $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -616,11 +616,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'user_id'          => self::$author_id,
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $args['user_id'] = self::$subscriber_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px">                 unset( $args['user_id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Limit to comment author.
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/comments' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -659,11 +659,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'user_id'          => self::$author_id,
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $args['user_id'] = self::$subscriber_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px">                 unset( $args['user_id'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $total_comments = self::$total_comments + 3;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -709,12 +709,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_approved' => 1,
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_post_ID'  => self::$post_id,
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $parent_id              = $this->factory->comment->create( $args );
-               $parent_id2             = $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $parent_id              = self::factory()->comment->create( $args );
+               $parent_id2             = self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $args['comment_parent'] = $parent_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $args['comment_parent'] = $parent_id2;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $total_comments = self::$total_comments + 4;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -745,12 +745,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_approved' => 1,
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_post_ID'  => self::$post_id,
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $parent_id              = $this->factory->comment->create( $args );
-               $parent_id2             = $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $parent_id              = self::factory()->comment->create( $args );
+               $parent_id2             = self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $args['comment_parent'] = $parent_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $args['comment_parent'] = $parent_id2;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $total_comments = self::$total_comments + 4;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -786,7 +786,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_author'   => 'Homer J Simpson',
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id = $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id = self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $total_comments = self::$total_comments + 1;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -825,7 +825,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertStringContainsString( '<' . $next_link . '>; rel="next"', $headers['Link'] );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // 3rd page.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID' => self::$post_id,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -895,19 +895,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">        public function test_get_comments_valid_date() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $comment1 = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment1 = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_date'    => '2016-01-15T00:00:00Z',
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID' => self::$post_id,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $comment2 = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment2 = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_date'    => '2016-01-16T00:00:00Z',
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID' => self::$post_id,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $comment3 = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment3 = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_date'    => '2016-01-17T00:00:00Z',
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID' => self::$post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1003,7 +1003,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_comment_invalid_post_id() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $comment_id = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment_id = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_approved' => 1,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID'  => REST_TESTS_IMPOSSIBLY_HIGH_NUMBER,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1018,7 +1018,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_comment_invalid_post_id_as_admin() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $comment_id = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment_id = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_approved' => 1,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID'  => REST_TESTS_IMPOSSIBLY_HIGH_NUMBER,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1047,7 +1047,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_comment_with_children_link() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $comment_id_1 = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment_id_1 = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_approved' => 1,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID'  => self::$post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1055,7 +1055,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $child_comment = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $child_comment = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_approved' => 1,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_parent'   => $comment_id_1,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1071,7 +1071,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_comment_without_children_link() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $comment_id_1 = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment_id_1 = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_approved' => 1,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID'  => self::$post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1093,7 +1093,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_post_ID'  => self::$password_id,
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $password_comment = $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $password_comment = self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request  = new WP_REST_Request( 'GET', sprintf( '/wp/v2/comments/%s', $password_comment ) );
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1111,7 +1111,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'comment_post_ID'  => self::$password_id,
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $password_comment = $this->factory->comment->create( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $password_comment = self::factory()->comment->create( $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', sprintf( '/wp/v2/comments/%s', $password_comment ) );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'password', 'toomanysecrets' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1490,7 +1490,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_create_item_assign_different_user() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $subscriber_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $subscriber_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role'       => 'subscriber',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_email' => 'cbg@androidsdungeon.com',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1521,7 +1521,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_create_comment_without_type() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1559,7 +1559,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 38820
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_create_comment_with_invalid_type() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1583,7 +1583,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_create_comment_invalid_email() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1606,7 +1606,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_create_item_current_user() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role'         => 'subscriber',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_email'   => 'lylelanley@example.com',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1728,7 +1728,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_create_comment_with_status_IP_and_user_agent() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2006,7 +2006,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_create_item_duplicate() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$subscriber_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID'      => self::$post_id,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_author'       => 'Guy N. Cognito',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2031,7 +2031,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_create_comment_closed() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_status' => 'closed',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2303,7 +2303,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2347,7 +2347,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                update_option( 'timezone_string', $params['timezone_string'] );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $comment_id = $this->factory->comment->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment_id = self::factory()->comment->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/comments/%d', $comment_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">                if ( isset( $params['date'] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2374,7 +2374,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_no_content() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2412,7 +2412,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_comment_status() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $comment_id = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment_id = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_approved' => 0,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID'  => self::$post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2439,7 +2439,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_comment_field_does_not_use_default_values() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $comment_id = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment_id = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_approved' => 0,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID'  => self::$post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2720,7 +2720,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_comment_private_post_invalid_permission() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $private_comment_id = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $private_comment_id = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_approved' => 1,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID'  => self::$private_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2745,7 +2745,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_comment_with_children_link() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $comment_id_1 = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment_id_1 = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_approved' => 1,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID'  => self::$post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2753,7 +2753,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $child_comment = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $child_comment = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_approved' => 1,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID'  => self::$post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3047,7 +3047,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $comment_id = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment_id = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_approved' => 1,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID'  => self::$post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3067,7 +3067,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item_skip_trash() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $comment_id = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment_id = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_approved' => 1,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID'  => self::$post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3088,7 +3088,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item_already_trashed() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $comment_id = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment_id = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_approved' => 1,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID'  => self::$post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3123,7 +3123,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_child_comment_link() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$admin_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $comment_id_1 = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment_id_1 = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_approved' => 1,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID'  => self::$post_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3131,7 +3131,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $child_comment = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $child_comment = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_approved' => 1,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_parent'   => $comment_id_1,
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestpagescontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/rest-pages-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-pages-controller.php      2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/rest-api/rest-pages-controller.php        2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,7 +51,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px">                // Single.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page_id  = $this->factory->post->create( array( 'post_type' => 'page' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page_id  = self::factory()->post->create( array( 'post_type' => 'page' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $request  = new WP_REST_Request( 'OPTIONS', '/wp/v2/pages/' . $page_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">                $data     = $response->get_data();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -94,13 +94,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1      = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1      = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2      = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2      = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'draft',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -114,13 +114,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_parent_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -148,13 +148,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_parents_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -161,13 +161,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_parent' => $id1,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id3 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id3 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id4 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id4 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -190,13 +190,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_parent_exclude_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -224,13 +224,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_menu_order_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -237,7 +237,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'menu_order'  => 2,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id3 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id3 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -244,7 +244,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'menu_order'  => 3,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id4 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id4 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -302,13 +302,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_private_filter_query_var() {
</span><span class="cx" style="display: block; padding: 0 10px">                // Private query vars inaccessible to unauthorized users.
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( 0 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page_id  = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page_id  = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $draft_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $draft_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'draft',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -336,19 +336,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">        public function test_get_items_valid_date() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post1   = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post1   = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_date' => '2016-01-15T00:00:00Z',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type' => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post2   = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post2   = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_date' => '2016-01-16T00:00:00Z',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type' => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post3   = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post3   = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_date' => '2016-01-17T00:00:00Z',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type' => 'page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -378,19 +378,19 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 50617
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_valid_modified_date() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post1 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post1 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_date' => '2016-01-01 00:00:00',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type' => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post2 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post2 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_date' => '2016-01-02 00:00:00',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type' => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post3 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post3 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_date' => '2016-01-03 00:00:00',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type' => 'page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -416,7 +416,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item_invalid_post_type() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id  = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id  = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 $request  = new WP_REST_Request( 'GET', '/wp/v2/pages/' . $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame( 404, $response->get_status() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -448,7 +448,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_create_page_with_parent() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'type' => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -498,7 +498,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'  => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title' => 'Deleted page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -525,7 +525,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_prepare_item_limit_fields() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page_id  = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page_id  = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -547,7 +547,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_pages_params() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create_many(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create_many(
</ins><span class="cx" style="display: block; padding: 0 10px">                         8,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type' => 'page',
</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"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_page_menu_order() {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type' => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -601,7 +601,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_page_menu_order_to_zero() {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'  => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                                'menu_order' => 1,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -624,12 +624,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">        public function test_update_page_parent_non_zero() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page_id1 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page_id1 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type' => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page_id2 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page_id2 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type' => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -647,12 +647,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">        public function test_update_page_parent_zero() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page_id1 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page_id1 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type' => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page_id2 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page_id2 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_parent' => $page_id1,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -671,7 +671,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_page_with_password() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'     => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_password' => '$inthebananastand',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -689,7 +689,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_page_with_password_using_password() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'     => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_password' => '$inthebananastand',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -711,7 +711,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_page_with_password_using_incorrect_password() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'     => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_password' => '$inthebananastand',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -727,7 +727,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_page_with_password_without_permission() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page_id  = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page_id  = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'     => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_password' => '$inthebananastand',
</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      2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/rest-api/rest-post-meta-fields.php        2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -253,7 +253,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        protected function grant_write_permission() {
</span><span class="cx" style="display: block; padding: 0 10px">                // Ensure we have write permission.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role' => 'editor',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestpoststatusescontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/rest-post-statuses-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-post-statuses-controller.php      2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/rest-api/rest-post-statuses-controller.php        2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,7 +43,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_logged_in() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create( array( 'role' => 'author' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create( array( 'role' => 'author' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 wp_set_current_user( $user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request  = new WP_REST_Request( 'GET', '/wp/v2/statuses' );
</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">        public function test_get_item() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create( array( 'role' => 'author' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create( array( 'role' => 'author' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 wp_set_current_user( $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/statuses/publish' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'context', 'edit' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -94,7 +94,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item_invalid_internal() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 wp_set_current_user( $user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request  = new WP_REST_Request( 'GET', '/wp/v2/statuses/inherit' );
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestposttypescontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/rest-post-types-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-post-types-controller.php 2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/rest-api/rest-post-types-controller.php   2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -94,7 +94,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item_edit_context() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $editor_id = $this->factory->user->create( array( 'role' => 'editor' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $editor_id = self::factory()->user->create( array( 'role' => 'editor' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 wp_set_current_user( $editor_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/types/post' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'context', 'edit' );
</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      2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php        2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -273,8 +273,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_author_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create( array( 'post_author' => self::$editor_id ) );
-               $this->factory->post->create( array( 'post_author' => self::$author_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create( array( 'post_author' => self::$editor_id ) );
+               self::factory()->post->create( array( 'post_author' => self::$author_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $total_posts = self::$total_posts + 2;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -305,8 +305,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">        public function test_get_items_author_exclude_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create( array( 'post_author' => self::$editor_id ) );
-               $this->factory->post->create( array( 'post_author' => self::$author_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create( array( 'post_author' => self::$editor_id ) );
+               self::factory()->post->create( array( 'post_author' => self::$author_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $total_posts = self::$total_posts + 2;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -347,13 +347,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_include_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_date'   => '2001-02-03 04:05:06',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_date'   => '2001-02-03 04:05:07',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -386,19 +386,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">        public function test_get_items_orderby_author_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_author' => self::$editor_id,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id3 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id3 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_author' => self::$editor_id,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_author' => self::$author_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -421,9 +421,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">        public function test_get_items_orderby_modified_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->post->create( array( 'post_status' => 'publish' ) );
-               $id2 = $this->factory->post->create( array( 'post_status' => 'publish' ) );
-               $id3 = $this->factory->post->create( array( 'post_status' => 'publish' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->post->create( array( 'post_status' => 'publish' ) );
+               $id2 = self::factory()->post->create( array( 'post_status' => 'publish' ) );
+               $id3 = self::factory()->post->create( array( 'post_status' => 'publish' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->update_post_modified( $id1, '2016-04-20 4:26:20' );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->update_post_modified( $id2, '2016-02-01 20:24:02' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -445,19 +445,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">        public function test_get_items_orderby_parent_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id3 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id3 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -483,8 +483,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">        public function test_get_items_exclude_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->post->create( array( 'post_status' => 'publish' ) );
-               $id2 = $this->factory->post->create( array( 'post_status' => 'publish' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->post->create( array( 'post_status' => 'publish' ) );
+               $id2 = self::factory()->post->create( array( 'post_status' => 'publish' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request  = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -513,7 +513,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_search_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'  => 'Search Result',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -535,13 +535,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_slug_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'  => 'Apple',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'  => 'Banana',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -558,19 +558,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">        public function test_get_items_multiple_slugs_array_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'  => 'Apple',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'  => 'Banana',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'  => 'Peach',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -592,19 +592,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">        public function test_get_items_multiple_slugs_string_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'  => 'Apple',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'  => 'Banana',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'  => 'Peach',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -628,7 +628,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_status_query() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create( array( 'post_status' => 'draft' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create( array( 'post_status' => 'draft' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'per_page', self::$per_page );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -654,9 +654,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_multiple_statuses_string_query() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create( array( 'post_status' => 'draft' ) );
-               $this->factory->post->create( array( 'post_status' => 'private' ) );
-               $this->factory->post->create( array( 'post_status' => 'publish' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create( array( 'post_status' => 'draft' ) );
+               self::factory()->post->create( array( 'post_status' => 'private' ) );
+               self::factory()->post->create( array( 'post_status' => 'publish' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'context', 'edit' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -677,9 +677,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_multiple_statuses_array_query() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create( array( 'post_status' => 'draft' ) );
-               $this->factory->post->create( array( 'post_status' => 'pending' ) );
-               $this->factory->post->create( array( 'post_status' => 'publish' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create( array( 'post_status' => 'draft' ) );
+               self::factory()->post->create( array( 'post_status' => 'pending' ) );
+               self::factory()->post->create( array( 'post_status' => 'publish' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'context', 'edit' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -709,7 +709,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 43701
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_multiple_statuses_custom_role_one_invalid_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $private_post_id = $this->factory->post->create( array( 'post_status' => 'private' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $private_post_id = self::factory()->post->create( array( 'post_status' => 'private' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$private_reader_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -730,7 +730,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_status_without_permissions() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $draft_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $draft_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'draft',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -750,25 +750,25 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_order_and_orderby() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'  => 'Apple Pie',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'  => 'Apple Sauce',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'  => 'Apple Cobbler',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'  => 'Apple Coffee Cake',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -805,7 +805,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_with_orderby_include_without_include_param() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create( array( 'post_status' => 'publish' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create( array( 'post_status' => 'publish' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'orderby', 'include' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -816,19 +816,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">        public function test_get_items_with_orderby_id() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_date'   => '2016-01-13 02:26:48',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_date'   => '2016-01-12 02:26:48',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id3 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id3 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_date'   => '2016-01-11 02:26:48',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -850,7 +850,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_with_orderby_slug() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'  => 'ABC',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_name'   => 'xyz',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -857,7 +857,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'  => 'XYZ',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_name'   => 'abc',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -881,7 +881,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_with_orderby_slugs() {
</span><span class="cx" style="display: block; padding: 0 10px">                $slugs = array( 'burrito', 'taco', 'chalupa' );
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( $slugs as $slug ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                                 array(
</span><span class="cx" style="display: block; padding: 0 10px">                                        'post_title'  => $slug,
</span><span class="cx" style="display: block; padding: 0 10px">                                        'post_name'   => $slug,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -903,7 +903,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_with_orderby_relevance() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'   => 'Title is more relevant',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => 'Content is',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -910,7 +910,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status'  => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'   => 'Title is',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => 'Content is less relevant',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -931,7 +931,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_with_orderby_relevance_two_terms() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'   => 'Title is more relevant',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => 'Content is',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -938,7 +938,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status'  => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'   => 'Title is',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => 'Content is less relevant',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1005,9 +1005,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_tags_exclude_query() {
</span><span class="cx" style="display: block; padding: 0 10px">                $id1 = self::$post_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->post->create( array( 'post_status' => 'publish' ) );
-               $id3 = $this->factory->post->create( array( 'post_status' => 'publish' ) );
-               $id4 = $this->factory->post->create( array( 'post_status' => 'publish' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->post->create( array( 'post_status' => 'publish' ) );
+               $id3 = self::factory()->post->create( array( 'post_status' => 'publish' ) );
+               $id4 = self::factory()->post->create( array( 'post_status' => 'publish' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $tag = wp_insert_term( 'My Tag', 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $total_posts = self::$total_posts + 3;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1028,7 +1028,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_tags_and_categories_query() {
</span><span class="cx" style="display: block; padding: 0 10px">                $id1      = self::$post_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2      = $this->factory->post->create( array( 'post_status' => 'publish' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2      = self::factory()->post->create( array( 'post_status' => 'publish' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $tag      = wp_insert_term( 'My Tag', 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px">                $category = wp_insert_term( 'My Category', 'category' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1053,7 +1053,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_tags_or_categories_query() {
</span><span class="cx" style="display: block; padding: 0 10px">                $id1      = self::$post_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2      = $this->factory->post->create( array( 'post_status' => 'publish' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2      = self::factory()->post->create( array( 'post_status' => 'publish' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $tag      = wp_insert_term( 'My Tag', 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px">                $category = wp_insert_term( 'My Category', 'category' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1075,7 +1075,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_tags_and_categories_exclude_query() {
</span><span class="cx" style="display: block; padding: 0 10px">                $id1      = self::$post_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2      = $this->factory->post->create( array( 'post_status' => 'publish' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2      = self::factory()->post->create( array( 'post_status' => 'publish' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $tag      = wp_insert_term( 'My Tag', 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px">                $category = wp_insert_term( 'My Category', 'category' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1102,9 +1102,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_tags_or_categories_exclude_query() {
</span><span class="cx" style="display: block; padding: 0 10px">                $id1      = end( self::$post_ids );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2      = $this->factory->post->create( array( 'post_status' => 'publish' ) );
-               $id3      = $this->factory->post->create( array( 'post_status' => 'publish' ) );
-               $id4      = $this->factory->post->create( array( 'post_status' => 'publish' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2      = self::factory()->post->create( array( 'post_status' => 'publish' ) );
+               $id3      = self::factory()->post->create( array( 'post_status' => 'publish' ) );
+               $id4      = self::factory()->post->create( array( 'post_status' => 'publish' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $tag      = wp_insert_term( 'My Tag', 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px">                $category = wp_insert_term( 'My Category', 'category' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1366,7 +1366,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_sticky() {
</span><span class="cx" style="display: block; padding: 0 10px">                $id1 = self::$post_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->post->create( array( 'post_status' => 'publish' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->post->create( array( 'post_status' => 'publish' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                update_option( 'sticky_posts', array( $id2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1387,7 +1387,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_sticky_with_include() {
</span><span class="cx" style="display: block; padding: 0 10px">                $id1 = self::$post_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->post->create( array( 'post_status' => 'publish' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->post->create( array( 'post_status' => 'publish' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                update_option( 'sticky_posts', array( $id2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1455,7 +1455,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_not_sticky() {
</span><span class="cx" style="display: block; padding: 0 10px">                $id1 = end( self::$post_ids );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->post->create( array( 'post_status' => 'publish' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->post->create( array( 'post_status' => 'publish' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $total_posts = self::$total_posts + 1;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1477,8 +1477,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_not_sticky_with_exclude() {
</span><span class="cx" style="display: block; padding: 0 10px">                $id1 = end( self::$post_ids );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->post->create( array( 'post_status' => 'publish' ) );
-               $id3 = $this->factory->post->create( array( 'post_status' => 'publish' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->post->create( array( 'post_status' => 'publish' ) );
+               $id3 = self::factory()->post->create( array( 'post_status' => 'publish' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $total_posts = self::$total_posts + 2;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1503,8 +1503,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_not_sticky_with_exclude_no_sticky_posts() {
</span><span class="cx" style="display: block; padding: 0 10px">                $id1 = self::$post_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->post->create( array( 'post_status' => 'publish' ) );
-               $id3 = $this->factory->post->create( array( 'post_status' => 'publish' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->post->create( array( 'post_status' => 'publish' ) );
+               $id3 = self::factory()->post->create( array( 'post_status' => 'publish' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $total_posts = self::$total_posts + 2;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1574,7 +1574,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $parent_id2       = self::$post_ids[1];
</span><span class="cx" style="display: block; padding: 0 10px">                $parent_ids       = array( $parent_id1, $parent_id2 );
</span><span class="cx" style="display: block; padding: 0 10px">                $attachment_ids   = array();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_ids[] = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_ids[] = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         DIR_TESTDATA . '/images/canola.jpg',
</span><span class="cx" style="display: block; padding: 0 10px">                        $parent_id1,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1583,7 +1583,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_ids[] = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_ids[] = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         DIR_TESTDATA . '/images/canola.jpg',
</span><span class="cx" style="display: block; padding: 0 10px">                        $parent_id2,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1628,7 +1628,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertStringContainsString( '<' . $next_link . '>; rel="next"', $headers['Link'] );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // 3rd page.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 $total_posts++;
</span><span class="cx" style="display: block; padding: 0 10px">                $total_pages++;
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1707,7 +1707,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_status_draft_permissions() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $draft_id = $this->factory->post->create( array( 'post_status' => 'draft' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $draft_id = self::factory()->post->create( array( 'post_status' => 'draft' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Drafts status query var inaccessible to unauthorized users.
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( 0 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1737,7 +1737,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 43701
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_status_private_permissions() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $private_post_id = $this->factory->post->create( array( 'post_status' => 'private' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $private_post_id = self::factory()->post->create( array( 'post_status' => 'private' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1792,9 +1792,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">        public function test_get_items_valid_date() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post1 = $this->factory->post->create( array( 'post_date' => '2016-01-15T00:00:00Z' ) );
-               $post2 = $this->factory->post->create( array( 'post_date' => '2016-01-16T00:00:00Z' ) );
-               $post3 = $this->factory->post->create( array( 'post_date' => '2016-01-17T00:00:00Z' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post1 = self::factory()->post->create( array( 'post_date' => '2016-01-15T00:00:00Z' ) );
+               $post2 = self::factory()->post->create( array( 'post_date' => '2016-01-16T00:00:00Z' ) );
+               $post3 = self::factory()->post->create( array( 'post_date' => '2016-01-17T00:00:00Z' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'after', '2016-01-15T00:00:00Z' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1820,9 +1820,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 50617
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_valid_modified_date() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post1 = $this->factory->post->create( array( 'post_date' => '2016-01-01 00:00:00' ) );
-               $post2 = $this->factory->post->create( array( 'post_date' => '2016-01-02 00:00:00' ) );
-               $post3 = $this->factory->post->create( array( 'post_date' => '2016-01-03 00:00:00' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post1 = self::factory()->post->create( array( 'post_date' => '2016-01-01 00:00:00' ) );
+               $post2 = self::factory()->post->create( array( 'post_date' => '2016-01-02 00:00:00' ) );
+               $post3 = self::factory()->post->create( array( 'post_date' => '2016-01-03 00:00:00' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->update_post_modified( $post1, '2016-01-15 00:00:00' );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->update_post_modified( $post2, '2016-01-16 00:00:00' );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->update_post_modified( $post3, '2016-01-17 00:00:00' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1940,7 +1940,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_post_draft_status_not_authenticated() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $draft_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $draft_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'draft',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1956,7 +1956,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_post_draft_edit_context() {
</span><span class="cx" style="display: block; padding: 0 10px">                $post_content = 'Hello World!';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'    => 'Hola',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_password' => 'password',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1965,7 +1965,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_author'   => self::$editor_id,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $draft_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $draft_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status'  => 'draft',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_author'  => self::$contributor_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2031,7 +2031,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_post_with_password() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_password' => '$inthebananastand',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2050,7 +2050,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_post_with_password_using_password() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_password' => '$inthebananastand',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content'  => 'Some secret content.',
</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">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_post_with_password_using_incorrect_password() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_password' => '$inthebananastand',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2090,7 +2090,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_post_with_password_without_permission() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_password' => '$inthebananastand',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content'  => 'Some secret content.',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2114,7 +2114,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 43887
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_post_should_not_have_block_version_when_context_view() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => '<!-- wp:core/separator -->',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2134,7 +2134,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_post_should_have_block_version_indicate_block_content_when_context_edit() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => '<!-- wp:core/separator -->',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2155,7 +2155,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_post_should_have_block_version_indicate_no_block_content_when_context_edit() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_content' => '<hr />',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2783,7 +2783,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_create_update_post_with_featured_media() {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $file          = DIR_TESTDATA . '/images/canola.jpg';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $attachment_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $attachment_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         $file,
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3187,7 +3187,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_rest_update_post_with_empty_date() {
</span><span class="cx" style="display: block; padding: 0 10px">                // Create a new test post.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3436,7 +3436,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                update_option( 'timezone_string', $params['timezone_string'] );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create( array( 'post_status' => $status ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create( array( 'post_status' => $status ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/posts/%d', $post_id ) );
</span><span class="cx" style="display: block; padding: 0 10px">                if ( isset( $params['date'] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3501,7 +3501,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Need to set dates using wpdb directly because `wp_update_post` and
</span><span class="cx" style="display: block; padding: 0 10px">                // `wp_insert_post` have additional validation on dates.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 $wpdb->update(
</span><span class="cx" style="display: block; padding: 0 10px">                        $wpdb->posts,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4171,7 +4171,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create( array( 'post_title' => 'Deleted post' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create( array( 'post_title' => 'Deleted post' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4186,7 +4186,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item_skip_trash() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create( array( 'post_title' => 'Deleted post' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create( array( 'post_title' => 'Deleted post' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4201,7 +4201,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item_already_trashed() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create( array( 'post_title' => 'Deleted post' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create( array( 'post_title' => 'Deleted post' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4222,7 +4222,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_post_invalid_post_type() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page_id = $this->factory->post->create( array( 'post_type' => 'page' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page_id = self::factory()->post->create( array( 'post_type' => 'page' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4465,7 +4465,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request  = new WP_REST_Request( 'GET', '/wp/v2/posts/' . $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4510,7 +4510,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'update_callback' => null,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // 'my_custom_int' should appear because ?_fields= isn't set.
</span><span class="cx" style="display: block; padding: 0 10px">                $request  = new WP_REST_Request( 'GET', '/wp/v2/posts/' . $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4931,7 +4931,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'  => 'Permalink Template',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'private-post',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4955,7 +4955,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$editor_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'  => 'Permalink Template',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'post',
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestschemasetupphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php  2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php    2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -205,7 +205,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                // fixture file will be different between runs of PHPUnit tests, which
</span><span class="cx" style="display: block; padding: 0 10px">                // is not desirable.
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $administrator_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $administrator_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role'          => 'administrator',
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name'  => 'REST API Client Fixture: User',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -215,7 +215,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( $administrator_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_name'    => 'restapi-client-fixture-post',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'   => 'REST API Client Fixture: Post',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -243,7 +243,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'     => 'page',
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_name'     => 'restapi-client-fixture-page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -273,7 +273,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $tag_id = $this->factory->tag->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $tag_id = self::factory()->tag->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'        => 'REST API Client Fixture: Tag',
</span><span class="cx" style="display: block; padding: 0 10px">                                'slug'        => 'restapi-client-fixture-tag',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -281,7 +281,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $media_id = $this->factory->attachment->create_object(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $media_id = self::factory()->attachment->create_object(
</ins><span class="cx" style="display: block; padding: 0 10px">                         get_temp_dir() . 'canola.jpg',
</span><span class="cx" style="display: block; padding: 0 10px">                        0,
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -295,7 +295,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $comment_id = $this->factory->comment->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $comment_id = self::factory()->comment->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_approved'     => 1,
</span><span class="cx" style="display: block; padding: 0 10px">                                'comment_post_ID'      => $post_id,
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapiresttagscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/rest-tags-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-tags-controller.php       2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/rest-api/rest-tags-controller.php 2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -139,7 +139,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSameSets( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px">                // Single.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $tag1     = $this->factory->tag->create( array( 'name' => 'Season 5' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $tag1     = self::factory()->tag->create( array( 'name' => 'Season 5' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $request  = new WP_REST_Request( 'OPTIONS', '/wp/v2/tags/' . $tag1 );
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">                $data     = $response->get_data();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -174,7 +174,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->tag->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->tag->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'per_page', self::$per_page );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -192,9 +192,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">        public function test_get_items_hide_empty_arg() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
-               $tag1    = $this->factory->tag->create( array( 'name' => 'Season 5' ) );
-               $tag2    = $this->factory->tag->create( array( 'name' => 'The Be Sharps' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
+               $tag1    = self::factory()->tag->create( array( 'name' => 'Season 5' ) );
+               $tag2    = self::factory()->tag->create( array( 'name' => 'The Be Sharps' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_object_terms( $post_id, array( $tag1, $tag2 ), 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -213,8 +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">        public function test_get_items_include_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->tag->create();
-               $id2 = $this->factory->tag->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->tag->create();
+               $id2 = self::factory()->tag->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -239,8 +239,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">        public function test_get_items_exclude_query() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->tag->create();
-               $id2 = $this->factory->tag->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->tag->create();
+               $id2 = self::factory()->tag->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'per_page', self::$per_page );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -288,8 +288,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">        public function test_get_items_orderby_args() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $tag1 = $this->factory->tag->create( array( 'name' => 'Apple' ) );
-               $tag2 = $this->factory->tag->create( array( 'name' => 'Zucchini' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $tag1 = self::factory()->tag->create( array( 'name' => 'Apple' ) );
+               $tag2 = self::factory()->tag->create( array( 'name' => 'Zucchini' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                /*
</span><span class="cx" style="display: block; padding: 0 10px">                 * Tests:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -324,9 +324,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">        public function test_get_items_orderby_id() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $tag0 = $this->factory->tag->create( array( 'name' => 'Cantaloupe' ) );
-               $tag1 = $this->factory->tag->create( array( 'name' => 'Apple' ) );
-               $tag2 = $this->factory->tag->create( array( 'name' => 'Banana' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $tag0 = self::factory()->tag->create( array( 'name' => 'Cantaloupe' ) );
+               $tag1 = self::factory()->tag->create( array( 'name' => 'Apple' ) );
+               $tag2 = self::factory()->tag->create( array( 'name' => 'Banana' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Defaults to 'orderby' => 'name', 'order' => 'asc'.
</span><span class="cx" style="display: block; padding: 0 10px">                $request  = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -360,9 +360,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">        public function test_get_items_orderby_slugs() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->tag->create( array( 'name' => 'Burrito' ) );
-               $this->factory->tag->create( array( 'name' => 'Taco' ) );
-               $this->factory->tag->create( array( 'name' => 'Chalupa' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->tag->create( array( 'name' => 'Burrito' ) );
+               self::factory()->tag->create( array( 'name' => 'Taco' ) );
+               self::factory()->tag->create( array( 'name' => 'Chalupa' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'orderby', 'include_slugs' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -376,10 +376,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">        public function test_get_items_post_args() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
-               $tag1    = $this->factory->tag->create( array( 'name' => 'DC' ) );
-               $tag2    = $this->factory->tag->create( array( 'name' => 'Marvel' ) );
-               $this->factory->tag->create( array( 'name' => 'Dark Horse' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
+               $tag1    = self::factory()->tag->create( array( 'name' => 'DC' ) );
+               $tag2    = self::factory()->tag->create( array( 'name' => 'Marvel' ) );
+               self::factory()->tag->create( array( 'name' => 'Dark Horse' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_object_terms( $post_id, array( $tag1, $tag2 ), 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -400,7 +400,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_terms_post_args_paging() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_object_terms( $post_id, self::$tag_ids, 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -437,7 +437,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_post_empty() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'post', $post_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -452,25 +452,25 @@
</span><span class="cx" style="display: block; padding: 0 10px">                register_taxonomy( 'batman', 'post', array( 'show_in_rest' => true ) );
</span><span class="cx" style="display: block; padding: 0 10px">                $controller = new WP_REST_Terms_Controller( 'batman' );
</span><span class="cx" style="display: block; padding: 0 10px">                $controller->register_routes();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term1 = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term1 = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Cape',
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'batman',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term2 = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term2 = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Mask',
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'batman',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Car',
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'batman',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_object_terms( $post_id, array( $term1, $term2 ), 'batman' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -485,8 +485,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">        public function test_get_items_search_args() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $tag1 = $this->factory->tag->create( array( 'name' => 'Apple' ) );
-               $tag2 = $this->factory->tag->create( array( 'name' => 'Banana' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $tag1 = self::factory()->tag->create( array( 'name' => 'Apple' ) );
+               $tag2 = self::factory()->tag->create( array( 'name' => 'Banana' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                /*
</span><span class="cx" style="display: block; padding: 0 10px">                 * Tests:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -509,8 +509,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">        public function test_get_items_slug_arg() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $tag1 = $this->factory->tag->create( array( 'name' => 'Apple' ) );
-               $tag2 = $this->factory->tag->create( array( 'name' => 'Banana' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $tag1 = self::factory()->tag->create( array( 'name' => 'Apple' ) );
+               $tag2 = self::factory()->tag->create( array( 'name' => 'Banana' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'slug', 'apple' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -522,10 +522,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">        public function test_get_items_slug_array_arg() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->tag->create( array( 'name' => 'Taco' ) );
-               $id2 = $this->factory->tag->create( array( 'name' => 'Enchilada' ) );
-               $id3 = $this->factory->tag->create( array( 'name' => 'Burrito' ) );
-               $this->factory->tag->create( array( 'name' => 'Pizza' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->tag->create( array( 'name' => 'Taco' ) );
+               $id2 = self::factory()->tag->create( array( 'name' => 'Enchilada' ) );
+               $id3 = self::factory()->tag->create( array( 'name' => 'Burrito' ) );
+               self::factory()->tag->create( array( 'name' => 'Pizza' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -545,10 +545,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_slug_csv_arg() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->tag->create( array( 'name' => 'Taco' ) );
-               $id2 = $this->factory->tag->create( array( 'name' => 'Enchilada' ) );
-               $id3 = $this->factory->tag->create( array( 'name' => 'Burrito' ) );
-               $this->factory->tag->create( array( 'name' => 'Pizza' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->tag->create( array( 'name' => 'Taco' ) );
+               $id2 = self::factory()->tag->create( array( 'name' => 'Enchilada' ) );
+               $id3 = self::factory()->tag->create( array( 'name' => 'Burrito' ) );
+               self::factory()->tag->create( array( 'name' => 'Pizza' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'slug', 'taco,burrito, enchilada' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -562,13 +562,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_terms_private_taxonomy() {
</span><span class="cx" style="display: block; padding: 0 10px">                register_taxonomy( 'robin', 'post', array( 'public' => false ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term1 = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term1 = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Cape',
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'robin',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term2 = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term2 = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Mask',
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'robin',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -600,7 +600,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertStringContainsString( '<' . $next_link . '>; rel="next"', $headers['Link'] );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // 3rd page.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->tag->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->tag->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 $total_tags++;
</span><span class="cx" style="display: block; padding: 0 10px">                $total_pages++;
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -665,7 +665,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id = $this->factory->tag->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id = self::factory()->tag->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request  = new WP_REST_Request( 'GET', '/wp/v2/tags/' . $id );
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -676,7 +676,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 39122
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item_meta() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id = $this->factory->tag->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id = self::factory()->tag->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request  = new WP_REST_Request( 'GET', '/wp/v2/tags/' . $id );
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -698,7 +698,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 39122
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item_meta_registered_for_different_taxonomy() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id = $this->factory->tag->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id = self::factory()->tag->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request  = new WP_REST_Request( 'GET', '/wp/v2/tags/' . $id );
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -716,7 +716,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item_invalid_permission_for_context() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id = $this->factory->tag->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id = self::factory()->tag->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -728,7 +728,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_term_private_taxonomy() {
</span><span class="cx" style="display: block; padding: 0 10px">                register_taxonomy( 'robin', 'post', array( 'public' => false ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term1 = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term1 = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Cape',
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'robin',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -742,7 +742,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item_incorrect_taxonomy() {
</span><span class="cx" style="display: block; padding: 0 10px">                register_taxonomy( 'robin', 'post' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term1 = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term1 = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Cape',
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'robin',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -833,7 +833,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_create_item_with_meta_wrong_id() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$administrator );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $existing_tag_id = $this->factory->tag->create( array( 'name' => 'My Not So Awesome Term' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $existing_tag_id = self::factory()->tag->create( array( 'name' => 'My Not So Awesome Term' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'POST', '/wp/v2/tags' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'name', 'My Awesome Term' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -858,7 +858,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'slug'        => 'original-slug',
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term = get_term_by( 'id', $this->factory->tag->create( $orig_args ), 'post_tag' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term = get_term_by( 'id', self::factory()->tag->create( $orig_args ), 'post_tag' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'POST', '/wp/v2/tags/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'name', 'New Name' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -886,7 +886,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_no_change() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$administrator );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term = get_term_by( 'id', $this->factory->tag->create(), 'post_tag' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term = get_term_by( 'id', self::factory()->tag->create(), 'post_tag' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request  = new WP_REST_Request( 'PUT', '/wp/v2/tags/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -914,7 +914,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_incorrect_permissions() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$subscriber );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term = get_term_by( 'id', $this->factory->tag->create(), 'post_tag' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term = get_term_by( 'id', self::factory()->tag->create(), 'post_tag' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'POST', '/wp/v2/tags/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'name', 'Incorrect permissions' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -928,7 +928,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_with_edit_term_cap_granted() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$subscriber );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term = $this->factory->tag->create_and_get();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term = self::factory()->tag->create_and_get();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'POST', '/wp/v2/tags/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'name', 'New Name' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -955,7 +955,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_with_edit_term_cap_revoked() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$administrator );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term = $this->factory->tag->create_and_get();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term = self::factory()->tag->create_and_get();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'POST', '/wp/v2/tags/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'name', 'New Name' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -977,7 +977,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_parent_non_hierarchical_taxonomy() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$administrator );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term = get_term_by( 'id', $this->factory->tag->create(), 'post_tag' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term = get_term_by( 'id', self::factory()->tag->create(), 'post_tag' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'POST', '/wp/v2/tags/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'parent', REST_TESTS_IMPOSSIBLY_HIGH_NUMBER );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1104,7 +1104,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$administrator );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term = get_term_by( 'id', $this->factory->tag->create( array( 'name' => 'Deleted Tag' ) ), 'post_tag' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term = get_term_by( 'id', self::factory()->tag->create( array( 'name' => 'Deleted Tag' ) ), 'post_tag' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'DELETE', '/wp/v2/tags/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'force', true );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1118,7 +1118,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item_no_trash() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$administrator );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term = get_term_by( 'id', $this->factory->tag->create( array( 'name' => 'Deleted Tag' ) ), 'post_tag' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term = get_term_by( 'id', self::factory()->tag->create( array( 'name' => 'Deleted Tag' ) ), 'post_tag' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request  = new WP_REST_Request( 'DELETE', '/wp/v2/tags/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1140,7 +1140,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item_incorrect_permissions() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$subscriber );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term = get_term_by( 'id', $this->factory->tag->create(), 'post_tag' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term = get_term_by( 'id', self::factory()->tag->create(), 'post_tag' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request  = new WP_REST_Request( 'DELETE', '/wp/v2/tags/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1153,7 +1153,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item_with_delete_term_cap_granted() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$subscriber );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term = get_term_by( 'id', $this->factory->tag->create( array( 'name' => 'Deleted Tag' ) ), 'post_tag' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term = get_term_by( 'id', self::factory()->tag->create( array( 'name' => 'Deleted Tag' ) ), 'post_tag' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'DELETE', '/wp/v2/tags/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'force', true );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1181,7 +1181,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item_with_delete_term_cap_revoked() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$administrator );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term = get_term_by( 'id', $this->factory->tag->create( array( 'name' => 'Deleted Tag' ) ), 'post_tag' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term = get_term_by( 'id', self::factory()->tag->create( array( 'name' => 'Deleted Tag' ) ), 'post_tag' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'DELETE', '/wp/v2/tags/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'force', true );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1201,7 +1201,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_prepare_item() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term = get_term_by( 'id', $this->factory->tag->create(), 'post_tag' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term = get_term_by( 'id', self::factory()->tag->create(), 'post_tag' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request  = new WP_REST_Request( 'GET', '/wp/v2/tags/' . $term->term_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1214,7 +1214,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $request  = new WP_REST_Request;
</span><span class="cx" style="display: block; padding: 0 10px">                $endpoint = new WP_REST_Terms_Controller( 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( '_fields', 'id,name' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term     = get_term_by( 'id', $this->factory->tag->create(), 'post_tag' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term     = get_term_by( 'id', self::factory()->tag->create(), 'post_tag' );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $response = $endpoint->prepare_item_for_response( $term, $request );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame(
</span><span class="cx" style="display: block; padding: 0 10px">                        array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1276,7 +1276,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertArrayHasKey( 'my_custom_int', $data['schema']['properties'] );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame( $schema, $data['schema']['properties']['my_custom_int'] );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $tag_id = $this->factory->tag->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $tag_id = self::factory()->tag->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request  = new WP_REST_Request( 'GET', '/wp/v2/tags/' . $tag_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1306,7 +1306,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$administrator );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $tag_id = $this->factory->tag->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $tag_id = self::factory()->tag->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Check for error on update.
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'POST', sprintf( '/wp/v2/tags/%d', $tag_id ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1330,8 +1330,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_object_term_queries_are_cached() {
</span><span class="cx" style="display: block; padding: 0 10px">                global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $tags = $this->factory->tag->create_many( 2 );
-               $p    = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $tags = self::factory()->tag->create_many( 2 );
+               $p    = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 wp_set_object_terms( $p, $tags[0], 'post_tag' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/tags' );
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapiresttaxonomiescontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/rest-taxonomies-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-taxonomies-controller.php 2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/rest-api/rest-taxonomies-controller.php   2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -112,7 +112,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item_edit_context() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $editor_id = $this->factory->user->create( array( 'role' => 'editor' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $editor_id = self::factory()->user->create( array( 'role' => 'editor' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 wp_set_current_user( $editor_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/taxonomies/category' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'context', 'edit' );
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapiresttermmetafieldsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/rest-term-meta-fields.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-term-meta-fields.php      2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/rest-api/rest-term-meta-fields.php        2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -200,7 +200,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        protected function grant_write_permission() {
</span><span class="cx" style="display: block; padding: 0 10px">                // Ensure we have write permission.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role' => 'editor',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestuserscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/rest-users-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-users-controller.php      2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/rest-api/rest-users-controller.php        2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -340,7 +340,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertStringContainsString( '<' . $next_link . '>; rel="next"', $headers['Link'] );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // 3rd page.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->user->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->user->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 $total_users++;
</span><span class="cx" style="display: block; padding: 0 10px">                $total_pages++;
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -432,9 +432,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_orderby_name() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$user );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $low_id  = $this->factory->user->create( array( 'display_name' => 'AAAAA' ) );
-               $mid_id  = $this->factory->user->create( array( 'display_name' => 'NNNNN' ) );
-               $high_id = $this->factory->user->create( array( 'display_name' => 'ZZZZ' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $low_id  = self::factory()->user->create( array( 'display_name' => 'AAAAA' ) );
+               $mid_id  = self::factory()->user->create( array( 'display_name' => 'NNNNN' ) );
+               $high_id = self::factory()->user->create( array( 'display_name' => 'ZZZZ' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'orderby', 'name' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -456,8 +456,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_orderby_url() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$user );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $low_id  = $this->factory->user->create( array( 'user_url' => 'http://a.com' ) );
-               $high_id = $this->factory->user->create( array( 'user_url' => 'http://b.com' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $low_id  = self::factory()->user->create( array( 'user_url' => 'http://a.com' ) );
+               $high_id = self::factory()->user->create( array( 'user_url' => 'http://b.com' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'orderby', 'url' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -481,8 +481,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_orderby_slug() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$user );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $high_id = $this->factory->user->create( array( 'user_nicename' => 'blogin' ) );
-               $low_id  = $this->factory->user->create( array( 'user_nicename' => 'alogin' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $high_id = self::factory()->user->create( array( 'user_nicename' => 'blogin' ) );
+               $low_id  = self::factory()->user->create( array( 'user_nicename' => 'alogin' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'orderby', 'slug' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -506,9 +506,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_orderby_slugs() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$user );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->user->create( array( 'user_nicename' => 'burrito' ) );
-               $this->factory->user->create( array( 'user_nicename' => 'taco' ) );
-               $this->factory->user->create( array( 'user_nicename' => 'chalupa' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->user->create( array( 'user_nicename' => 'burrito' ) );
+               self::factory()->user->create( array( 'user_nicename' => 'taco' ) );
+               self::factory()->user->create( array( 'user_nicename' => 'chalupa' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'orderby', 'include_slugs' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -524,8 +524,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_orderby_email() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$user );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $high_id = $this->factory->user->create( array( 'user_email' => 'bemail@gmail.com' ) );
-               $low_id  = $this->factory->user->create( array( 'user_email' => 'aemail@gmail.com' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $high_id = self::factory()->user->create( array( 'user_email' => 'bemail@gmail.com' ) );
+               $low_id  = self::factory()->user->create( array( 'user_email' => 'aemail@gmail.com' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'orderby', 'email' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -604,8 +604,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_include_query() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$user );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->user->create();
-               $id2 = $this->factory->user->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->user->create();
+               $id2 = self::factory()->user->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -640,8 +640,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_exclude_query() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$user );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->user->create();
-               $id2 = $this->factory->user->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->user->create();
+               $id2 = self::factory()->user->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'per_page', self::$per_page ); // There are >10 users at this point.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -672,7 +672,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertCount( 0, $response->get_data() );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $yolo_id = $this->factory->user->create( array( 'display_name' => 'yololololo' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $yolo_id = self::factory()->user->create( array( 'display_name' => 'yololololo' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request = new WP_REST_Request( 'GET', '/wp/v2/users' );
</span><span class="cx" style="display: block; padding: 0 10px">                $request->set_param( 'search', 'yololololo' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -679,7 +679,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertCount( 1, $response->get_data() );
</span><span class="cx" style="display: block; padding: 0 10px">                // Default to wildcard search.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $adam_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $adam_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role'          => 'author',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_nicename' => 'adam',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -697,13 +697,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_slug_query() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$user );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name' => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login'   => 'bar',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name' => 'Moo',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login'   => 'foo',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -721,25 +721,25 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_slug_array_query() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$user );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name' => 'Taco',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login'   => 'taco',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name' => 'Enchilada',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login'   => 'enchilada',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id3 = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id3 = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name' => 'Burrito',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login'   => 'burrito',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name' => 'Hon Pizza',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login'   => 'pizza',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -767,25 +767,25 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_items_slug_csv_query() {
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$user );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id1 = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id1 = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name' => 'Taco',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login'   => 'taco',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id2 = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id2 = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name' => 'Enchilada',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login'   => 'enchilada',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $id3 = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $id3 = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name' => 'Burrito',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login'   => 'burrito',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name' => 'Hon Pizza',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login'   => 'pizza',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -962,7 +962,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$user );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1029,7 +1029,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->allow_user_to_manage_multisite();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $lolz = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $lolz = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name' => 'lolz',
</span><span class="cx" style="display: block; padding: 0 10px">                                'roles'        => '',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1114,13 +1114,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item_published_author_post() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $author_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $author_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role' => 'author',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_author' => $author_id,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1134,7 +1134,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item_published_author_pages() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $author_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $author_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role' => 'author',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1146,7 +1146,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame( 401, $response->get_status() );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_author' => $author_id,
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'page',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1158,7 +1158,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_user_with_edit_context() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->allow_user_to_manage_multisite();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1169,13 +1169,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item_published_author_wrong_context() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $author_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $author_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role' => 'author',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post_id = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post_id = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_author' => $author_id,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1554,7 +1554,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_email' => 'test@example.com',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_pass'  => 'sjflsfls',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1620,13 +1620,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_existing_email() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user1 = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user1 = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login' => 'test_json_user',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_email' => 'testjson@example.com',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user2 = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user2 = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login' => 'test_json_user2',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_email' => 'testjson2@example.com',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1684,7 +1684,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_invalid_locale() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user1 = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user1 = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login' => 'test_json_user',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_email' => 'testjson@example.com',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1703,7 +1703,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_en_US_locale() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login' => 'test_json_user',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_email' => 'testjson@example.com',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1727,7 +1727,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 38632
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_empty_locale() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login' => 'test_json_user',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_email' => 'testjson@example.com',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1751,13 +1751,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_username_attempt() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user1 = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user1 = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login' => 'test_json_user',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_email' => 'testjson@example.com',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user2 = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user2 = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login' => 'test_json_user2',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_email' => 'testjson2@example.com',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1776,13 +1776,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_existing_nicename() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user1 = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user1 = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login' => 'test_json_user',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_email' => 'testjson@example.com',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user2 = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user2 = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login' => 'test_json_user2',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_email' => 'testjson2@example.com',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1801,7 +1801,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_json_update_user() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_email' => 'testjson2@example.com',
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_pass'  => 'sjflsfl3sdjls',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1846,7 +1846,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_user_role() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$user );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1867,7 +1867,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_user_multiple_roles() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$user );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1913,7 +1913,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @group ms-excluded
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_user_role_invalid_privilege_deescalation() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( $user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1942,7 +1942,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @group ms-required
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_user_role_privilege_deescalation_multisite() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $user = wp_get_current_user();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1956,7 +1956,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame( 'editor', $new_data['roles'][0] );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertNotEquals( 'administrator', $new_data['roles'][0] );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">                $user = wp_get_current_user();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2046,7 +2046,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 40263
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_only_roles_as_editor() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role' => 'author',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2064,7 +2064,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 40263
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_only_roles_as_site_administrator() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role' => 'author',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2085,7 +2085,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @ticket 40263
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_including_roles_and_other_params() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role' => 'author',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2341,7 +2341,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create( array( 'display_name' => 'Deleted User' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create( array( 'display_name' => 'Deleted User' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->allow_user_to_manage_multisite();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2366,7 +2366,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item_no_trash() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create( array( 'display_name' => 'Deleted User' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create( array( 'display_name' => 'Deleted User' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->allow_user_to_manage_multisite();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2396,7 +2396,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_current_item() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role'         => 'administrator',
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name' => 'Deleted User',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2425,7 +2425,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_current_item_no_trash() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role'         => 'administrator',
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name' => 'Deleted User',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2458,7 +2458,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_user_without_permission() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->allow_user_to_manage_multisite();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2496,9 +2496,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->allow_user_to_manage_multisite();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Test with a new user, to avoid any complications.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id     = $this->factory->user->create();
-               $reassign_id = $this->factory->user->create();
-               $test_post   = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id     = self::factory()->user->create();
+               $reassign_id = self::factory()->user->create();
+               $test_post   = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_author' => $user_id,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2530,7 +2530,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_user_invalid_reassign_id() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->allow_user_to_manage_multisite();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2551,7 +2551,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_user_invalid_reassign_passed_as_string() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->allow_user_to_manage_multisite();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2566,13 +2566,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_user_reassign_passed_as_boolean_false_trashes_post() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->allow_user_to_manage_multisite();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$user );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $test_post = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $test_post = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_author' => $user_id,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2594,13 +2594,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_user_reassign_passed_as_string_false_trashes_post() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->allow_user_to_manage_multisite();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$user );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $test_post = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $test_post = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_author' => $user_id,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2622,13 +2622,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_user_reassign_passed_as_empty_string_trashes_post() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->allow_user_to_manage_multisite();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$user );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $test_post = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $test_post = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_author' => $user_id,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2650,13 +2650,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_user_reassign_passed_as_0_reassigns_author() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->allow_user_to_manage_multisite();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                wp_set_current_user( self::$user );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $test_post = $this->factory->post->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $test_post = self::factory()->post->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_author' => $user_id,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2831,7 +2831,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item_from_different_site_as_site_administrator() {
</span><span class="cx" style="display: block; padding: 0 10px">                switch_to_blog( self::$site );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role' => 'author',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2851,7 +2851,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_item_from_different_site_as_network_administrator() {
</span><span class="cx" style="display: block; padding: 0 10px">                switch_to_blog( self::$site );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role' => 'author',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2871,7 +2871,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_from_different_site_as_site_administrator() {
</span><span class="cx" style="display: block; padding: 0 10px">                switch_to_blog( self::$site );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role' => 'author',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2893,7 +2893,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_update_item_from_different_site_as_network_administrator() {
</span><span class="cx" style="display: block; padding: 0 10px">                switch_to_blog( self::$site );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role' => 'author',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2915,7 +2915,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item_from_different_site_as_site_administrator() {
</span><span class="cx" style="display: block; padding: 0 10px">                switch_to_blog( self::$site );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role' => 'author',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2937,7 +2937,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_delete_item_from_different_site_as_network_administrator() {
</span><span class="cx" style="display: block; padding: 0 10px">                switch_to_blog( self::$site );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $user_id = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $user_id = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'role' => 'author',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapiwpRestMenusControllerphp"></a>
<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/wpRestMenusController.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/wpRestMenusController.php      2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/rest-api/wpRestMenusController.php        2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -85,7 +85,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'taxonomy'    => 'nav_menu',
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $this->menu_id = $this->factory->term->create( $orig_args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $this->menu_id = self::factory()->term->create( $orig_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                register_meta(
</span><span class="cx" style="display: block; padding: 0 10px">                        'term',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -133,7 +133,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSameSets( array( 'view', 'embed', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] );
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame( array( 'v1' => true ), $data['endpoints'][0]['allow_batch'] );
</span><span class="cx" style="display: block; padding: 0 10px">                // Single.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $tag1     = $this->factory->tag->create( array( 'name' => 'Season 5' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $tag1     = self::factory()->tag->create( array( 'name' => 'Season 5' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $request  = new WP_REST_Request( 'OPTIONS', '/wp/v2/menus/' . $tag1 );
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_get_server()->dispatch( $request );
</span><span class="cx" style="display: block; padding: 0 10px">                $data     = $response->get_data();
</span></span></pre></div>
<a id="trunktestsphpunitteststaxonomyphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/taxonomy.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/taxonomy.php    2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/taxonomy.php      2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -681,13 +681,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'publicly_queryable' => false,
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $t = $this->factory->term->create_and_get(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $t = self::factory()->term->create_and_get(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'wptests_tax',
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $p = $this->factory->post->create();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $p = self::factory()->post->create();
</ins><span class="cx" style="display: block; padding: 0 10px">                 wp_set_object_terms( $p, $t->slug, 'wptests_tax' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                add_filter( 'do_parse_request', array( $this, 'register_query_var' ) );
</span></span></pre></div>
<a id="trunktestsphpunitteststermcachephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/term/cache.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/cache.php  2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/term/cache.php    2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -244,7 +244,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_term_by_slug_cache() {
</span><span class="cx" style="display: block; padding: 0 10px">                global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term_id = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term_id = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'slug'     => 'burrito',
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Taco',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -275,7 +275,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_term_by_slug_cache_update() {
</span><span class="cx" style="display: block; padding: 0 10px">                global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term_id = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term_id = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'slug'     => 'burrito',
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Taco',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -313,7 +313,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_term_by_name_cache() {
</span><span class="cx" style="display: block; padding: 0 10px">                global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term_id = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term_id = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Burrito',
</span><span class="cx" style="display: block; padding: 0 10px">                                'slug'     => 'noburrito',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -342,7 +342,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_term_by_name_cache_update() {
</span><span class="cx" style="display: block; padding: 0 10px">                global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term_id = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term_id = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Burrito',
</span><span class="cx" style="display: block; padding: 0 10px">                                'slug'     => 'noburrito',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -377,7 +377,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_invalidating_term_caches_should_fail_when_invalidation_is_suspended() {
</span><span class="cx" style="display: block; padding: 0 10px">                global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term_id = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term_id = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Burrito',
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'post_tag',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -420,7 +420,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_term_by_does_not_prime_term_meta_cache() {
</span><span class="cx" style="display: block; padding: 0 10px">                global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term_id = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term_id = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'Burrito',
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'post_tag',
</span></span></pre></div>
<a id="trunktestsphpunitteststermgetTermByphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/term/getTermBy.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/getTermBy.php      2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/term/getTermBy.php        2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -196,7 +196,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_query_should_not_contain_order_by_clause() {
</span><span class="cx" style="display: block; padding: 0 10px">                global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term_id = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term_id = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'burrito',
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'post_tag',
</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">         * @ticket 21760
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_query_should_contain_limit_clause() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term_id = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term_id = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => 'burrito',
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'post_tag',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -242,7 +242,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_term_by_name_with_string_0() {
</span><span class="cx" style="display: block; padding: 0 10px">                register_taxonomy( 'wptests_tax', 'post', array( 'hierarchical' => true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term_id = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term_id = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => '0',
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'wptests_tax',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -259,7 +259,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_term_by_slug_with_string_0() {
</span><span class="cx" style="display: block; padding: 0 10px">                register_taxonomy( 'wptests_tax', 'post', array( 'hierarchical' => true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $term_id = $this->factory->term->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $term_id = self::factory()->term->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'taxonomy' => 'wptests_tax',
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'     => '0',
</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   2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/user/capabilities.php     2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1828,7 +1828,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $contributor = self::$users['contributor'];
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Give them a scheduled post.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $post = $this->factory->post->create_and_get(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post = self::factory()->post->create_and_get(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_author' => $contributor->ID,
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_status' => 'future',
</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  2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/user/query.php    2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1665,7 +1665,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_search_by_display_name_only() {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $new_user1          = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $new_user1          = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login'   => 'name1',
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name' => 'Sophia Andresen',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1693,7 +1693,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_search_by_display_name_only_ignore_others() {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $new_user1          = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $new_user1          = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login'   => 'Sophia Andresen',
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name' => 'name1',
</span></span></pre></div>
<a id="trunktestsphpunittestsuserwpDropdownUsersphp"></a>
<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/wpDropdownUsers.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/user/wpDropdownUsers.php        2022-09-06 22:03:23 UTC (rev 54089)
+++ trunk/tests/phpunit/tests/user/wpDropdownUsers.php  2022-09-06 22:09:49 UTC (rev 54090)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,7 +13,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_default_value_of_show_should_be_display_name() {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Create a user with a different display_name.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $u = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $u = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login'   => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name' => 'Foo Person',
</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">        public function test_show_should_display_display_name_show_is_specified_as_empty() {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Create a user with a different display_name.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $u = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $u = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login'   => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name' => 'Foo Person',
</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">        public function test_show_should_display_user_property_when_the_value_of_show_is_a_valid_user_property() {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Create a user with a different display_name.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $u = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $u = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login'   => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name' => 'Foo Person',
</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">        public function test_show_display_name_with_login() {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Create a user with a different display_name.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $u = $this->factory->user->create(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $u = self::factory()->user->create(
</ins><span class="cx" style="display: block; padding: 0 10px">                         array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'user_login'   => 'foo',
</span><span class="cx" style="display: block; padding: 0 10px">                                'display_name' => 'Foo Person',
</span></span></pre>
</div>
</div>

</body>
</html>