Skip to content

Commit 3998c85

Browse files
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
1 parent d52e945 commit 3998c85

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

tests/phpunit/tests/link/wpGetCanonicalUrl.php

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,12 @@
22
/**
33
* Tests for the wp_get_canonical_url() function.
44
*
5-
* @package WordPress
6-
* @subpackage Link
7-
*/
8-
9-
/**
10-
* Class for Testing the wp_get_canonical_url() function.
11-
*
125
* @group link
136
* @group canonical
147
* @covers ::wp_get_canonical_url
158
*/
169
class Tests_Link_WpGetCanonicalUrl extends WP_UnitTestCase {
10+
1711
/**
1812
* The ID of the post.
1913
*
@@ -51,14 +45,14 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
5145
}
5246

5347
/**
54-
* Test for a non existing post.
48+
* Tests that false is returned for a non-existing post.
5549
*/
5650
public function test_non_existing_post() {
5751
$this->assertFalse( wp_get_canonical_url( -1 ) );
5852
}
5953

6054
/**
61-
* Test for a post that is not published.
55+
* Tests that false is returned for a post that is not published.
6256
*/
6357
public function test_post_status() {
6458
$post_id = self::factory()->post->create(
@@ -71,14 +65,14 @@ public function test_post_status() {
7165
}
7266

7367
/**
74-
* Test for a page that is not the queried object.
68+
* Tests canonical URL for a page that is not the queried object.
7569
*/
7670
public function test_non_current_page() {
7771
$this->assertSame( get_permalink( self::$post_id ), wp_get_canonical_url( self::$post_id ) );
7872
}
7973

8074
/**
81-
* Test non permalink structure page usage.
75+
* Tests non-permalink structure page usage.
8276
*/
8377
public function test_paged_with_plain_permalink_structure() {
8478
$link = add_query_arg(
@@ -102,7 +96,7 @@ public function test_paged_with_plain_permalink_structure() {
10296
}
10397

10498
/**
105-
* Test permalink structure page usage.
99+
* Tests permalink structure page usage.
106100
*/
107101
public function test_paged_with_custom_permalink_structure() {
108102
$this->set_permalink_structure( '/%postname%/' );
@@ -124,7 +118,7 @@ public function test_paged_with_custom_permalink_structure() {
124118
}
125119

126120
/**
127-
* Test non permalink structure comment page usage.
121+
* Tests non-permalink structure comment page usage.
128122
*/
129123
public function test_comments_paged_with_plain_permalink_structure() {
130124
$cpage = 2;
@@ -150,7 +144,7 @@ public function test_comments_paged_with_plain_permalink_structure() {
150144
}
151145

152146
/**
153-
* Test permalink structure comment page usage.
147+
* Tests permalink structure comment page usage.
154148
*/
155149
public function test_comments_paged_with_pretty_permalink_structure() {
156150
global $wp_rewrite;
@@ -174,7 +168,7 @@ public function test_comments_paged_with_pretty_permalink_structure() {
174168
}
175169

176170
/**
177-
* This test ensures that attachments with 'inherit' status properly receive a canonical URL.
171+
* Tests that attachments with 'inherit' status properly receive a canonical URL.
178172
*
179173
* @ticket 63041
180174
*/
@@ -187,7 +181,7 @@ public function test_attachment_canonical_url() {
187181
}
188182

189183
/**
190-
* Test calling of filter.
184+
* Tests calling of filter.
191185
*/
192186
public function test_get_canonical_url_filter() {
193187
add_filter( 'get_canonical_url', array( $this, 'canonical_url_filter' ) );

0 commit comments

Comments
 (0)