<!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>[51492] trunk/tests/phpunit/tests/sitemaps: Tests: Rename classes in `phpunit/tests/sitemaps/` per the naming conventions.</title>
</head>
<body>

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

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

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

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

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

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunktestsphpunittestssitemapsfunctionsphp">trunk/tests/phpunit/tests/sitemaps/functions.php</a></li>
<li><a href="#trunktestsphpunittestssitemapssitemapsphp">trunk/tests/phpunit/tests/sitemaps/sitemaps.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunktestsphpunittestssitemapswpSitemapsIndexphp">trunk/tests/phpunit/tests/sitemaps/wpSitemapsIndex.php</a></li>
<li><a href="#trunktestsphpunittestssitemapswpSitemapsPostsphp">trunk/tests/phpunit/tests/sitemaps/wpSitemapsPosts.php</a></li>
<li><a href="#trunktestsphpunittestssitemapswpSitemapsRegistryphp">trunk/tests/phpunit/tests/sitemaps/wpSitemapsRegistry.php</a></li>
<li><a href="#trunktestsphpunittestssitemapswpSitemapsRendererphp">trunk/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php</a></li>
<li><a href="#trunktestsphpunittestssitemapswpSitemapsStylesheetphp">trunk/tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php</a></li>
<li><a href="#trunktestsphpunittestssitemapswpSitemapsTaxonomiesphp">trunk/tests/phpunit/tests/sitemaps/wpSitemapsTaxonomies.php</a></li>
<li><a href="#trunktestsphpunittestssitemapswpSitemapsUsersphp">trunk/tests/phpunit/tests/sitemaps/wpSitemapsUsers.php</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunktestsphpunittestssitemapssitemapsindexphp">trunk/tests/phpunit/tests/sitemaps/sitemaps-index.php</a></li>
<li><a href="#trunktestsphpunittestssitemapssitemapspostsphp">trunk/tests/phpunit/tests/sitemaps/sitemaps-posts.php</a></li>
<li><a href="#trunktestsphpunittestssitemapssitemapsregistryphp">trunk/tests/phpunit/tests/sitemaps/sitemaps-registry.php</a></li>
<li><a href="#trunktestsphpunittestssitemapssitemapsrendererphp">trunk/tests/phpunit/tests/sitemaps/sitemaps-renderer.php</a></li>
<li><a href="#trunktestsphpunittestssitemapssitemapsstylesheetphp">trunk/tests/phpunit/tests/sitemaps/sitemaps-stylesheet.php</a></li>
<li><a href="#trunktestsphpunittestssitemapssitemapstaxonomiesphp">trunk/tests/phpunit/tests/sitemaps/sitemaps-taxonomies.php</a></li>
<li><a href="#trunktestsphpunittestssitemapssitemapsusersphp">trunk/tests/phpunit/tests/sitemaps/sitemaps-users.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunktestsphpunittestssitemapsfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/sitemaps/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/functions.php  2021-07-26 18:45:48 UTC (rev 51491)
+++ trunk/tests/phpunit/tests/sitemaps/functions.php    2021-07-26 19:09:41 UTC (rev 51492)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3,7 +3,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px">  * @group sitemaps
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-class Test_Sitemaps_Functions extends WP_UnitTestCase {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+class Tests_Sitemaps_Functions extends WP_UnitTestCase {
+
</ins><span class="cx" style="display: block; padding: 0 10px">         /**
</span><span class="cx" style="display: block; padding: 0 10px">         * Test getting the correct number of URLs for a sitemap.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,11 +61,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * Test get_sitemap_url() with ugly permalinks.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * Test get_sitemap_url() with plain permalinks.
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @dataProvider ugly_permalinks_provider
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * @dataProvider plain_permalinks_provider
</ins><span class="cx" style="display: block; padding: 0 10px">          */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        public function test_get_sitemap_url_ugly_permalinks( $name, $subtype_name, $page, $expected ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_get_sitemap_url_plain_permalinks( $name, $subtype_name, $page, $expected ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 $actual = get_sitemap_url( $name, $subtype_name, $page );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame( $expected, $actual );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -84,7 +85,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * Data provider for test_get_sitemap_url_ugly_permalinks.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * Data provider for test_get_sitemap_url_plain_permalinks.
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><span class="cx" style="display: block; padding: 0 10px">         * @return array[] {
</span><span class="cx" style="display: block; padding: 0 10px">         *     Data to test with.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -95,7 +96,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         *     @type string|false $4 Sitemap URL.
</span><span class="cx" style="display: block; padding: 0 10px">         * }
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function ugly_permalinks_provider() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function plain_permalinks_provider() {
</ins><span class="cx" style="display: block; padding: 0 10px">                 return array(
</span><span class="cx" style="display: block; padding: 0 10px">                        array( 'posts', 'post', 1, home_url( '/?sitemap=posts&sitemap-subtype=post&paged=1' ) ),
</span><span class="cx" style="display: block; padding: 0 10px">                        array( 'posts', 'post', 0, home_url( '/?sitemap=posts&sitemap-subtype=post&paged=1' ) ),
</span></span></pre></div>
<a id="trunktestsphpunittestssitemapssitemapsindexphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/sitemaps/sitemaps-index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/sitemaps-index.php     2021-07-26 18:45:48 UTC (rev 51491)
+++ trunk/tests/phpunit/tests/sitemaps/sitemaps-index.php       2021-07-26 19:09:41 UTC (rev 51492)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,74 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group sitemaps
- */
-class Test_WP_Sitemaps_Index extends WP_UnitTestCase {
-       public function test_get_sitemap_list() {
-               $registry = new WP_Sitemaps_Registry();
-
-               /*
-                * The test provider has 3 subtypes.
-                * Each subtype has 4 pages with results.
-                * There are 2 providers registered.
-                * Hence, 3*4*2=24.
-                */
-               $registry->add_provider( 'foo', new WP_Sitemaps_Test_Provider( 'foo' ) );
-               $registry->add_provider( 'bar', new WP_Sitemaps_Test_Provider( 'bar' ) );
-
-               $sitemap_index = new WP_Sitemaps_Index( $registry );
-               $this->assertCount( 24, $sitemap_index->get_sitemap_list() );
-       }
-
-       /**
-        * Test that a sitemap index won't contain more than 50000 sitemaps.
-        *
-        * @ticket 50666
-        */
-       public function test_get_sitemap_list_limit() {
-               $registry = new WP_Sitemaps_Registry();
-
-               // add 3 providers, which combined produce more than the maximum 50000 sitemaps in the index.
-               $registry->add_provider( 'provider_1', new WP_Sitemaps_Large_Test_Provider( 25000 ) );
-               $registry->add_provider( 'provider_2', new WP_Sitemaps_Large_Test_Provider( 25000 ) );
-               $registry->add_provider( 'provider_3', new WP_Sitemaps_Large_Test_Provider( 25000 ) );
-
-               $count = 0;
-               foreach ( $registry->get_providers() as $provider ) {
-                       $count += count( $provider->get_url_list( 1 ) );
-               }
-               $this->assertGreaterThan( 50000, $count );
-
-               $sitemap_index = new WP_Sitemaps_Index( $registry );
-               $this->assertCount( 50000, $sitemap_index->get_sitemap_list() );
-       }
-
-       public function test_get_sitemap_list_no_entries() {
-               $registry = new WP_Sitemaps_Registry();
-
-               $registry->add_provider( 'foo', new WP_Sitemaps_Empty_Test_Provider( 'foo' ) );
-
-               $sitemap_index = new WP_Sitemaps_Index( $registry );
-               $this->assertCount( 0, $sitemap_index->get_sitemap_list() );
-       }
-
-       public function test_get_index_url() {
-               $sitemap_index = new WP_Sitemaps_Index( new WP_Sitemaps_Registry() );
-               $index_url     = $sitemap_index->get_index_url();
-
-               $this->assertStringEndsWith( '/?sitemap=index', $index_url );
-       }
-
-       public function test_get_index_url_pretty_permalinks() {
-               // Set permalinks for testing.
-               $this->set_permalink_structure( '/%year%/%postname%/' );
-
-               $sitemap_index = new WP_Sitemaps_Index( new WP_Sitemaps_Registry() );
-               $index_url     = $sitemap_index->get_index_url();
-
-               // Clean up permalinks.
-               $this->set_permalink_structure();
-
-               $this->assertStringEndsWith( '/wp-sitemap.xml', $index_url );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestssitemapssitemapspostsphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/sitemaps/sitemaps-posts.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/sitemaps-posts.php     2021-07-26 18:45:48 UTC (rev 51491)
+++ trunk/tests/phpunit/tests/sitemaps/sitemaps-posts.php       2021-07-26 19:09:41 UTC (rev 51492)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,72 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group sitemaps
- */
-class Test_WP_Sitemaps_Posts extends WP_UnitTestCase {
-       /**
-        * Tests getting sitemap entries for post type page with 'posts' homepage.
-        *
-        * Ensures that an entry is added even if there are no pages.
-        *
-        * @ticket 50571
-        */
-       public function test_get_sitemap_entries_homepage() {
-               update_option( 'show_on_front', 'posts' );
-
-               $posts_provider = new WP_Sitemaps_Posts();
-
-               $post_list = $posts_provider->get_sitemap_entries();
-
-               $expected = array(
-                       array(
-                               'loc' => home_url( '/?sitemap=posts&sitemap-subtype=page&paged=1' ),
-                       ),
-               );
-
-               $this->assertSame( $expected, $post_list );
-       }
-
-       /**
-        * Test ability to filter object subtypes.
-        */
-       public function test_filter_sitemaps_post_types() {
-               $posts_provider = new WP_Sitemaps_Posts();
-
-               // Return an empty array to show that the list of subtypes is filterable.
-               add_filter( 'wp_sitemaps_post_types', '__return_empty_array' );
-               $subtypes = $posts_provider->get_object_subtypes();
-
-               $this->assertSame( array(), $subtypes, 'Could not filter posts subtypes.' );
-       }
-
-       /**
-        * Test `wp_sitemaps_posts_show_on_front_entry` filter.
-        */
-       public function test_posts_show_on_front_entry() {
-               $posts_provider = new WP_Sitemaps_Posts();
-               update_option( 'show_on_front', 'page' );
-
-               add_filter( 'wp_sitemaps_posts_show_on_front_entry', array( $this, '_show_on_front_entry' ) );
-
-               $url_list = $posts_provider->get_url_list( 1, 'page' );
-
-               $this->assertSame( array(), $url_list );
-
-               update_option( 'show_on_front', 'posts' );
-
-               $url_list      = $posts_provider->get_url_list( 1, 'page' );
-               $sitemap_entry = array_shift( $url_list );
-
-               $this->assertArrayHasKey( 'lastmod', $sitemap_entry );
-       }
-
-       /**
-        * Callback for 'wp_sitemaps_posts_show_on_front_entry' filter.
-        */
-       public function _show_on_front_entry( $sitemap_entry ) {
-               $sitemap_entry['lastmod'] = wp_date( DATE_W3C, time() );
-
-               return $sitemap_entry;
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestssitemapssitemapsregistryphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/sitemaps/sitemaps-registry.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/sitemaps-registry.php  2021-07-26 18:45:48 UTC (rev 51491)
+++ trunk/tests/phpunit/tests/sitemaps/sitemaps-registry.php    2021-07-26 19:09:41 UTC (rev 51492)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,33 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group sitemaps
- */
-class Test_WP_Sitemaps_Registry extends WP_UnitTestCase {
-       public function test_add_provider() {
-               $provider = new WP_Sitemaps_Test_Provider();
-               $registry = new WP_Sitemaps_Registry();
-
-               $actual    = $registry->add_provider( 'foo', $provider );
-               $providers = $registry->get_providers();
-
-               $this->assertTrue( $actual );
-               $this->assertCount( 1, $providers );
-               $this->assertSame( $providers['foo'], $provider, 'Can not confirm sitemap registration is working.' );
-       }
-
-       public function test_add_provider_prevent_duplicates() {
-               $provider1 = new WP_Sitemaps_Test_Provider();
-               $provider2 = new WP_Sitemaps_Test_Provider();
-               $registry  = new WP_Sitemaps_Registry();
-
-               $actual1   = $registry->add_provider( 'foo', $provider1 );
-               $actual2   = $registry->add_provider( 'foo', $provider2 );
-               $providers = $registry->get_providers();
-
-               $this->assertTrue( $actual1 );
-               $this->assertFalse( $actual2 );
-               $this->assertCount( 1, $providers );
-               $this->assertSame( $providers['foo'], $provider1, 'Can not confirm sitemap registration is working.' );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestssitemapssitemapsrendererphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/sitemaps/sitemaps-renderer.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/sitemaps-renderer.php  2021-07-26 18:45:48 UTC (rev 51491)
+++ trunk/tests/phpunit/tests/sitemaps/sitemaps-renderer.php    2021-07-26 19:09:41 UTC (rev 51492)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,283 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group sitemaps
- */
-class Test_WP_Sitemaps_Renderer extends WP_Test_XML_TestCase {
-       public function test_get_sitemap_stylesheet_url() {
-               $sitemap_renderer = new WP_Sitemaps_Renderer();
-               $stylesheet_url   = $sitemap_renderer->get_sitemap_stylesheet_url();
-
-               $this->assertStringEndsWith( '/?sitemap-stylesheet=sitemap', $stylesheet_url );
-       }
-
-       public function test_get_sitemap_stylesheet_url_pretty_permalinks() {
-               // Set permalinks for testing.
-               $this->set_permalink_structure( '/%year%/%postname%/' );
-
-               $sitemap_renderer = new WP_Sitemaps_Renderer();
-               $stylesheet_url   = $sitemap_renderer->get_sitemap_stylesheet_url();
-
-               // Clean up permalinks.
-               $this->set_permalink_structure();
-
-               $this->assertStringEndsWith( '/wp-sitemap.xsl', $stylesheet_url );
-       }
-
-       public function test_get_sitemap_index_stylesheet_url() {
-               $sitemap_renderer = new WP_Sitemaps_Renderer();
-               $stylesheet_url   = $sitemap_renderer->get_sitemap_index_stylesheet_url();
-
-               $this->assertStringEndsWith( '/?sitemap-stylesheet=index', $stylesheet_url );
-       }
-
-       public function test_get_sitemap_index_stylesheet_url_pretty_permalinks() {
-               // Set permalinks for testing.
-               $this->set_permalink_structure( '/%year%/%postname%/' );
-
-               $sitemap_renderer = new WP_Sitemaps_Renderer();
-               $stylesheet_url   = $sitemap_renderer->get_sitemap_index_stylesheet_url();
-
-               // Clean up permalinks.
-               $this->set_permalink_structure();
-
-               $this->assertStringEndsWith( '/wp-sitemap-index.xsl', $stylesheet_url );
-       }
-
-       /**
-        * Test XML output for the sitemap index renderer.
-        */
-       public function test_get_sitemap_index_xml() {
-               $entries = array(
-                       array(
-                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-post-1.xml',
-                       ),
-                       array(
-                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-page-1.xml',
-                       ),
-                       array(
-                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-taxonomies-category-1.xml',
-                       ),
-                       array(
-                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-taxonomies-post_tag-1.xml',
-                       ),
-                       array(
-                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-users-1.xml',
-                       ),
-               );
-
-               $renderer = new WP_Sitemaps_Renderer();
-
-               $actual   = $renderer->get_sitemap_index_xml( $entries );
-               $expected = '<?xml version="1.0" encoding="UTF-8"?>' .
-                                       '<?xml-stylesheet type="text/xsl" href="http://' . WP_TESTS_DOMAIN . '/?sitemap-stylesheet=index" ?>' .
-                                       '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' .
-                                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-post-1.xml</loc></sitemap>' .
-                                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-page-1.xml</loc></sitemap>' .
-                                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-taxonomies-category-1.xml</loc></sitemap>' .
-                                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-taxonomies-post_tag-1.xml</loc></sitemap>' .
-                                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-users-1.xml</loc></sitemap>' .
-                                       '</sitemapindex>';
-
-               $this->assertXMLEquals( $expected, $actual, 'Sitemap index markup incorrect.' );
-       }
-
-       /**
-        * Test XML output for the sitemap index renderer with lastmod attributes.
-        */
-       public function test_get_sitemap_index_xml_with_lastmod() {
-               $entries = array(
-                       array(
-                               'loc'     => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-post-1.xml',
-                               'lastmod' => '2005-01-01',
-                       ),
-                       array(
-                               'loc'     => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-page-1.xml',
-                               'lastmod' => '2005-01-01',
-                       ),
-                       array(
-                               'loc'     => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-taxonomies-category-1.xml',
-                               'lastmod' => '2005-01-01',
-                       ),
-                       array(
-                               'loc'     => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-taxonomies-post_tag-1.xml',
-                               'lastmod' => '2005-01-01',
-                       ),
-                       array(
-                               'loc'     => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-users-1.xml',
-                               'lastmod' => '2005-01-01',
-                       ),
-               );
-
-               $renderer = new WP_Sitemaps_Renderer();
-
-               $actual   = $renderer->get_sitemap_index_xml( $entries );
-               $expected = '<?xml version="1.0" encoding="UTF-8"?>' .
-                       '<?xml-stylesheet type="text/xsl" href="http://' . WP_TESTS_DOMAIN . '/?sitemap-stylesheet=index" ?>' .
-                       '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' .
-                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-post-1.xml</loc><lastmod>2005-01-01</lastmod></sitemap>' .
-                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-page-1.xml</loc><lastmod>2005-01-01</lastmod></sitemap>' .
-                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-taxonomies-category-1.xml</loc><lastmod>2005-01-01</lastmod></sitemap>' .
-                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-taxonomies-post_tag-1.xml</loc><lastmod>2005-01-01</lastmod></sitemap>' .
-                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-users-1.xml</loc><lastmod>2005-01-01</lastmod></sitemap>' .
-                       '</sitemapindex>';
-
-               $this->assertXMLEquals( $expected, $actual, 'Sitemap index markup incorrect.' );
-       }
-
-       /**
-        * Test that all children of Q{http://www.sitemaps.org/schemas/sitemap/0.9}sitemap in the
-        * rendered index XML are defined in the Sitemaps spec (i.e., loc, lastmod).
-        *
-        * Note that when a means of adding elements in extension namespaces is settled on,
-        * this test will need to be updated accordingly.
-        *
-        * @expectedIncorrectUsage WP_Sitemaps_Renderer::get_sitemap_index_xml
-        */
-       public function test_get_sitemap_index_xml_extra_elements() {
-               $url_list = array(
-                       array(
-                               'loc'     => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-post-1.xml',
-                               'unknown' => 'this is a test',
-                       ),
-                       array(
-                               'loc'     => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-page-1.xml',
-                               'unknown' => 'that was a test',
-                       ),
-               );
-
-               $renderer = new WP_Sitemaps_Renderer();
-
-               $xml_dom = $this->loadXML( $renderer->get_sitemap_index_xml( $url_list ) );
-               $xpath   = new DOMXPath( $xml_dom );
-               $xpath->registerNamespace( 'sitemap', 'http://www.sitemaps.org/schemas/sitemap/0.9' );
-
-               $this->assertEquals(
-                       0,
-                       $xpath->evaluate( "count( /sitemap:sitemapindex/sitemap:sitemap/*[  namespace-uri() != 'http://www.sitemaps.org/schemas/sitemap/0.9' or not( local-name() = 'loc' or local-name() = 'lastmod' ) ] )" ),
-                       'Invalid child of "sitemap:sitemap" in rendered index XML.'
-               );
-       }
-
-       /**
-        * Test XML output for the sitemap index renderer when stylesheet is disabled.
-        */
-       public function test_get_sitemap_index_xml_without_stylesheet() {
-               $entries = array(
-                       array(
-                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-post-1.xml',
-                       ),
-               );
-
-               add_filter( 'wp_sitemaps_stylesheet_index_url', '__return_false' );
-
-               $renderer = new WP_Sitemaps_Renderer();
-
-               $xml_dom = $this->loadXML( $renderer->get_sitemap_index_xml( $entries ) );
-               $xpath   = new DOMXPath( $xml_dom );
-
-               $this->assertSame(
-                       0,
-                       $xpath->query( '//processing-instruction( "xml-stylesheet" )' )->length,
-                       'Sitemap index incorrectly contains the xml-stylesheet processing instruction.'
-               );
-       }
-
-       /**
-        * Test XML output for the sitemap page renderer.
-        */
-       public function test_get_sitemap_xml() {
-               $url_list = array(
-                       array(
-                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-1',
-                       ),
-                       array(
-                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-2',
-                       ),
-                       array(
-                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-3',
-                       ),
-                       array(
-                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-4',
-                       ),
-                       array(
-                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-5',
-                       ),
-               );
-
-               $renderer = new WP_Sitemaps_Renderer();
-
-               $actual   = $renderer->get_sitemap_xml( $url_list );
-               $expected = '<?xml version="1.0" encoding="UTF-8"?>' .
-                                       '<?xml-stylesheet type="text/xsl" href="http://' . WP_TESTS_DOMAIN . '/?sitemap-stylesheet=sitemap" ?>' .
-                                       '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' .
-                                       '<url><loc>http://' . WP_TESTS_DOMAIN . '/2019/10/post-1</loc></url>' .
-                                       '<url><loc>http://' . WP_TESTS_DOMAIN . '/2019/10/post-2</loc></url>' .
-                                       '<url><loc>http://' . WP_TESTS_DOMAIN . '/2019/10/post-3</loc></url>' .
-                                       '<url><loc>http://' . WP_TESTS_DOMAIN . '/2019/10/post-4</loc></url>' .
-                                       '<url><loc>http://' . WP_TESTS_DOMAIN . '/2019/10/post-5</loc></url>' .
-                                       '</urlset>';
-
-               $this->assertXMLEquals( $expected, $actual, 'Sitemap page markup incorrect.' );
-       }
-
-       /**
-        * Test XML output for the sitemap page renderer when stylesheet is disabled.
-        */
-       public function test_get_sitemap_xml_without_stylesheet() {
-               $url_list = array(
-                       array(
-                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-1',
-                       ),
-               );
-
-               add_filter( 'wp_sitemaps_stylesheet_url', '__return_false' );
-
-               $renderer = new WP_Sitemaps_Renderer();
-
-               $xml_dom = $this->loadXML( $renderer->get_sitemap_xml( $url_list ) );
-               $xpath   = new DOMXPath( $xml_dom );
-
-               $this->assertSame(
-                       0,
-                       $xpath->query( '//processing-instruction( "xml-stylesheet" )' )->length,
-                       'Sitemap incorrectly contains the xml-stylesheet processing instruction.'
-               );
-       }
-
-       /**
-        * Test that all children of Q{http://www.sitemaps.org/schemas/sitemap/0.9}url in the
-        * rendered sitemap XML are defined in the Sitemaps spec (i.e., loc, lastmod, changefreq, priority).
-        *
-        * Note that when a means of adding elements in extension namespaces is settled on,
-        * this test will need to be updated accordingly.
-        *
-        * @expectedIncorrectUsage WP_Sitemaps_Renderer::get_sitemap_xml
-        */
-       public function test_get_sitemap_xml_extra_elements() {
-               $url_list = array(
-                       array(
-                               'loc'    => 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-1',
-                               'string' => 'value',
-                               'number' => 200,
-                       ),
-                       array(
-                               'loc'    => 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-2',
-                               'string' => 'another value',
-                               'number' => 300,
-                       ),
-               );
-
-               $renderer = new WP_Sitemaps_Renderer();
-
-               $xml_dom = $this->loadXML( $renderer->get_sitemap_xml( $url_list ) );
-               $xpath   = new DOMXPath( $xml_dom );
-               $xpath->registerNamespace( 'sitemap', 'http://www.sitemaps.org/schemas/sitemap/0.9' );
-
-               $this->assertEquals(
-                       0,
-                       $xpath->evaluate( "count( /sitemap:urlset/sitemap:url/*[  namespace-uri() != 'http://www.sitemaps.org/schemas/sitemap/0.9' or not( local-name() = 'loc' or local-name() = 'lastmod' or local-name() = 'changefreq' or local-name() = 'priority' ) ] )" ),
-                       'Invalid child of "sitemap:url" in rendered XML.'
-               );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestssitemapssitemapsstylesheetphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/sitemaps/sitemaps-stylesheet.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/sitemaps-stylesheet.php        2021-07-26 18:45:48 UTC (rev 51491)
+++ trunk/tests/phpunit/tests/sitemaps/sitemaps-stylesheet.php  2021-07-26 19:09:41 UTC (rev 51492)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,42 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group sitemaps
- */
-class Test_WP_Sitemaps_Stylesheet extends WP_UnitTestCase {
-       /**
-        * Test that stylesheet content can be filtered.
-        */
-       public function test_filter_sitemaps_stylesheet_content() {
-               $stylesheet = new WP_Sitemaps_Stylesheet();
-
-               add_filter( 'wp_sitemaps_stylesheet_content', '__return_empty_string' );
-               $content = $stylesheet->get_sitemap_stylesheet();
-
-               $this->assertSame( '', $content, 'Could not filter stylesheet content' );
-       }
-
-       /**
-        * Test that sitemap index stylesheet content can be filtered.
-        */
-       public function test_filter_sitemaps_stylesheet_index_content() {
-               $stylesheet = new WP_Sitemaps_Stylesheet();
-
-               add_filter( 'wp_sitemaps_stylesheet_index_content', '__return_empty_string' );
-               $content = $stylesheet->get_sitemap_index_stylesheet();
-
-               $this->assertSame( '', $content, 'Could not filter sitemap index stylesheet content' );
-       }
-
-       /**
-        * Test that sitemap stylesheet CSS can be filtered.
-        */
-       public function test_filter_sitemaps_stylesheet_css() {
-               $stylesheet = new WP_Sitemaps_Stylesheet();
-
-               add_filter( 'wp_sitemaps_stylesheet_css', '__return_empty_string' );
-               $css = $stylesheet->get_stylesheet_css();
-
-               $this->assertSame( '', $css, 'Could not filter sitemap stylesheet CSS' );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestssitemapssitemapstaxonomiesphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/sitemaps/sitemaps-taxonomies.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/sitemaps-taxonomies.php        2021-07-26 18:45:48 UTC (rev 51491)
+++ trunk/tests/phpunit/tests/sitemaps/sitemaps-taxonomies.php  2021-07-26 19:09:41 UTC (rev 51492)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,221 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group sitemaps
- */
-class Test_WP_Sitemaps_Taxonomies extends WP_UnitTestCase {
-       /**
-        * List of post_tag IDs.
-        *
-        * @var array
-        */
-       public static $post_tags;
-
-       /**
-        * List of category IDs.
-        *
-        * @var array
-        */
-       public static $cats;
-
-       /**
-        * Editor ID for use in some tests.
-        *
-        * @var int
-        */
-       public static $editor_id;
-
-       /**
-        * Set up fixtures.
-        *
-        * @param WP_UnitTest_Factory $factory A WP_UnitTest_Factory object.
-        */
-       public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
-               self::$cats      = $factory->term->create_many( 10, array( 'taxonomy' => 'category' ) );
-               self::$post_tags = $factory->term->create_many( 10 );
-               self::$editor_id = $factory->user->create( array( 'role' => 'editor' ) );
-       }
-
-       /**
-        * Test getting a URL list for default taxonomies via
-        * WP_Sitemaps_Taxonomies::get_url_list().
-        */
-       public function test_get_url_list_taxonomies() {
-               // Add the default category to the list of categories we're testing.
-               $categories = array_merge( array( 1 ), self::$cats );
-
-               // Create a test post to calculate update times.
-               $post = self::factory()->post->create_and_get(
-                       array(
-                               'tags_input'    => self::$post_tags,
-                               'post_category' => $categories,
-                       )
-               );
-
-               $tax_provider = new WP_Sitemaps_Taxonomies();
-
-               $cat_list = $tax_provider->get_url_list( 1, 'category' );
-
-               $expected_cats = array_map(
-                       static function ( $id ) use ( $post ) {
-                               return array(
-                                       'loc' => get_term_link( $id, 'category' ),
-                               );
-                       },
-                       $categories
-               );
-
-               $this->assertSame( $expected_cats, $cat_list, 'Category URL list does not match.' );
-
-               $tag_list = $tax_provider->get_url_list( 1, 'post_tag' );
-
-               $expected_tags = array_map(
-                       static function ( $id ) use ( $post ) {
-                               return array(
-                                       'loc' => get_term_link( $id, 'post_tag' ),
-                               );
-                       },
-                       self::$post_tags
-               );
-
-               $this->assertSame( $expected_tags, $tag_list, 'Post Tags URL list does not match.' );
-       }
-
-       /**
-        * Test getting a URL list for a custom taxonomy via
-        * WP_Sitemaps_Taxonomies::get_url_list().
-        */
-       public function test_get_url_list_custom_taxonomy() {
-               wp_set_current_user( self::$editor_id );
-
-               // Create a custom taxonomy for this test.
-               $taxonomy = 'test_taxonomy';
-               register_taxonomy( $taxonomy, 'post' );
-
-               // Create test terms in the custom taxonomy.
-               $terms = self::factory()->term->create_many( 10, array( 'taxonomy' => $taxonomy ) );
-
-               // Create a test post applied to all test terms.
-               $post = self::factory()->post->create_and_get( array( 'tax_input' => array( $taxonomy => $terms ) ) );
-
-               $expected = array_map(
-                       static function ( $id ) use ( $taxonomy, $post ) {
-                               return array(
-                                       'loc' => get_term_link( $id, $taxonomy ),
-                               );
-                       },
-                       $terms
-               );
-
-               $tax_provider = new WP_Sitemaps_Taxonomies();
-
-               $post_list = $tax_provider->get_url_list( 1, $taxonomy );
-
-               // Clean up.
-               unregister_taxonomy_for_object_type( $taxonomy, 'post' );
-
-               $this->assertSame( $expected, $post_list, 'Custom taxonomy term links are not visible.' );
-       }
-
-       /**
-        * Test getting a URL list for a private custom taxonomy via
-        * WP_Sitemaps_Taxonomies::get_url_list().
-        */
-       public function test_get_url_list_custom_taxonomy_private() {
-               // Create a custom taxonomy for this test.
-               $taxonomy = 'private_taxonomy';
-               register_taxonomy( $taxonomy, 'post', array( 'public' => false ) );
-
-               // Create test terms in the custom taxonomy.
-               $terms = self::factory()->term->create_many( 10, array( 'taxonomy' => $taxonomy ) );
-
-               // Create a test post applied to all test terms.
-               self::factory()->post->create( array( 'tax_input' => array( $taxonomy => $terms ) ) );
-
-               $tax_provider = new WP_Sitemaps_Taxonomies();
-
-               $post_list = $tax_provider->get_url_list( 1, $taxonomy );
-
-               // Clean up.
-               unregister_taxonomy_for_object_type( $taxonomy, 'post' );
-
-               $this->assertEmpty( $post_list, 'Private taxonomy term links are visible.' );
-       }
-
-       /**
-        * Test getting a URL list for a custom taxonomy that is not publicly queryable.
-        */
-       public function test_get_url_list_custom_taxonomy_not_publicly_queryable() {
-               // Create a custom taxonomy for this test.
-               $taxonomy = 'non_queryable_tax';
-               register_taxonomy( $taxonomy, 'post', array( 'publicly_queryable' => false ) );
-
-               // Create test terms in the custom taxonomy.
-               $terms = self::factory()->term->create_many( 10, array( 'taxonomy' => $taxonomy ) );
-
-               // Create a test post applied to all test terms.
-               self::factory()->post->create( array( 'tax_input' => array( $taxonomy => $terms ) ) );
-
-               $tax_provider = new WP_Sitemaps_Taxonomies();
-
-               $post_list = $tax_provider->get_url_list( 1, $taxonomy );
-
-               // Clean up.
-               unregister_taxonomy_for_object_type( $taxonomy, 'post' );
-
-               $this->assertEmpty( $post_list, 'Non-publicly queryable taxonomy term links are visible.' );
-       }
-
-       /**
-        * Test sitemap index entries with public and private taxonomies.
-        */
-       public function test_get_sitemap_entries_custom_taxonomies() {
-               wp_set_current_user( self::$editor_id );
-
-               // Create a custom public and private taxonomies for this test.
-               register_taxonomy( 'public_taxonomy', 'post' );
-               register_taxonomy( 'non_queryable_taxonomy', 'post', array( 'publicly_queryable' => false ) );
-               register_taxonomy( 'private_taxonomy', 'post', array( 'public' => false ) );
-
-               // Create test terms in the custom taxonomy.
-               $public_term        = self::factory()->term->create( array( 'taxonomy' => 'public_taxonomy' ) );
-               $non_queryable_term = self::factory()->term->create( array( 'taxonomy' => 'non_queryable_taxonomy' ) );
-               $private_term       = self::factory()->term->create( array( 'taxonomy' => 'private_taxonomy' ) );
-
-               // Create a test post applied to all test terms.
-               self::factory()->post->create_and_get(
-                       array(
-                               'tax_input' => array(
-                                       'public_taxonomy'        => array( $public_term ),
-                                       'non_queryable_taxonomy' => array( $non_queryable_term ),
-                                       'private_taxonomy'       => array( $private_term ),
-                               ),
-                       )
-               );
-
-               $tax_provider = new WP_Sitemaps_Taxonomies();
-               $entries      = wp_list_pluck( $tax_provider->get_sitemap_entries(), 'loc' );
-
-               // Clean up.
-               unregister_taxonomy_for_object_type( 'public_taxonomy', 'post' );
-               unregister_taxonomy_for_object_type( 'non_queryable_taxonomy', 'post' );
-               unregister_taxonomy_for_object_type( 'private_taxonomy', 'post' );
-
-               $this->assertContains( 'http://' . WP_TESTS_DOMAIN . '/?sitemap=taxonomies&sitemap-subtype=public_taxonomy&paged=1', $entries, 'Public Taxonomies are not in the index.' );
-               $this->assertNotContains( 'http://' . WP_TESTS_DOMAIN . '/?sitemap=taxonomies&sitemap-subtype=non_queryable_taxonomy&paged=1', $entries, 'Private Taxonomies are visible in the index.' );
-               $this->assertNotContains( 'http://' . WP_TESTS_DOMAIN . '/?sitemap=taxonomies&sitemap-subtype=private_taxonomy&paged=1', $entries, 'Private Taxonomies are visible in the index.' );
-       }
-
-       /**
-        * Test ability to filter object subtypes.
-        */
-       public function test_filter_sitemaps_taxonomies() {
-               $taxonomies_provider = new WP_Sitemaps_Taxonomies();
-
-               // Return an empty array to show that the list of subtypes is filterable.
-               add_filter( 'wp_sitemaps_taxonomies', '__return_empty_array' );
-               $subtypes = $taxonomies_provider->get_object_subtypes();
-
-               $this->assertSame( array(), $subtypes, 'Could not filter taxonomies subtypes.' );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestssitemapssitemapsusersphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/sitemaps/sitemaps-users.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/sitemaps-users.php     2021-07-26 18:45:48 UTC (rev 51491)
+++ trunk/tests/phpunit/tests/sitemaps/sitemaps-users.php       2021-07-26 19:09:41 UTC (rev 51492)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,57 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group sitemaps
- */
-class Test_WP_Sitemaps_Users extends WP_UnitTestCase {
-       /**
-        * List of user IDs.
-        *
-        * @var array
-        */
-       public static $users;
-
-       /**
-        * Editor ID for use in some tests.
-        *
-        * @var int
-        */
-       public static $editor_id;
-
-       /**
-        * Set up fixtures.
-        *
-        * @param WP_UnitTest_Factory $factory A WP_UnitTest_Factory object.
-        */
-       public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
-               self::$users     = $factory->user->create_many( 10, array( 'role' => 'editor' ) );
-               self::$editor_id = self::$users[0];
-       }
-
-       /**
-        * Test getting a URL list for a users sitemap page via
-        * WP_Sitemaps_Users::get_url_list().
-        */
-       public function test_get_url_list_users() {
-               // Set up the user to an editor to assign posts to other users.
-               wp_set_current_user( self::$editor_id );
-
-               // Create a set of posts for each user and generate the expected URL list data.
-               $expected = array_map(
-                       static function ( $user_id ) {
-                               $post = self::factory()->post->create_and_get( array( 'post_author' => $user_id ) );
-
-                               return array(
-                                       'loc' => get_author_posts_url( $user_id ),
-                               );
-                       },
-                       self::$users
-               );
-
-               $user_provider = new WP_Sitemaps_Users();
-
-               $url_list = $user_provider->get_url_list( 1 );
-
-               $this->assertSameSets( $expected, $url_list );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestssitemapssitemapsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/sitemaps/sitemaps.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/sitemaps.php   2021-07-26 18:45:48 UTC (rev 51491)
+++ trunk/tests/phpunit/tests/sitemaps/sitemaps.php     2021-07-26 19:09:41 UTC (rev 51492)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,6 +1,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Sitemaps: Sitemaps_Tests class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Sitemaps: Tests_Sitemaps_Sitemaps class
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * Main test class.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,7 +15,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @group sitemaps
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-class Test_Sitemaps extends WP_UnitTestCase {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+class Tests_Sitemaps_Sitemaps extends WP_UnitTestCase {
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><span class="cx" style="display: block; padding: 0 10px">         * List of user IDs.
</span></span></pre></div>
<a id="trunktestsphpunittestssitemapswpSitemapsIndexphpfromrev51491trunktestsphpunittestssitemapssitemapsindexphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/sitemaps/wpSitemapsIndex.php (from rev 51491, trunk/tests/phpunit/tests/sitemaps/sitemaps-index.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/wpSitemapsIndex.php                            (rev 0)
+++ trunk/tests/phpunit/tests/sitemaps/wpSitemapsIndex.php      2021-07-26 19:09:41 UTC (rev 51492)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,75 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group sitemaps
+ */
+class Tests_Sitemaps_wpSitemapsIndex extends WP_UnitTestCase {
+
+       public function test_get_sitemap_list() {
+               $registry = new WP_Sitemaps_Registry();
+
+               /*
+                * The test provider has 3 subtypes.
+                * Each subtype has 4 pages with results.
+                * There are 2 providers registered.
+                * Hence, 3*4*2=24.
+                */
+               $registry->add_provider( 'foo', new WP_Sitemaps_Test_Provider( 'foo' ) );
+               $registry->add_provider( 'bar', new WP_Sitemaps_Test_Provider( 'bar' ) );
+
+               $sitemap_index = new WP_Sitemaps_Index( $registry );
+               $this->assertCount( 24, $sitemap_index->get_sitemap_list() );
+       }
+
+       /**
+        * Test that a sitemap index won't contain more than 50000 sitemaps.
+        *
+        * @ticket 50666
+        */
+       public function test_get_sitemap_list_limit() {
+               $registry = new WP_Sitemaps_Registry();
+
+               // add 3 providers, which combined produce more than the maximum 50000 sitemaps in the index.
+               $registry->add_provider( 'provider_1', new WP_Sitemaps_Large_Test_Provider( 25000 ) );
+               $registry->add_provider( 'provider_2', new WP_Sitemaps_Large_Test_Provider( 25000 ) );
+               $registry->add_provider( 'provider_3', new WP_Sitemaps_Large_Test_Provider( 25000 ) );
+
+               $count = 0;
+               foreach ( $registry->get_providers() as $provider ) {
+                       $count += count( $provider->get_url_list( 1 ) );
+               }
+               $this->assertGreaterThan( 50000, $count );
+
+               $sitemap_index = new WP_Sitemaps_Index( $registry );
+               $this->assertCount( 50000, $sitemap_index->get_sitemap_list() );
+       }
+
+       public function test_get_sitemap_list_no_entries() {
+               $registry = new WP_Sitemaps_Registry();
+
+               $registry->add_provider( 'foo', new WP_Sitemaps_Empty_Test_Provider( 'foo' ) );
+
+               $sitemap_index = new WP_Sitemaps_Index( $registry );
+               $this->assertCount( 0, $sitemap_index->get_sitemap_list() );
+       }
+
+       public function test_get_index_url() {
+               $sitemap_index = new WP_Sitemaps_Index( new WP_Sitemaps_Registry() );
+               $index_url     = $sitemap_index->get_index_url();
+
+               $this->assertStringEndsWith( '/?sitemap=index', $index_url );
+       }
+
+       public function test_get_index_url_pretty_permalinks() {
+               // Set permalinks for testing.
+               $this->set_permalink_structure( '/%year%/%postname%/' );
+
+               $sitemap_index = new WP_Sitemaps_Index( new WP_Sitemaps_Registry() );
+               $index_url     = $sitemap_index->get_index_url();
+
+               // Clean up permalinks.
+               $this->set_permalink_structure();
+
+               $this->assertStringEndsWith( '/wp-sitemap.xml', $index_url );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestssitemapswpSitemapsPostsphpfromrev51491trunktestsphpunittestssitemapssitemapspostsphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/sitemaps/wpSitemapsPosts.php (from rev 51491, trunk/tests/phpunit/tests/sitemaps/sitemaps-posts.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/wpSitemapsPosts.php                            (rev 0)
+++ trunk/tests/phpunit/tests/sitemaps/wpSitemapsPosts.php      2021-07-26 19:09:41 UTC (rev 51492)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,73 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group sitemaps
+ */
+class Tests_Sitemaps_wpSitemapsPosts extends WP_UnitTestCase {
+
+       /**
+        * Tests getting sitemap entries for post type page with 'posts' homepage.
+        *
+        * Ensures that an entry is added even if there are no pages.
+        *
+        * @ticket 50571
+        */
+       public function test_get_sitemap_entries_homepage() {
+               update_option( 'show_on_front', 'posts' );
+
+               $posts_provider = new WP_Sitemaps_Posts();
+
+               $post_list = $posts_provider->get_sitemap_entries();
+
+               $expected = array(
+                       array(
+                               'loc' => home_url( '/?sitemap=posts&sitemap-subtype=page&paged=1' ),
+                       ),
+               );
+
+               $this->assertSame( $expected, $post_list );
+       }
+
+       /**
+        * Test ability to filter object subtypes.
+        */
+       public function test_filter_sitemaps_post_types() {
+               $posts_provider = new WP_Sitemaps_Posts();
+
+               // Return an empty array to show that the list of subtypes is filterable.
+               add_filter( 'wp_sitemaps_post_types', '__return_empty_array' );
+               $subtypes = $posts_provider->get_object_subtypes();
+
+               $this->assertSame( array(), $subtypes, 'Could not filter posts subtypes.' );
+       }
+
+       /**
+        * Test `wp_sitemaps_posts_show_on_front_entry` filter.
+        */
+       public function test_posts_show_on_front_entry() {
+               $posts_provider = new WP_Sitemaps_Posts();
+               update_option( 'show_on_front', 'page' );
+
+               add_filter( 'wp_sitemaps_posts_show_on_front_entry', array( $this, '_show_on_front_entry' ) );
+
+               $url_list = $posts_provider->get_url_list( 1, 'page' );
+
+               $this->assertSame( array(), $url_list );
+
+               update_option( 'show_on_front', 'posts' );
+
+               $url_list      = $posts_provider->get_url_list( 1, 'page' );
+               $sitemap_entry = array_shift( $url_list );
+
+               $this->assertArrayHasKey( 'lastmod', $sitemap_entry );
+       }
+
+       /**
+        * Callback for 'wp_sitemaps_posts_show_on_front_entry' filter.
+        */
+       public function _show_on_front_entry( $sitemap_entry ) {
+               $sitemap_entry['lastmod'] = wp_date( DATE_W3C, time() );
+
+               return $sitemap_entry;
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestssitemapswpSitemapsRegistryphpfromrev51491trunktestsphpunittestssitemapssitemapsregistryphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/sitemaps/wpSitemapsRegistry.php (from rev 51491, trunk/tests/phpunit/tests/sitemaps/sitemaps-registry.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/wpSitemapsRegistry.php                         (rev 0)
+++ trunk/tests/phpunit/tests/sitemaps/wpSitemapsRegistry.php   2021-07-26 19:09:41 UTC (rev 51492)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,34 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group sitemaps
+ */
+class Tests_Sitemaps_wpSitemapsRegistry extends WP_UnitTestCase {
+
+       public function test_add_provider() {
+               $provider = new WP_Sitemaps_Test_Provider();
+               $registry = new WP_Sitemaps_Registry();
+
+               $actual    = $registry->add_provider( 'foo', $provider );
+               $providers = $registry->get_providers();
+
+               $this->assertTrue( $actual );
+               $this->assertCount( 1, $providers );
+               $this->assertSame( $providers['foo'], $provider, 'Can not confirm sitemap registration is working.' );
+       }
+
+       public function test_add_provider_prevent_duplicates() {
+               $provider1 = new WP_Sitemaps_Test_Provider();
+               $provider2 = new WP_Sitemaps_Test_Provider();
+               $registry  = new WP_Sitemaps_Registry();
+
+               $actual1   = $registry->add_provider( 'foo', $provider1 );
+               $actual2   = $registry->add_provider( 'foo', $provider2 );
+               $providers = $registry->get_providers();
+
+               $this->assertTrue( $actual1 );
+               $this->assertFalse( $actual2 );
+               $this->assertCount( 1, $providers );
+               $this->assertSame( $providers['foo'], $provider1, 'Can not confirm sitemap registration is working.' );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestssitemapswpSitemapsRendererphpfromrev51491trunktestsphpunittestssitemapssitemapsrendererphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php (from rev 51491, trunk/tests/phpunit/tests/sitemaps/sitemaps-renderer.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php                         (rev 0)
+++ trunk/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php   2021-07-26 19:09:41 UTC (rev 51492)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,284 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group sitemaps
+ */
+class Tests_Sitemaps_wpSitemapsRenderer extends WP_Test_XML_TestCase {
+
+       public function test_get_sitemap_stylesheet_url() {
+               $sitemap_renderer = new WP_Sitemaps_Renderer();
+               $stylesheet_url   = $sitemap_renderer->get_sitemap_stylesheet_url();
+
+               $this->assertStringEndsWith( '/?sitemap-stylesheet=sitemap', $stylesheet_url );
+       }
+
+       public function test_get_sitemap_stylesheet_url_pretty_permalinks() {
+               // Set permalinks for testing.
+               $this->set_permalink_structure( '/%year%/%postname%/' );
+
+               $sitemap_renderer = new WP_Sitemaps_Renderer();
+               $stylesheet_url   = $sitemap_renderer->get_sitemap_stylesheet_url();
+
+               // Clean up permalinks.
+               $this->set_permalink_structure();
+
+               $this->assertStringEndsWith( '/wp-sitemap.xsl', $stylesheet_url );
+       }
+
+       public function test_get_sitemap_index_stylesheet_url() {
+               $sitemap_renderer = new WP_Sitemaps_Renderer();
+               $stylesheet_url   = $sitemap_renderer->get_sitemap_index_stylesheet_url();
+
+               $this->assertStringEndsWith( '/?sitemap-stylesheet=index', $stylesheet_url );
+       }
+
+       public function test_get_sitemap_index_stylesheet_url_pretty_permalinks() {
+               // Set permalinks for testing.
+               $this->set_permalink_structure( '/%year%/%postname%/' );
+
+               $sitemap_renderer = new WP_Sitemaps_Renderer();
+               $stylesheet_url   = $sitemap_renderer->get_sitemap_index_stylesheet_url();
+
+               // Clean up permalinks.
+               $this->set_permalink_structure();
+
+               $this->assertStringEndsWith( '/wp-sitemap-index.xsl', $stylesheet_url );
+       }
+
+       /**
+        * Test XML output for the sitemap index renderer.
+        */
+       public function test_get_sitemap_index_xml() {
+               $entries = array(
+                       array(
+                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-post-1.xml',
+                       ),
+                       array(
+                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-page-1.xml',
+                       ),
+                       array(
+                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-taxonomies-category-1.xml',
+                       ),
+                       array(
+                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-taxonomies-post_tag-1.xml',
+                       ),
+                       array(
+                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-users-1.xml',
+                       ),
+               );
+
+               $renderer = new WP_Sitemaps_Renderer();
+
+               $actual   = $renderer->get_sitemap_index_xml( $entries );
+               $expected = '<?xml version="1.0" encoding="UTF-8"?>' .
+                                       '<?xml-stylesheet type="text/xsl" href="http://' . WP_TESTS_DOMAIN . '/?sitemap-stylesheet=index" ?>' .
+                                       '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' .
+                                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-post-1.xml</loc></sitemap>' .
+                                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-page-1.xml</loc></sitemap>' .
+                                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-taxonomies-category-1.xml</loc></sitemap>' .
+                                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-taxonomies-post_tag-1.xml</loc></sitemap>' .
+                                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-users-1.xml</loc></sitemap>' .
+                                       '</sitemapindex>';
+
+               $this->assertXMLEquals( $expected, $actual, 'Sitemap index markup incorrect.' );
+       }
+
+       /**
+        * Test XML output for the sitemap index renderer with lastmod attributes.
+        */
+       public function test_get_sitemap_index_xml_with_lastmod() {
+               $entries = array(
+                       array(
+                               'loc'     => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-post-1.xml',
+                               'lastmod' => '2005-01-01',
+                       ),
+                       array(
+                               'loc'     => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-page-1.xml',
+                               'lastmod' => '2005-01-01',
+                       ),
+                       array(
+                               'loc'     => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-taxonomies-category-1.xml',
+                               'lastmod' => '2005-01-01',
+                       ),
+                       array(
+                               'loc'     => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-taxonomies-post_tag-1.xml',
+                               'lastmod' => '2005-01-01',
+                       ),
+                       array(
+                               'loc'     => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-users-1.xml',
+                               'lastmod' => '2005-01-01',
+                       ),
+               );
+
+               $renderer = new WP_Sitemaps_Renderer();
+
+               $actual   = $renderer->get_sitemap_index_xml( $entries );
+               $expected = '<?xml version="1.0" encoding="UTF-8"?>' .
+                       '<?xml-stylesheet type="text/xsl" href="http://' . WP_TESTS_DOMAIN . '/?sitemap-stylesheet=index" ?>' .
+                       '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' .
+                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-post-1.xml</loc><lastmod>2005-01-01</lastmod></sitemap>' .
+                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-page-1.xml</loc><lastmod>2005-01-01</lastmod></sitemap>' .
+                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-taxonomies-category-1.xml</loc><lastmod>2005-01-01</lastmod></sitemap>' .
+                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-taxonomies-post_tag-1.xml</loc><lastmod>2005-01-01</lastmod></sitemap>' .
+                       '<sitemap><loc>http://' . WP_TESTS_DOMAIN . '/wp-sitemap-users-1.xml</loc><lastmod>2005-01-01</lastmod></sitemap>' .
+                       '</sitemapindex>';
+
+               $this->assertXMLEquals( $expected, $actual, 'Sitemap index markup incorrect.' );
+       }
+
+       /**
+        * Test that all children of Q{http://www.sitemaps.org/schemas/sitemap/0.9}sitemap in the
+        * rendered index XML are defined in the Sitemaps spec (i.e., loc, lastmod).
+        *
+        * Note that when a means of adding elements in extension namespaces is settled on,
+        * this test will need to be updated accordingly.
+        *
+        * @expectedIncorrectUsage WP_Sitemaps_Renderer::get_sitemap_index_xml
+        */
+       public function test_get_sitemap_index_xml_extra_elements() {
+               $url_list = array(
+                       array(
+                               'loc'     => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-post-1.xml',
+                               'unknown' => 'this is a test',
+                       ),
+                       array(
+                               'loc'     => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-page-1.xml',
+                               'unknown' => 'that was a test',
+                       ),
+               );
+
+               $renderer = new WP_Sitemaps_Renderer();
+
+               $xml_dom = $this->loadXML( $renderer->get_sitemap_index_xml( $url_list ) );
+               $xpath   = new DOMXPath( $xml_dom );
+               $xpath->registerNamespace( 'sitemap', 'http://www.sitemaps.org/schemas/sitemap/0.9' );
+
+               $this->assertEquals(
+                       0,
+                       $xpath->evaluate( "count( /sitemap:sitemapindex/sitemap:sitemap/*[  namespace-uri() != 'http://www.sitemaps.org/schemas/sitemap/0.9' or not( local-name() = 'loc' or local-name() = 'lastmod' ) ] )" ),
+                       'Invalid child of "sitemap:sitemap" in rendered index XML.'
+               );
+       }
+
+       /**
+        * Test XML output for the sitemap index renderer when stylesheet is disabled.
+        */
+       public function test_get_sitemap_index_xml_without_stylesheet() {
+               $entries = array(
+                       array(
+                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/wp-sitemap-posts-post-1.xml',
+                       ),
+               );
+
+               add_filter( 'wp_sitemaps_stylesheet_index_url', '__return_false' );
+
+               $renderer = new WP_Sitemaps_Renderer();
+
+               $xml_dom = $this->loadXML( $renderer->get_sitemap_index_xml( $entries ) );
+               $xpath   = new DOMXPath( $xml_dom );
+
+               $this->assertSame(
+                       0,
+                       $xpath->query( '//processing-instruction( "xml-stylesheet" )' )->length,
+                       'Sitemap index incorrectly contains the xml-stylesheet processing instruction.'
+               );
+       }
+
+       /**
+        * Test XML output for the sitemap page renderer.
+        */
+       public function test_get_sitemap_xml() {
+               $url_list = array(
+                       array(
+                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-1',
+                       ),
+                       array(
+                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-2',
+                       ),
+                       array(
+                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-3',
+                       ),
+                       array(
+                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-4',
+                       ),
+                       array(
+                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-5',
+                       ),
+               );
+
+               $renderer = new WP_Sitemaps_Renderer();
+
+               $actual   = $renderer->get_sitemap_xml( $url_list );
+               $expected = '<?xml version="1.0" encoding="UTF-8"?>' .
+                                       '<?xml-stylesheet type="text/xsl" href="http://' . WP_TESTS_DOMAIN . '/?sitemap-stylesheet=sitemap" ?>' .
+                                       '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' .
+                                       '<url><loc>http://' . WP_TESTS_DOMAIN . '/2019/10/post-1</loc></url>' .
+                                       '<url><loc>http://' . WP_TESTS_DOMAIN . '/2019/10/post-2</loc></url>' .
+                                       '<url><loc>http://' . WP_TESTS_DOMAIN . '/2019/10/post-3</loc></url>' .
+                                       '<url><loc>http://' . WP_TESTS_DOMAIN . '/2019/10/post-4</loc></url>' .
+                                       '<url><loc>http://' . WP_TESTS_DOMAIN . '/2019/10/post-5</loc></url>' .
+                                       '</urlset>';
+
+               $this->assertXMLEquals( $expected, $actual, 'Sitemap page markup incorrect.' );
+       }
+
+       /**
+        * Test XML output for the sitemap page renderer when stylesheet is disabled.
+        */
+       public function test_get_sitemap_xml_without_stylesheet() {
+               $url_list = array(
+                       array(
+                               'loc' => 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-1',
+                       ),
+               );
+
+               add_filter( 'wp_sitemaps_stylesheet_url', '__return_false' );
+
+               $renderer = new WP_Sitemaps_Renderer();
+
+               $xml_dom = $this->loadXML( $renderer->get_sitemap_xml( $url_list ) );
+               $xpath   = new DOMXPath( $xml_dom );
+
+               $this->assertSame(
+                       0,
+                       $xpath->query( '//processing-instruction( "xml-stylesheet" )' )->length,
+                       'Sitemap incorrectly contains the xml-stylesheet processing instruction.'
+               );
+       }
+
+       /**
+        * Test that all children of Q{http://www.sitemaps.org/schemas/sitemap/0.9}url in the
+        * rendered sitemap XML are defined in the Sitemaps spec (i.e., loc, lastmod, changefreq, priority).
+        *
+        * Note that when a means of adding elements in extension namespaces is settled on,
+        * this test will need to be updated accordingly.
+        *
+        * @expectedIncorrectUsage WP_Sitemaps_Renderer::get_sitemap_xml
+        */
+       public function test_get_sitemap_xml_extra_elements() {
+               $url_list = array(
+                       array(
+                               'loc'    => 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-1',
+                               'string' => 'value',
+                               'number' => 200,
+                       ),
+                       array(
+                               'loc'    => 'http://' . WP_TESTS_DOMAIN . '/2019/10/post-2',
+                               'string' => 'another value',
+                               'number' => 300,
+                       ),
+               );
+
+               $renderer = new WP_Sitemaps_Renderer();
+
+               $xml_dom = $this->loadXML( $renderer->get_sitemap_xml( $url_list ) );
+               $xpath   = new DOMXPath( $xml_dom );
+               $xpath->registerNamespace( 'sitemap', 'http://www.sitemaps.org/schemas/sitemap/0.9' );
+
+               $this->assertEquals(
+                       0,
+                       $xpath->evaluate( "count( /sitemap:urlset/sitemap:url/*[  namespace-uri() != 'http://www.sitemaps.org/schemas/sitemap/0.9' or not( local-name() = 'loc' or local-name() = 'lastmod' or local-name() = 'changefreq' or local-name() = 'priority' ) ] )" ),
+                       'Invalid child of "sitemap:url" in rendered XML.'
+               );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestssitemapswpSitemapsStylesheetphpfromrev51491trunktestsphpunittestssitemapssitemapsstylesheetphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php (from rev 51491, trunk/tests/phpunit/tests/sitemaps/sitemaps-stylesheet.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php                               (rev 0)
+++ trunk/tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php 2021-07-26 19:09:41 UTC (rev 51492)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,43 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group sitemaps
+ */
+class Tests_Sitemaps_wpSitemapsStylesheet extends WP_UnitTestCase {
+
+       /**
+        * Test that stylesheet content can be filtered.
+        */
+       public function test_filter_sitemaps_stylesheet_content() {
+               $stylesheet = new WP_Sitemaps_Stylesheet();
+
+               add_filter( 'wp_sitemaps_stylesheet_content', '__return_empty_string' );
+               $content = $stylesheet->get_sitemap_stylesheet();
+
+               $this->assertSame( '', $content, 'Could not filter stylesheet content' );
+       }
+
+       /**
+        * Test that sitemap index stylesheet content can be filtered.
+        */
+       public function test_filter_sitemaps_stylesheet_index_content() {
+               $stylesheet = new WP_Sitemaps_Stylesheet();
+
+               add_filter( 'wp_sitemaps_stylesheet_index_content', '__return_empty_string' );
+               $content = $stylesheet->get_sitemap_index_stylesheet();
+
+               $this->assertSame( '', $content, 'Could not filter sitemap index stylesheet content' );
+       }
+
+       /**
+        * Test that sitemap stylesheet CSS can be filtered.
+        */
+       public function test_filter_sitemaps_stylesheet_css() {
+               $stylesheet = new WP_Sitemaps_Stylesheet();
+
+               add_filter( 'wp_sitemaps_stylesheet_css', '__return_empty_string' );
+               $css = $stylesheet->get_stylesheet_css();
+
+               $this->assertSame( '', $css, 'Could not filter sitemap stylesheet CSS' );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestssitemapswpSitemapsTaxonomiesphpfromrev51491trunktestsphpunittestssitemapssitemapstaxonomiesphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/sitemaps/wpSitemapsTaxonomies.php (from rev 51491, trunk/tests/phpunit/tests/sitemaps/sitemaps-taxonomies.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/wpSitemapsTaxonomies.php                               (rev 0)
+++ trunk/tests/phpunit/tests/sitemaps/wpSitemapsTaxonomies.php 2021-07-26 19:09:41 UTC (rev 51492)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,222 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group sitemaps
+ */
+class Tests_Sitemaps_wpSitemapsTaxonomies extends WP_UnitTestCase {
+
+       /**
+        * List of post_tag IDs.
+        *
+        * @var array
+        */
+       public static $post_tags;
+
+       /**
+        * List of category IDs.
+        *
+        * @var array
+        */
+       public static $cats;
+
+       /**
+        * Editor ID for use in some tests.
+        *
+        * @var int
+        */
+       public static $editor_id;
+
+       /**
+        * Set up fixtures.
+        *
+        * @param WP_UnitTest_Factory $factory A WP_UnitTest_Factory object.
+        */
+       public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
+               self::$cats      = $factory->term->create_many( 10, array( 'taxonomy' => 'category' ) );
+               self::$post_tags = $factory->term->create_many( 10 );
+               self::$editor_id = $factory->user->create( array( 'role' => 'editor' ) );
+       }
+
+       /**
+        * Test getting a URL list for default taxonomies via
+        * WP_Sitemaps_Taxonomies::get_url_list().
+        */
+       public function test_get_url_list_taxonomies() {
+               // Add the default category to the list of categories we're testing.
+               $categories = array_merge( array( 1 ), self::$cats );
+
+               // Create a test post to calculate update times.
+               $post = self::factory()->post->create_and_get(
+                       array(
+                               'tags_input'    => self::$post_tags,
+                               'post_category' => $categories,
+                       )
+               );
+
+               $tax_provider = new WP_Sitemaps_Taxonomies();
+
+               $cat_list = $tax_provider->get_url_list( 1, 'category' );
+
+               $expected_cats = array_map(
+                       static function ( $id ) use ( $post ) {
+                               return array(
+                                       'loc' => get_term_link( $id, 'category' ),
+                               );
+                       },
+                       $categories
+               );
+
+               $this->assertSame( $expected_cats, $cat_list, 'Category URL list does not match.' );
+
+               $tag_list = $tax_provider->get_url_list( 1, 'post_tag' );
+
+               $expected_tags = array_map(
+                       static function ( $id ) use ( $post ) {
+                               return array(
+                                       'loc' => get_term_link( $id, 'post_tag' ),
+                               );
+                       },
+                       self::$post_tags
+               );
+
+               $this->assertSame( $expected_tags, $tag_list, 'Post Tags URL list does not match.' );
+       }
+
+       /**
+        * Test getting a URL list for a custom taxonomy via
+        * WP_Sitemaps_Taxonomies::get_url_list().
+        */
+       public function test_get_url_list_custom_taxonomy() {
+               wp_set_current_user( self::$editor_id );
+
+               // Create a custom taxonomy for this test.
+               $taxonomy = 'test_taxonomy';
+               register_taxonomy( $taxonomy, 'post' );
+
+               // Create test terms in the custom taxonomy.
+               $terms = self::factory()->term->create_many( 10, array( 'taxonomy' => $taxonomy ) );
+
+               // Create a test post applied to all test terms.
+               $post = self::factory()->post->create_and_get( array( 'tax_input' => array( $taxonomy => $terms ) ) );
+
+               $expected = array_map(
+                       static function ( $id ) use ( $taxonomy, $post ) {
+                               return array(
+                                       'loc' => get_term_link( $id, $taxonomy ),
+                               );
+                       },
+                       $terms
+               );
+
+               $tax_provider = new WP_Sitemaps_Taxonomies();
+
+               $post_list = $tax_provider->get_url_list( 1, $taxonomy );
+
+               // Clean up.
+               unregister_taxonomy_for_object_type( $taxonomy, 'post' );
+
+               $this->assertSame( $expected, $post_list, 'Custom taxonomy term links are not visible.' );
+       }
+
+       /**
+        * Test getting a URL list for a private custom taxonomy via
+        * WP_Sitemaps_Taxonomies::get_url_list().
+        */
+       public function test_get_url_list_custom_taxonomy_private() {
+               // Create a custom taxonomy for this test.
+               $taxonomy = 'private_taxonomy';
+               register_taxonomy( $taxonomy, 'post', array( 'public' => false ) );
+
+               // Create test terms in the custom taxonomy.
+               $terms = self::factory()->term->create_many( 10, array( 'taxonomy' => $taxonomy ) );
+
+               // Create a test post applied to all test terms.
+               self::factory()->post->create( array( 'tax_input' => array( $taxonomy => $terms ) ) );
+
+               $tax_provider = new WP_Sitemaps_Taxonomies();
+
+               $post_list = $tax_provider->get_url_list( 1, $taxonomy );
+
+               // Clean up.
+               unregister_taxonomy_for_object_type( $taxonomy, 'post' );
+
+               $this->assertEmpty( $post_list, 'Private taxonomy term links are visible.' );
+       }
+
+       /**
+        * Test getting a URL list for a custom taxonomy that is not publicly queryable.
+        */
+       public function test_get_url_list_custom_taxonomy_not_publicly_queryable() {
+               // Create a custom taxonomy for this test.
+               $taxonomy = 'non_queryable_tax';
+               register_taxonomy( $taxonomy, 'post', array( 'publicly_queryable' => false ) );
+
+               // Create test terms in the custom taxonomy.
+               $terms = self::factory()->term->create_many( 10, array( 'taxonomy' => $taxonomy ) );
+
+               // Create a test post applied to all test terms.
+               self::factory()->post->create( array( 'tax_input' => array( $taxonomy => $terms ) ) );
+
+               $tax_provider = new WP_Sitemaps_Taxonomies();
+
+               $post_list = $tax_provider->get_url_list( 1, $taxonomy );
+
+               // Clean up.
+               unregister_taxonomy_for_object_type( $taxonomy, 'post' );
+
+               $this->assertEmpty( $post_list, 'Non-publicly queryable taxonomy term links are visible.' );
+       }
+
+       /**
+        * Test sitemap index entries with public and private taxonomies.
+        */
+       public function test_get_sitemap_entries_custom_taxonomies() {
+               wp_set_current_user( self::$editor_id );
+
+               // Create a custom public and private taxonomies for this test.
+               register_taxonomy( 'public_taxonomy', 'post' );
+               register_taxonomy( 'non_queryable_taxonomy', 'post', array( 'publicly_queryable' => false ) );
+               register_taxonomy( 'private_taxonomy', 'post', array( 'public' => false ) );
+
+               // Create test terms in the custom taxonomy.
+               $public_term        = self::factory()->term->create( array( 'taxonomy' => 'public_taxonomy' ) );
+               $non_queryable_term = self::factory()->term->create( array( 'taxonomy' => 'non_queryable_taxonomy' ) );
+               $private_term       = self::factory()->term->create( array( 'taxonomy' => 'private_taxonomy' ) );
+
+               // Create a test post applied to all test terms.
+               self::factory()->post->create_and_get(
+                       array(
+                               'tax_input' => array(
+                                       'public_taxonomy'        => array( $public_term ),
+                                       'non_queryable_taxonomy' => array( $non_queryable_term ),
+                                       'private_taxonomy'       => array( $private_term ),
+                               ),
+                       )
+               );
+
+               $tax_provider = new WP_Sitemaps_Taxonomies();
+               $entries      = wp_list_pluck( $tax_provider->get_sitemap_entries(), 'loc' );
+
+               // Clean up.
+               unregister_taxonomy_for_object_type( 'public_taxonomy', 'post' );
+               unregister_taxonomy_for_object_type( 'non_queryable_taxonomy', 'post' );
+               unregister_taxonomy_for_object_type( 'private_taxonomy', 'post' );
+
+               $this->assertContains( 'http://' . WP_TESTS_DOMAIN . '/?sitemap=taxonomies&sitemap-subtype=public_taxonomy&paged=1', $entries, 'Public Taxonomies are not in the index.' );
+               $this->assertNotContains( 'http://' . WP_TESTS_DOMAIN . '/?sitemap=taxonomies&sitemap-subtype=non_queryable_taxonomy&paged=1', $entries, 'Private Taxonomies are visible in the index.' );
+               $this->assertNotContains( 'http://' . WP_TESTS_DOMAIN . '/?sitemap=taxonomies&sitemap-subtype=private_taxonomy&paged=1', $entries, 'Private Taxonomies are visible in the index.' );
+       }
+
+       /**
+        * Test ability to filter object subtypes.
+        */
+       public function test_filter_sitemaps_taxonomies() {
+               $taxonomies_provider = new WP_Sitemaps_Taxonomies();
+
+               // Return an empty array to show that the list of subtypes is filterable.
+               add_filter( 'wp_sitemaps_taxonomies', '__return_empty_array' );
+               $subtypes = $taxonomies_provider->get_object_subtypes();
+
+               $this->assertSame( array(), $subtypes, 'Could not filter taxonomies subtypes.' );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestssitemapswpSitemapsUsersphpfromrev51491trunktestsphpunittestssitemapssitemapsusersphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/sitemaps/wpSitemapsUsers.php (from rev 51491, trunk/tests/phpunit/tests/sitemaps/sitemaps-users.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/sitemaps/wpSitemapsUsers.php                            (rev 0)
+++ trunk/tests/phpunit/tests/sitemaps/wpSitemapsUsers.php      2021-07-26 19:09:41 UTC (rev 51492)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,58 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group sitemaps
+ */
+class Tests_Sitemaps_wpSitemapsUsers extends WP_UnitTestCase {
+
+       /**
+        * List of user IDs.
+        *
+        * @var array
+        */
+       public static $users;
+
+       /**
+        * Editor ID for use in some tests.
+        *
+        * @var int
+        */
+       public static $editor_id;
+
+       /**
+        * Set up fixtures.
+        *
+        * @param WP_UnitTest_Factory $factory A WP_UnitTest_Factory object.
+        */
+       public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
+               self::$users     = $factory->user->create_many( 10, array( 'role' => 'editor' ) );
+               self::$editor_id = self::$users[0];
+       }
+
+       /**
+        * Test getting a URL list for a users sitemap page via
+        * WP_Sitemaps_Users::get_url_list().
+        */
+       public function test_get_url_list_users() {
+               // Set up the user to an editor to assign posts to other users.
+               wp_set_current_user( self::$editor_id );
+
+               // Create a set of posts for each user and generate the expected URL list data.
+               $expected = array_map(
+                       static function ( $user_id ) {
+                               $post = self::factory()->post->create_and_get( array( 'post_author' => $user_id ) );
+
+                               return array(
+                                       'loc' => get_author_posts_url( $user_id ),
+                               );
+                       },
+                       self::$users
+               );
+
+               $user_provider = new WP_Sitemaps_Users();
+
+               $url_list = $user_provider->get_url_list( 1 );
+
+               $this->assertSameSets( $expected, $url_list );
+       }
+}
</ins></span></pre>
</div>
</div>

</body>
</html>