diff options
author | Sergey Biryukov <sergeybiryukov@git.wordpress.org> | 2025-03-31 21:21:05 +0000 |
---|---|---|
committer | Sergey Biryukov <sergeybiryukov@git.wordpress.org> | 2025-03-31 21:21:05 +0000 |
commit | 3998c85e880321877abb8105a5b2a97021745fbf (patch) | |
tree | da1f6a0416c022df7a833e7eb19f7b6a214b496e /tests | |
parent | d52e9453ed10fc30a4df2e5768fb616aabe657bf (diff) | |
download | wordpress-3998c85e880321877abb8105a5b2a97021745fbf.tar.gz wordpress-3998c85e880321877abb8105a5b2a97021745fbf.zip |
Docs: Merge file-level and class-level DocBlocks in `wp_get_canonical_url()` test file.
Per the [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#6-file-headers documentation standards], whenever possible, all WordPress files should contain a header DocBlock, regardless of the file’s contents – this includes files containing classes.
However, this recommendation makes less sense for unit test classes if not applied consistently, and the duplicate tags cause some confusion.
This commit aims to reduce confusion and avoid repeating information by combining the DocBlocks.
Includes using third-person singular verbs in test method descriptions, as per the documentation standards.
Follow-up to [55337], [60108], [60109].
See #63166.
git-svn-id: https://develop.svn.wordpress.org/trunk@60112 602fd350-edb4-49c9-b593-d223f7449a82
Diffstat (limited to 'tests')
-rw-r--r-- | tests/phpunit/tests/link/wpGetCanonicalUrl.php | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/tests/phpunit/tests/link/wpGetCanonicalUrl.php b/tests/phpunit/tests/link/wpGetCanonicalUrl.php index 9c85508af0..8caaf7ad4c 100644 --- a/tests/phpunit/tests/link/wpGetCanonicalUrl.php +++ b/tests/phpunit/tests/link/wpGetCanonicalUrl.php @@ -2,18 +2,12 @@ /** * Tests for the wp_get_canonical_url() function. * - * @package WordPress - * @subpackage Link - */ - -/** - * Class for Testing the wp_get_canonical_url() function. - * * @group link * @group canonical * @covers ::wp_get_canonical_url */ class Tests_Link_WpGetCanonicalUrl extends WP_UnitTestCase { + /** * The ID of the post. * @@ -51,14 +45,14 @@ class Tests_Link_WpGetCanonicalUrl extends WP_UnitTestCase { } /** - * Test for a non existing post. + * Tests that false is returned for a non-existing post. */ public function test_non_existing_post() { $this->assertFalse( wp_get_canonical_url( -1 ) ); } /** - * Test for a post that is not published. + * Tests that false is returned for a post that is not published. */ public function test_post_status() { $post_id = self::factory()->post->create( @@ -71,14 +65,14 @@ class Tests_Link_WpGetCanonicalUrl extends WP_UnitTestCase { } /** - * Test for a page that is not the queried object. + * Tests canonical URL for a page that is not the queried object. */ public function test_non_current_page() { $this->assertSame( get_permalink( self::$post_id ), wp_get_canonical_url( self::$post_id ) ); } /** - * Test non permalink structure page usage. + * Tests non-permalink structure page usage. */ public function test_paged_with_plain_permalink_structure() { $link = add_query_arg( @@ -102,7 +96,7 @@ class Tests_Link_WpGetCanonicalUrl extends WP_UnitTestCase { } /** - * Test permalink structure page usage. + * Tests permalink structure page usage. */ public function test_paged_with_custom_permalink_structure() { $this->set_permalink_structure( '/%postname%/' ); @@ -124,7 +118,7 @@ class Tests_Link_WpGetCanonicalUrl extends WP_UnitTestCase { } /** - * Test non permalink structure comment page usage. + * Tests non-permalink structure comment page usage. */ public function test_comments_paged_with_plain_permalink_structure() { $cpage = 2; @@ -150,7 +144,7 @@ class Tests_Link_WpGetCanonicalUrl extends WP_UnitTestCase { } /** - * Test permalink structure comment page usage. + * Tests permalink structure comment page usage. */ public function test_comments_paged_with_pretty_permalink_structure() { global $wp_rewrite; @@ -174,7 +168,7 @@ class Tests_Link_WpGetCanonicalUrl extends WP_UnitTestCase { } /** - * This test ensures that attachments with 'inherit' status properly receive a canonical URL. + * Tests that attachments with 'inherit' status properly receive a canonical URL. * * @ticket 63041 */ @@ -187,7 +181,7 @@ class Tests_Link_WpGetCanonicalUrl extends WP_UnitTestCase { } /** - * Test calling of filter. + * Tests calling of filter. */ public function test_get_canonical_url_filter() { add_filter( 'get_canonical_url', array( $this, 'canonical_url_filter' ) ); |