Skip to content

Commit dbdeb3c

Browse files
Docs: Correct formatting for some inline comments in unit tests.
Follow-up to [54111], [56714], [58182], [59630], [59817], [59966]. See #62281. git-svn-id: https://develop.svn.wordpress.org/trunk@59979 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 066499a commit dbdeb3c

File tree

9 files changed

+27
-27
lines changed

9 files changed

+27
-27
lines changed

tests/phpunit/tests/general/paginateLinks.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -379,21 +379,21 @@ public function test_pagination_links_with_trailing_slash() {
379379

380380
$links = paginate_links( $args );
381381

382-
// Test page 1 link (should have trailing slash)
382+
// Test page 1 link (should have trailing slash).
383383
$this->assertStringContainsString(
384384
'href="http://example.org/category/test/"',
385385
$links,
386386
'Page 1 link should have trailing slash when permalink structure has trailing slash'
387387
);
388388

389-
// Test page 3 link (should have trailing slash)
389+
// Test page 3 link (should have trailing slash).
390390
$this->assertStringContainsString(
391391
'href="http://example.org/category/test/page/3/"',
392392
$links,
393393
'Page 3 link should have trailing slash when permalink structure has trailing slash'
394394
);
395395

396-
// Test previous link (should have trailing slash)
396+
// Test previous link (should have trailing slash).
397397
$this->assertStringContainsString(
398398
'class="prev page-numbers" href="http://example.org/category/test/"',
399399
$links,
@@ -417,21 +417,21 @@ public function test_pagination_links_without_trailing_slash() {
417417

418418
$links = paginate_links( $args );
419419

420-
// Test page 1 link (should not have trailing slash)
420+
// Test page 1 link (should not have trailing slash).
421421
$this->assertStringContainsString(
422422
'href="http://example.org/category/test"',
423423
$links,
424424
'Page 1 link should not have trailing slash when permalink structure has no trailing slash'
425425
);
426426

427-
// Test page 3 link (should not have trailing slash)
427+
// Test page 3 link (should not have trailing slash).
428428
$this->assertStringContainsString(
429429
'href="http://example.org/category/test/page/3"',
430430
$links,
431431
'Page 3 link should not have trailing slash when permalink structure has no trailing slash'
432432
);
433433

434-
// Test previous link (should not have trailing slash)
434+
// Test previous link (should not have trailing slash).
435435
$this->assertStringContainsString(
436436
'class="prev page-numbers" href="http://example.org/category/test"',
437437
$links,

tests/phpunit/tests/option/wpPrimeNetworkOptionCaches.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function test_wp_prime_network_option_caches_run_twice() {
138138
// Store the initial database query count.
139139
$initial_query_count = get_num_queries();
140140

141-
// Call the wp_prime_network_option_caches() function second time
141+
// Call the wp_prime_network_option_caches() function second time.
142142
wp_prime_network_option_caches( $network_id, $options_to_prime );
143143

144144
// Ensure no additional database queries were made.

tests/phpunit/tests/post/metaRevisions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ public function test_register_post_meta_supports_revisions( $post_type, $meta_ke
594594
)
595595
);
596596

597-
// Check the last revision for the post to see if the meta key was revisioned
597+
// Check the last revision for the post to see if the meta key was revisioned.
598598
$revisions = wp_get_post_revisions( $post_id );
599599
$revision = array_shift( $revisions );
600600
$revisioned_meta = get_post_meta( $revision->ID, $meta_key, true );

tests/phpunit/tests/query/cacheResults.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,7 @@ public function data_query_filter_posts_results() {
17931793
*/
17941794
public function test_query_cache_should_exclude_post_with_excluded_term() {
17951795
$term_id = self::$t1;
1796-
// Post 0 has the term applied
1796+
// Post 0 has the term applied.
17971797
$post_id = self::$posts[0];
17981798

17991799
$args = array(

tests/phpunit/tests/rest-api/rest-global-styles-revisions-controller.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ public function test_get_items_out_of_bounds_page_should_not_error_if_offset() {
953953
public function test_get_global_styles_revisions_pagination() {
954954
wp_set_current_user( self::$admin_id );
955955

956-
// Test offset
956+
// Test offset.
957957
$request = new WP_REST_Request( 'GET', '/wp/v2/global-styles/' . self::$global_styles_id . '/revisions' );
958958
$request->set_param( 'offset', 1 );
959959
$request->set_param( 'per_page', 1 );
@@ -964,7 +964,7 @@ public function test_get_global_styles_revisions_pagination() {
964964
$this->assertEquals( 3, $response->get_headers()['X-WP-Total'] );
965965
$this->assertEquals( 3, $response->get_headers()['X-WP-TotalPages'] );
966966

967-
// Test paged
967+
// Test paged.
968968
$request = new WP_REST_Request( 'GET', '/wp/v2/global-styles/' . self::$global_styles_id . '/revisions' );
969969
$request->set_param( 'page', 2 );
970970
$request->set_param( 'per_page', 2 );
@@ -975,7 +975,7 @@ public function test_get_global_styles_revisions_pagination() {
975975
$this->assertEquals( 3, $response->get_headers()['X-WP-Total'] );
976976
$this->assertEquals( 2, $response->get_headers()['X-WP-TotalPages'] );
977977

978-
// Test out of bounds
978+
// Test out of bounds.
979979
$request = new WP_REST_Request( 'GET', '/wp/v2/global-styles/' . self::$global_styles_id . '/revisions' );
980980
$request->set_param( 'page', 4 );
981981
$request->set_param( 'per_page', 6 );

tests/phpunit/tests/rest-api/rest-posts-controller.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5939,7 +5939,7 @@ public function test_multiple_post_format_support() {
59395939
*/
59405940
public function test_get_posts_with_pagination() {
59415941

5942-
// Test offset
5942+
// Test offset.
59435943
$request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
59445944
$request->set_param( 'offset', 1 );
59455945
$request->set_param( 'per_page', 1 );
@@ -5950,7 +5950,7 @@ public function test_get_posts_with_pagination() {
59505950
$this->assertEquals( 30, $response->get_headers()['X-WP-Total'] );
59515951
$this->assertEquals( 30, $response->get_headers()['X-WP-TotalPages'] );
59525952

5953-
// Test paged
5953+
// Test paged.
59545954
$request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
59555955
$request->set_param( 'page', 2 );
59565956
$request->set_param( 'per_page', 2 );
@@ -5961,7 +5961,7 @@ public function test_get_posts_with_pagination() {
59615961
$this->assertEquals( 30, $response->get_headers()['X-WP-Total'] );
59625962
$this->assertEquals( 15, $response->get_headers()['X-WP-TotalPages'] );
59635963

5964-
// Test out of bounds
5964+
// Test out of bounds.
59655965
$request = new WP_REST_Request( 'GET', '/wp/v2/posts' );
59665966
$request->set_param( 'page', 4 );
59675967
$request->set_param( 'per_page', 10 );

tests/phpunit/tests/rest-api/rest-revisions-controller.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,10 +1049,10 @@ public function test_get_items_out_of_bounds_page_should_not_error_if_offset() {
10491049
*
10501050
* @covers WP_REST_Revisions_Controller::get_items
10511051
*/
1052-
public function test_get_template_revisions_pagination() {
1052+
public function test_get_revisions_pagination() {
10531053
wp_set_current_user( self::$editor_id );
10541054

1055-
// Test offset
1055+
// Test offset.
10561056
$request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions' );
10571057
$request->set_param( 'offset', 1 );
10581058
$request->set_param( 'per_page', 1 );
@@ -1063,7 +1063,7 @@ public function test_get_template_revisions_pagination() {
10631063
$this->assertEquals( $this->total_revisions, $response->get_headers()['X-WP-Total'] );
10641064
$this->assertEquals( $this->total_revisions, $response->get_headers()['X-WP-TotalPages'] );
10651065

1066-
// Test paged
1066+
// Test paged.
10671067
$request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions' );
10681068
$request->set_param( 'page', 2 );
10691069
$request->set_param( 'per_page', 2 );
@@ -1074,7 +1074,7 @@ public function test_get_template_revisions_pagination() {
10741074
$this->assertEquals( $this->total_revisions, $response->get_headers()['X-WP-Total'] );
10751075
$this->assertEquals( (int) ceil( $this->total_revisions / 2 ), $response->get_headers()['X-WP-TotalPages'] );
10761076

1077-
// Test out of bounds
1077+
// Test out of bounds.
10781078
$request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions' );
10791079
$request->set_param( 'page', $this->total_revisions + 1 );
10801080
$request->set_param( 'per_page', 1 );

tests/phpunit/tests/rest-api/wpRestTemplateRevisionsController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ public function data_delete_item_not_found() {
11911191
public function test_get_template_revisions_pagination() {
11921192
wp_set_current_user( self::$admin_id );
11931193

1194-
// Test offset
1194+
// Test offset.
11951195
$request = new WP_REST_Request( 'GET', '/wp/v2/templates/' . self::TEST_THEME . '/' . self::TEMPLATE_NAME . '/revisions' );
11961196
$request->set_param( 'offset', 1 );
11971197
$request->set_param( 'per_page', 1 );
@@ -1202,7 +1202,7 @@ public function test_get_template_revisions_pagination() {
12021202
$this->assertEquals( 4, $response->get_headers()['X-WP-Total'] );
12031203
$this->assertEquals( 4, $response->get_headers()['X-WP-TotalPages'] );
12041204

1205-
// Test paged
1205+
// Test paged.
12061206
$request = new WP_REST_Request( 'GET', '/wp/v2/templates/' . self::TEST_THEME . '/' . self::TEMPLATE_NAME . '/revisions' );
12071207
$request->set_param( 'page', 2 );
12081208
$request->set_param( 'per_page', 2 );
@@ -1213,7 +1213,7 @@ public function test_get_template_revisions_pagination() {
12131213
$this->assertEquals( 4, $response->get_headers()['X-WP-Total'] );
12141214
$this->assertEquals( 2, $response->get_headers()['X-WP-TotalPages'] );
12151215

1216-
// Test out of bounds
1216+
// Test out of bounds.
12171217
$request = new WP_REST_Request( 'GET', '/wp/v2/templates/' . self::TEST_THEME . '/' . self::TEMPLATE_NAME . '/revisions' );
12181218
$request->set_param( 'page', 4 );
12191219
$request->set_param( 'per_page', 6 );

tests/phpunit/tests/user/countUserPosts.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function test_count_user_posts_should_ignore_non_existent_post_types() {
9191
}
9292

9393
/**
94-
* Post count be correct after reassigning posts to another user.
94+
* Post count should be correct after reassigning posts to another user.
9595
*
9696
* @ticket 39242
9797
*/
@@ -116,7 +116,7 @@ public function test_reassigning_users_posts_modifies_count() {
116116
}
117117

118118
/**
119-
* Post count be correct after deleting user without reassigning posts.
119+
* Post count should be correct after deleting user without reassigning posts.
120120
*
121121
* @ticket 39242
122122
*/
@@ -186,7 +186,7 @@ public function test_count_user_posts_for_user_created_after_being_assigned_post
186186
* @ticket 39242
187187
*/
188188
public function test_cache_should_be_hit_regardless_of_post_type_order() {
189-
// Prime Cache.
189+
// Prime cache.
190190
count_user_posts( self::$user_id, array( 'wptests_pt', 'post' ) );
191191

192192
$query_num_start = get_num_queries();
@@ -202,7 +202,7 @@ public function test_cache_should_be_hit_regardless_of_post_type_order() {
202202
* @ticket 39242
203203
*/
204204
public function test_cache_should_be_hit_for_string_and_array_equivalent_queries() {
205-
// Prime Cache.
205+
// Prime cache.
206206
count_user_posts( self::$user_id, 'post' );
207207

208208
$query_num_start = get_num_queries();
@@ -218,7 +218,7 @@ public function test_cache_should_be_hit_for_string_and_array_equivalent_queries
218218
* @ticket 39242
219219
*/
220220
public function test_cache_should_be_hit_for_and_array_duplicates_equivalent_queries() {
221-
// Prime Cache
221+
// Prime cache.
222222
count_user_posts( self::$user_id, array( 'post', 'post', 'post' ) );
223223

224224
$query_num_start = get_num_queries();

0 commit comments

Comments
 (0)