Changeset 59979
- Timestamp:
- 03/13/2025 06:21:37 PM (9 months ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 9 edited
-
general/paginateLinks.php (modified) (6 diffs)
-
option/wpPrimeNetworkOptionCaches.php (modified) (1 diff)
-
post/metaRevisions.php (modified) (1 diff)
-
query/cacheResults.php (modified) (1 diff)
-
rest-api/rest-global-styles-revisions-controller.php (modified) (3 diffs)
-
rest-api/rest-posts-controller.php (modified) (3 diffs)
-
rest-api/rest-revisions-controller.php (modified) (3 diffs)
-
rest-api/wpRestTemplateRevisionsController.php (modified) (3 diffs)
-
user/countUserPosts.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/general/paginateLinks.php
r59966 r59979 380 380 $links = paginate_links( $args ); 381 381 382 // Test page 1 link (should have trailing slash) 382 // Test page 1 link (should have trailing slash). 383 383 $this->assertStringContainsString( 384 384 'href="http://example.org/category/test/"', … … 387 387 ); 388 388 389 // Test page 3 link (should have trailing slash) 389 // Test page 3 link (should have trailing slash). 390 390 $this->assertStringContainsString( 391 391 'href="http://example.org/category/test/page/3/"', … … 394 394 ); 395 395 396 // Test previous link (should have trailing slash) 396 // Test previous link (should have trailing slash). 397 397 $this->assertStringContainsString( 398 398 'class="prev page-numbers" href="http://example.org/category/test/"', … … 418 418 $links = paginate_links( $args ); 419 419 420 // Test page 1 link (should not have trailing slash) 420 // Test page 1 link (should not have trailing slash). 421 421 $this->assertStringContainsString( 422 422 'href="http://example.org/category/test"', … … 425 425 ); 426 426 427 // Test page 3 link (should not have trailing slash) 427 // Test page 3 link (should not have trailing slash). 428 428 $this->assertStringContainsString( 429 429 'href="http://example.org/category/test/page/3"', … … 432 432 ); 433 433 434 // Test previous link (should not have trailing slash) 434 // Test previous link (should not have trailing slash). 435 435 $this->assertStringContainsString( 436 436 'class="prev page-numbers" href="http://example.org/category/test"', -
trunk/tests/phpunit/tests/option/wpPrimeNetworkOptionCaches.php
r58182 r59979 139 139 $initial_query_count = get_num_queries(); 140 140 141 // Call the wp_prime_network_option_caches() function second time 141 // Call the wp_prime_network_option_caches() function second time. 142 142 wp_prime_network_option_caches( $network_id, $options_to_prime ); 143 143 -
trunk/tests/phpunit/tests/post/metaRevisions.php
r57987 r59979 595 595 ); 596 596 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. 598 598 $revisions = wp_get_post_revisions( $post_id ); 599 599 $revision = array_shift( $revisions ); -
trunk/tests/phpunit/tests/query/cacheResults.php
r59919 r59979 1794 1794 public function test_query_cache_should_exclude_post_with_excluded_term() { 1795 1795 $term_id = self::$t1; 1796 // Post 0 has the term applied 1796 // Post 0 has the term applied. 1797 1797 $post_id = self::$posts[0]; 1798 1798 -
trunk/tests/phpunit/tests/rest-api/rest-global-styles-revisions-controller.php
r59970 r59979 954 954 wp_set_current_user( self::$admin_id ); 955 955 956 // Test offset 956 // Test offset. 957 957 $request = new WP_REST_Request( 'GET', '/wp/v2/global-styles/' . self::$global_styles_id . '/revisions' ); 958 958 $request->set_param( 'offset', 1 ); … … 965 965 $this->assertEquals( 3, $response->get_headers()['X-WP-TotalPages'] ); 966 966 967 // Test paged 967 // Test paged. 968 968 $request = new WP_REST_Request( 'GET', '/wp/v2/global-styles/' . self::$global_styles_id . '/revisions' ); 969 969 $request->set_param( 'page', 2 ); … … 976 976 $this->assertEquals( 2, $response->get_headers()['X-WP-TotalPages'] ); 977 977 978 // Test out of bounds 978 // Test out of bounds. 979 979 $request = new WP_REST_Request( 'GET', '/wp/v2/global-styles/' . self::$global_styles_id . '/revisions' ); 980 980 $request->set_param( 'page', 4 ); -
trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php
r59970 r59979 5940 5940 public function test_get_posts_with_pagination() { 5941 5941 5942 // Test offset 5942 // Test offset. 5943 5943 $request = new WP_REST_Request( 'GET', '/wp/v2/posts' ); 5944 5944 $request->set_param( 'offset', 1 ); … … 5951 5951 $this->assertEquals( 30, $response->get_headers()['X-WP-TotalPages'] ); 5952 5952 5953 // Test paged 5953 // Test paged. 5954 5954 $request = new WP_REST_Request( 'GET', '/wp/v2/posts' ); 5955 5955 $request->set_param( 'page', 2 ); … … 5962 5962 $this->assertEquals( 15, $response->get_headers()['X-WP-TotalPages'] ); 5963 5963 5964 // Test out of bounds 5964 // Test out of bounds. 5965 5965 $request = new WP_REST_Request( 'GET', '/wp/v2/posts' ); 5966 5966 $request->set_param( 'page', 4 ); -
trunk/tests/phpunit/tests/rest-api/rest-revisions-controller.php
r59970 r59979 1050 1050 * @covers WP_REST_Revisions_Controller::get_items 1051 1051 */ 1052 public function test_get_ template_revisions_pagination() {1053 wp_set_current_user( self::$editor_id ); 1054 1055 // Test offset 1052 public function test_get_revisions_pagination() { 1053 wp_set_current_user( self::$editor_id ); 1054 1055 // Test offset. 1056 1056 $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions' ); 1057 1057 $request->set_param( 'offset', 1 ); … … 1064 1064 $this->assertEquals( $this->total_revisions, $response->get_headers()['X-WP-TotalPages'] ); 1065 1065 1066 // Test paged 1066 // Test paged. 1067 1067 $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions' ); 1068 1068 $request->set_param( 'page', 2 ); … … 1075 1075 $this->assertEquals( (int) ceil( $this->total_revisions / 2 ), $response->get_headers()['X-WP-TotalPages'] ); 1076 1076 1077 // Test out of bounds 1077 // Test out of bounds. 1078 1078 $request = new WP_REST_Request( 'GET', '/wp/v2/posts/' . self::$post_id . '/revisions' ); 1079 1079 $request->set_param( 'page', $this->total_revisions + 1 ); -
trunk/tests/phpunit/tests/rest-api/wpRestTemplateRevisionsController.php
r59970 r59979 1192 1192 wp_set_current_user( self::$admin_id ); 1193 1193 1194 // Test offset 1194 // Test offset. 1195 1195 $request = new WP_REST_Request( 'GET', '/wp/v2/templates/' . self::TEST_THEME . '/' . self::TEMPLATE_NAME . '/revisions' ); 1196 1196 $request->set_param( 'offset', 1 ); … … 1203 1203 $this->assertEquals( 4, $response->get_headers()['X-WP-TotalPages'] ); 1204 1204 1205 // Test paged 1205 // Test paged. 1206 1206 $request = new WP_REST_Request( 'GET', '/wp/v2/templates/' . self::TEST_THEME . '/' . self::TEMPLATE_NAME . '/revisions' ); 1207 1207 $request->set_param( 'page', 2 ); … … 1214 1214 $this->assertEquals( 2, $response->get_headers()['X-WP-TotalPages'] ); 1215 1215 1216 // Test out of bounds 1216 // Test out of bounds. 1217 1217 $request = new WP_REST_Request( 'GET', '/wp/v2/templates/' . self::TEST_THEME . '/' . self::TEMPLATE_NAME . '/revisions' ); 1218 1218 $request->set_param( 'page', 4 ); -
trunk/tests/phpunit/tests/user/countUserPosts.php
r59817 r59979 92 92 93 93 /** 94 * Post count be correct after reassigning posts to another user.94 * Post count should be correct after reassigning posts to another user. 95 95 * 96 96 * @ticket 39242 … … 117 117 118 118 /** 119 * Post count be correct after deleting user without reassigning posts.119 * Post count should be correct after deleting user without reassigning posts. 120 120 * 121 121 * @ticket 39242 … … 187 187 */ 188 188 public function test_cache_should_be_hit_regardless_of_post_type_order() { 189 // Prime Cache.189 // Prime cache. 190 190 count_user_posts( self::$user_id, array( 'wptests_pt', 'post' ) ); 191 191 … … 203 203 */ 204 204 public function test_cache_should_be_hit_for_string_and_array_equivalent_queries() { 205 // Prime Cache.205 // Prime cache. 206 206 count_user_posts( self::$user_id, 'post' ); 207 207 … … 219 219 */ 220 220 public function test_cache_should_be_hit_for_and_array_duplicates_equivalent_queries() { 221 // Prime Cache221 // Prime cache. 222 222 count_user_posts( self::$user_id, array( 'post', 'post', 'post' ) ); 223 223
Note: See TracChangeset
for help on using the changeset viewer.