From 7f828b6b0090e2c24dc8a14497dbc4f1e586e135 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 26 Jul 2021 19:09:41 +0000 Subject: [PATCH] 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 [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491]. See #53363. git-svn-id: https://develop.svn.wordpress.org/trunk@51492 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/sitemaps/functions.php | 13 +++++++------ tests/phpunit/tests/sitemaps/sitemaps.php | 4 ++-- .../{sitemaps-index.php => wpSitemapsIndex.php} | 3 ++- .../{sitemaps-posts.php => wpSitemapsPosts.php} | 3 ++- ...sitemaps-registry.php => wpSitemapsRegistry.php} | 3 ++- ...sitemaps-renderer.php => wpSitemapsRenderer.php} | 3 ++- ...maps-stylesheet.php => wpSitemapsStylesheet.php} | 3 ++- ...maps-taxonomies.php => wpSitemapsTaxonomies.php} | 3 ++- .../{sitemaps-users.php => wpSitemapsUsers.php} | 3 ++- 9 files changed, 23 insertions(+), 15 deletions(-) rename tests/phpunit/tests/sitemaps/{sitemaps-index.php => wpSitemapsIndex.php} (97%) rename tests/phpunit/tests/sitemaps/{sitemaps-posts.php => wpSitemapsPosts.php} (96%) rename tests/phpunit/tests/sitemaps/{sitemaps-registry.php => wpSitemapsRegistry.php} (93%) rename tests/phpunit/tests/sitemaps/{sitemaps-renderer.php => wpSitemapsRenderer.php} (99%) rename tests/phpunit/tests/sitemaps/{sitemaps-stylesheet.php => wpSitemapsStylesheet.php} (94%) rename tests/phpunit/tests/sitemaps/{sitemaps-taxonomies.php => wpSitemapsTaxonomies.php} (99%) rename tests/phpunit/tests/sitemaps/{sitemaps-users.php => wpSitemapsUsers.php} (95%) diff --git a/tests/phpunit/tests/sitemaps/functions.php b/tests/phpunit/tests/sitemaps/functions.php index a4913fae5f..45eb96b4af 100644 --- a/tests/phpunit/tests/sitemaps/functions.php +++ b/tests/phpunit/tests/sitemaps/functions.php @@ -3,7 +3,8 @@ /** * @group sitemaps */ -class Test_Sitemaps_Functions extends WP_UnitTestCase { +class Tests_Sitemaps_Functions extends WP_UnitTestCase { + /** * Test getting the correct number of URLs for a sitemap. */ @@ -60,11 +61,11 @@ class Test_Sitemaps_Functions extends WP_UnitTestCase { } /** - * Test get_sitemap_url() with ugly permalinks. + * Test get_sitemap_url() with plain permalinks. * - * @dataProvider ugly_permalinks_provider + * @dataProvider plain_permalinks_provider */ - public function test_get_sitemap_url_ugly_permalinks( $name, $subtype_name, $page, $expected ) { + public function test_get_sitemap_url_plain_permalinks( $name, $subtype_name, $page, $expected ) { $actual = get_sitemap_url( $name, $subtype_name, $page ); $this->assertSame( $expected, $actual ); @@ -84,7 +85,7 @@ class Test_Sitemaps_Functions extends WP_UnitTestCase { } /** - * Data provider for test_get_sitemap_url_ugly_permalinks. + * Data provider for test_get_sitemap_url_plain_permalinks. * * @return array[] { * Data to test with. @@ -95,7 +96,7 @@ class Test_Sitemaps_Functions extends WP_UnitTestCase { * @type string|false $4 Sitemap URL. * } */ - function ugly_permalinks_provider() { + function plain_permalinks_provider() { return array( array( 'posts', 'post', 1, home_url( '/?sitemap=posts&sitemap-subtype=post&paged=1' ) ), array( 'posts', 'post', 0, home_url( '/?sitemap=posts&sitemap-subtype=post&paged=1' ) ), diff --git a/tests/phpunit/tests/sitemaps/sitemaps.php b/tests/phpunit/tests/sitemaps/sitemaps.php index 6cbe77b008..a4fa6b14d7 100644 --- a/tests/phpunit/tests/sitemaps/sitemaps.php +++ b/tests/phpunit/tests/sitemaps/sitemaps.php @@ -1,6 +1,6 @@ get_sitemap_stylesheet_url(); diff --git a/tests/phpunit/tests/sitemaps/sitemaps-stylesheet.php b/tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php similarity index 94% rename from tests/phpunit/tests/sitemaps/sitemaps-stylesheet.php rename to tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php index 09aacf0440..b4dab08e48 100644 --- a/tests/phpunit/tests/sitemaps/sitemaps-stylesheet.php +++ b/tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php @@ -3,7 +3,8 @@ /** * @group sitemaps */ -class Test_WP_Sitemaps_Stylesheet extends WP_UnitTestCase { +class Tests_Sitemaps_wpSitemapsStylesheet extends WP_UnitTestCase { + /** * Test that stylesheet content can be filtered. */ diff --git a/tests/phpunit/tests/sitemaps/sitemaps-taxonomies.php b/tests/phpunit/tests/sitemaps/wpSitemapsTaxonomies.php similarity index 99% rename from tests/phpunit/tests/sitemaps/sitemaps-taxonomies.php rename to tests/phpunit/tests/sitemaps/wpSitemapsTaxonomies.php index e98c6b71ee..456efe06e9 100644 --- a/tests/phpunit/tests/sitemaps/sitemaps-taxonomies.php +++ b/tests/phpunit/tests/sitemaps/wpSitemapsTaxonomies.php @@ -3,7 +3,8 @@ /** * @group sitemaps */ -class Test_WP_Sitemaps_Taxonomies extends WP_UnitTestCase { +class Tests_Sitemaps_wpSitemapsTaxonomies extends WP_UnitTestCase { + /** * List of post_tag IDs. * diff --git a/tests/phpunit/tests/sitemaps/sitemaps-users.php b/tests/phpunit/tests/sitemaps/wpSitemapsUsers.php similarity index 95% rename from tests/phpunit/tests/sitemaps/sitemaps-users.php rename to tests/phpunit/tests/sitemaps/wpSitemapsUsers.php index 3cd76d3376..d52e191835 100644 --- a/tests/phpunit/tests/sitemaps/sitemaps-users.php +++ b/tests/phpunit/tests/sitemaps/wpSitemapsUsers.php @@ -3,7 +3,8 @@ /** * @group sitemaps */ -class Test_WP_Sitemaps_Users extends WP_UnitTestCase { +class Tests_Sitemaps_wpSitemapsUsers extends WP_UnitTestCase { + /** * List of user IDs. *