Changeset 60251
- Timestamp:
- 05/26/2025 12:03:18 PM (9 months ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 40 edited
-
comment.php (modified) (1 diff)
-
comment/commentsTemplate.php (modified) (5 diffs)
-
comment/metaCache.php (modified) (1 diff)
-
customize/nav-menus.php (modified) (1 diff)
-
db/charset.php (modified) (4 diffs)
-
feed/atom.php (modified) (1 diff)
-
feed/rss2.php (modified) (1 diff)
-
file.php (modified) (3 diffs)
-
formatting/escUrl.php (modified) (1 diff)
-
formatting/sanitizePost.php (modified) (1 diff)
-
formatting/wpSpecialchars.php (modified) (1 diff)
-
formatting/wpTrimExcerpt.php (modified) (2 diffs)
-
functions.php (modified) (1 diff)
-
kses.php (modified) (1 diff)
-
media.php (modified) (3 diffs)
-
meta.php (modified) (1 diff)
-
post.php (modified) (1 diff)
-
post/revisions.php (modified) (1 diff)
-
post/wpPostType.php (modified) (1 diff)
-
query.php (modified) (1 diff)
-
query/postStatus.php (modified) (1 diff)
-
query/setupPostdata.php (modified) (4 diffs)
-
rest-api/rest-comments-controller.php (modified) (1 diff)
-
rest-api/rest-posts-controller.php (modified) (1 diff)
-
rest-api/rest-server.php (modified) (1 diff)
-
rest-api/rest-users-controller.php (modified) (2 diffs)
-
shortcode.php (modified) (1 diff)
-
taxonomy.php (modified) (2 diffs)
-
term/cache.php (modified) (1 diff)
-
term/meta.php (modified) (2 diffs)
-
term/wpGenerateTagCloud.php (modified) (2 diffs)
-
term/wpGetObjectTerms.php (modified) (2 diffs)
-
term/wpTaxonomy.php (modified) (1 diff)
-
theme.php (modified) (4 diffs)
-
xmlrpc/wp/getComments.php (modified) (2 diffs)
-
xmlrpc/wp/getPageList.php (modified) (1 diff)
-
xmlrpc/wp/getPages.php (modified) (1 diff)
-
xmlrpc/wp/getPosts.php (modified) (1 diff)
-
xmlrpc/wp/getTerms.php (modified) (1 diff)
-
xmlrpc/wp/getUsers.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment.php
r60250 r60251 1567 1567 $lengths = wp_get_comment_fields_max_lengths(); 1568 1568 1569 $this->assertNotEmpty( $lengths ); 1570 1569 1571 foreach ( $lengths as $field => $length ) { 1570 1572 $this->assertSame( $expected[ $field ], $length ); -
trunk/tests/phpunit/tests/comment/commentsTemplate.php
r56971 r60251 567 567 preg_match_all( '|href="(.*?#comment-([0-9]+))|', $found_p1, $matches ); 568 568 569 $this->assertNotEmpty( $matches ); 570 $this->assertNotEmpty( $matches[1] ); 571 569 572 // This is the main post page, so we don't expect any cpage param. 570 573 foreach ( $matches[1] as $m ) { … … 587 590 preg_match_all( '|href="(.*?#comment-([0-9]+))|', $found_p2, $matches ); 588 591 592 $this->assertNotEmpty( $matches ); 593 $this->assertNotEmpty( $matches[1] ); 594 589 595 // They should all be on page 2. 590 596 foreach ( $matches[1] as $m ) { … … 660 666 preg_match_all( '|href="(.*?#comment-([0-9]+))|', $found_p0, $matches ); 661 667 668 $this->assertNotEmpty( $matches ); 669 $this->assertNotEmpty( $matches[1] ); 670 662 671 foreach ( $matches[1] as $m ) { 663 672 $this->assertStringContainsString( 'cpage=3', $m ); … … 678 687 // Find the comment permalinks. 679 688 preg_match_all( '|href="(.*?#comment-([0-9]+))|', $found_p2, $matches ); 689 690 $this->assertNotEmpty( $matches ); 691 $this->assertNotEmpty( $matches[1] ); 680 692 681 693 // They should all be on page 2. … … 699 711 // Find the comment permalinks. 700 712 preg_match_all( '|href="(.*?#comment-([0-9]+))|', $found_p1, $matches ); 713 714 $this->assertNotEmpty( $matches ); 715 $this->assertNotEmpty( $matches[1] ); 701 716 702 717 // They should all be on page 2. -
trunk/tests/phpunit/tests/comment/metaCache.php
r57685 r60251 196 196 $this->go_to( get_permalink( $p ) ); 197 197 198 if ( have_posts() ) {199 while ( have_posts() ) { 200 the_post();201 202 // Load comments with `comments_template()`. 203 $cform = get_echo( 'comments_template' );204 205 // First request will hit the database. 206 $num_queries = get_num_queries();207 get_comment_meta( $comment_ids[0], 'sauce');208 $this->assertSame( 1, get_num_queries() - $num_queries);209 210 // Second and third requests should be in cache. 211 get_comment_meta( $comment_ids[1], 'sauce' );212 get_comment_meta( $comment_ids[2], 'sauce' );213 $this->assertSame( 1, get_num_queries() - $num_queries);214 }198 $this->assertTrue( have_posts() ); 199 200 while ( have_posts() ) { 201 the_post(); 202 203 // Load comments with `comments_template()`. 204 $cform = get_echo( 'comments_template' ); 205 206 // First request will hit the database. 207 $num_queries = get_num_queries(); 208 get_comment_meta( $comment_ids[0], 'sauce' ); 209 $this->assertSame( 1, get_num_queries() - $num_queries ); 210 211 // Second and third requests should be in cache. 212 get_comment_meta( $comment_ids[1], 'sauce' ); 213 get_comment_meta( $comment_ids[2], 'sauce' ); 214 $this->assertSame( 1, get_num_queries() - $num_queries ); 215 215 } 216 216 } -
trunk/tests/phpunit/tests/customize/nav-menus.php
r59224 r60251 767 767 768 768 $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'object' ); 769 if ( $post_types ) { 770 foreach ( $post_types as $type ) { 771 $this->assertStringContainsString( 'available-menu-items-post_type-' . esc_attr( $type->name ), $template ); 772 $this->assertMatchesRegularExpression( '#<h4 class="accordion-section-title".*>\s*<button type="button" class="accordion-trigger" aria-expanded="false" aria-controls=".*">\s*' . esc_html( $type->labels->name ) . '#', $template ); 773 $this->assertStringContainsString( 'data-type="post_type"', $template ); 774 $this->assertStringContainsString( 'data-object="' . esc_attr( $type->name ) . '"', $template ); 775 $this->assertStringContainsString( 'data-type_label="' . esc_attr( $type->labels->singular_name ) . '"', $template ); 776 } 769 770 $this->assertNotEmpty( $post_types ); 771 772 foreach ( $post_types as $type ) { 773 $this->assertStringContainsString( 'available-menu-items-post_type-' . esc_attr( $type->name ), $template ); 774 $this->assertMatchesRegularExpression( '#<h4 class="accordion-section-title".*>\s*<button type="button" class="accordion-trigger" aria-expanded="false" aria-controls=".*">\s*' . esc_html( $type->labels->name ) . '#', $template ); 775 $this->assertStringContainsString( 'data-type="post_type"', $template ); 776 $this->assertStringContainsString( 'data-object="' . esc_attr( $type->name ) . '"', $template ); 777 $this->assertStringContainsString( 'data-type_label="' . esc_attr( $type->labels->singular_name ) . '"', $template ); 777 778 } 778 779 779 780 $taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'object' ); 780 if ( $taxonomies ) { 781 foreach ( $taxonomies as $tax ) { 782 $this->assertStringContainsString( 'available-menu-items-taxonomy-' . esc_attr( $tax->name ), $template ); 783 $this->assertMatchesRegularExpression( '#<h4 class="accordion-section-title".*>\s*<button type="button" class="accordion-trigger" aria-expanded="false" aria-controls=".*">\s*' . esc_html( $tax->labels->name ) . '#', $template ); 784 $this->assertStringContainsString( 'data-type="taxonomy"', $template ); 785 $this->assertStringContainsString( 'data-object="' . esc_attr( $tax->name ) . '"', $template ); 786 $this->assertStringContainsString( 'data-type_label="' . esc_attr( $tax->labels->singular_name ) . '"', $template ); 787 } 781 782 $this->assertNotEmpty( $taxonomies ); 783 784 foreach ( $taxonomies as $tax ) { 785 $this->assertStringContainsString( 'available-menu-items-taxonomy-' . esc_attr( $tax->name ), $template ); 786 $this->assertMatchesRegularExpression( '#<h4 class="accordion-section-title".*>\s*<button type="button" class="accordion-trigger" aria-expanded="false" aria-controls=".*">\s*' . esc_html( $tax->labels->name ) . '#', $template ); 787 $this->assertStringContainsString( 'data-type="taxonomy"', $template ); 788 $this->assertStringContainsString( 'data-object="' . esc_attr( $tax->name ) . '"', $template ); 789 $this->assertStringContainsString( 'data-type_label="' . esc_attr( $tax->labels->singular_name ) . '"', $template ); 788 790 } 789 791 -
trunk/tests/phpunit/tests/db/charset.php
r57926 r60251 830 830 self::$_wpdb->query( $create ); 831 831 832 $this->assertNotEmpty( $expected_charset ); 833 832 834 foreach ( $expected_charset as $column => $charset ) { 833 835 if ( self::$utf8_is_utf8mb3 && 'utf8' === $charset ) { … … 855 857 self::$_wpdb->query( $create ); 856 858 859 $this->assertNotEmpty( $columns ); 860 857 861 $columns = array_keys( $columns ); 858 862 foreach ( $columns as $column => $charset ) { … … 877 881 878 882 self::$_wpdb->query( $create ); 883 884 $this->assertNotEmpty( $columns ); 879 885 880 886 $columns = array_keys( $columns ); … … 1071 1077 ); 1072 1078 1079 $this->assertNotEmpty( $always_true ); 1080 1073 1081 foreach ( $always_true as $true_query ) { 1074 1082 $return = self::$_wpdb->check_safe_collation( $true_query ); -
trunk/tests/phpunit/tests/feed/atom.php
r56549 r60251 280 280 $entries = array_slice( $entries, 0, 1 ); 281 281 282 $this->assertNotEmpty( $entries ); 283 282 284 foreach ( $entries as $key => $entry ) { 283 285 $links = xml_find( $entries[ $key ]['child'], 'link' ); -
trunk/tests/phpunit/tests/feed/rss2.php
r56746 r60251 290 290 $items = xml_find( $xml, 'rss', 'channel', 'item' ); 291 291 292 $this->assertNotEmpty( $items ); 293 292 294 // Check each of the items against the known post data. 293 295 foreach ( $items as $key => $item ) { -
trunk/tests/phpunit/tests/file.php
r56559 r60251 41 41 ); 42 42 43 $this->assertNotEmpty( $actual ); 44 43 45 foreach ( $actual as $header => $value ) { 44 46 $this->assertSame( $expected[ $header ], $value, $header ); … … 65 67 ); 66 68 69 $this->assertNotEmpty( $actual ); 70 67 71 foreach ( $actual as $header => $value ) { 68 72 $this->assertSame( $expected[ $header ], $value, $header ); … … 84 88 'TemplateName' => 'Something', 85 89 ); 90 91 $this->assertNotEmpty( $actual ); 86 92 87 93 foreach ( $actual as $header => $value ) { -
trunk/tests/phpunit/tests/formatting/escUrl.php
r57987 r60251 125 125 ); 126 126 127 foreach ( wp_allowed_protocols() as $scheme ) { 127 $protocols = wp_allowed_protocols(); 128 129 $this->assertNotEmpty( $protocols ); 130 131 foreach ( $protocols as $scheme ) { 128 132 $this->assertSame( "{$scheme}://example.com", esc_url( "{$scheme}://example.com" ), $scheme ); 129 133 $this->assertSame( -
trunk/tests/phpunit/tests/formatting/sanitizePost.php
r54728 r60251 30 30 $this->assertIsString( $post->$field, "field $field" ); 31 31 break; 32 default: 33 $this->fail( "Type $type is not handled by this test." ); 34 break; 32 35 } 33 36 } -
trunk/tests/phpunit/tests/formatting/wpSpecialchars.php
r53562 r60251 17 17 public function test_allowed_entity_names() { 18 18 global $allowedentitynames; 19 20 $this->assertNotEmpty( $allowedentitynames ); 19 21 20 22 // Allowed entities should be unchanged. -
trunk/tests/phpunit/tests/formatting/wpTrimExcerpt.php
r56693 r60251 30 30 ) 31 31 ); 32 if ( $q->have_posts() ) { 33 while ( $q->have_posts() ) { 34 $q->the_post(); 35 $this->assertSame( 'Post 2 Page 1', wp_trim_excerpt() ); 36 } 32 33 $this->assertTrue( $q->have_posts() ); 34 35 while ( $q->have_posts() ) { 36 $q->the_post(); 37 $this->assertSame( 'Post 2 Page 1', wp_trim_excerpt() ); 37 38 } 38 39 } … … 61 62 ) 62 63 ); 63 if ( $q->have_posts() ) { 64 while ( $q->have_posts() ) { 65 $q->the_post(); 66 $this->assertSame( 'Post 2 Page 1', wp_trim_excerpt() ); 67 } 64 65 $this->assertTrue( $q->have_posts() ); 66 67 while ( $q->have_posts() ) { 68 $q->the_post(); 69 $this->assertSame( 'Post 2 Page 1', wp_trim_excerpt() ); 68 70 } 69 71 } -
trunk/tests/phpunit/tests/functions.php
r59379 r60251 1145 1145 public function test_wp_ext2type() { 1146 1146 $extensions = wp_get_ext_types(); 1147 1148 $this->assertNotEmpty( $extensions ); 1147 1149 1148 1150 foreach ( $extensions as $type => $extension_list ) { -
trunk/tests/phpunit/tests/kses.php
r59677 r60251 490 490 $tags = wp_kses_allowed_html( 'post' ); 491 491 492 $this->assertNotEmpty( $tags ); 493 492 494 foreach ( $tags as $tag ) { 493 495 $this->assertTrue( $tag['class'] ); -
trunk/tests/phpunit/tests/media.php
r59987 r60251 1847 1847 // Calculate a srcset array. 1848 1848 $sizes = explode( ', ', wp_calculate_image_srcset( $size_array, $image_url, $image_meta ) ); 1849 1850 $this->assertNotEmpty( $sizes ); 1849 1851 1850 1852 // Test to confirm all sources in the array include the same edit hash. … … 3781 3783 $query = $this->get_new_wp_query_for_published_post(); 3782 3784 3785 $this->assertTrue( have_posts() ); 3786 3783 3787 while ( have_posts() ) { 3784 3788 the_post(); … … 3837 3841 // Use the filter to alter the threshold for not lazy-loading to the first five elements. 3838 3842 $this->force_omit_loading_attr_threshold( 5 ); 3843 3844 $this->assertTrue( have_posts() ); 3839 3845 3840 3846 while ( have_posts() ) { -
trunk/tests/phpunit/tests/meta.php
r58968 r60251 107 107 $found = $this->updated_mids; 108 108 $this->updated_mids = array(); 109 110 $this->assertNotEmpty( $found ); 109 111 110 112 foreach ( $found as $action => $mids ) { -
trunk/tests/phpunit/tests/post.php
r57239 r60251 270 270 $term = reset( $terms ); 271 271 272 $this->assertNotEmpty( $matches ); 273 $this->assertNotEmpty( $matches[1] ); 274 272 275 foreach ( $matches[1] as $url ) { 273 276 $this->assertStringContainsString( 'tag_ID=' . $term->term_id, $url ); -
trunk/tests/phpunit/tests/post/revisions.php
r56559 r60251 230 230 $this->assertCount( 1, $revisions ); 231 231 $this->assertTrue( user_can( self::$editor_user_id, 'read_post', $post_id ) ); 232 233 $this->assertNotEmpty( $revisions ); 232 234 233 235 foreach ( $revisions as $revision ) { -
trunk/tests/phpunit/tests/post/wpPostType.php
r58211 r60251 7 7 public function test_instances() { 8 8 global $wp_post_types; 9 10 $this->assertNotEmpty( $wp_post_types ); 9 11 10 12 foreach ( $wp_post_types as $post_type ) { -
trunk/tests/phpunit/tests/query.php
r56559 r60251 18 18 19 19 $first_query = new WP_Query( array( 'post__in' => array( $post_id ) ) ); 20 21 $this->assertTrue( $first_query->have_posts() ); 22 20 23 while ( $first_query->have_posts() ) { 21 24 $first_query->the_post(); -
trunk/tests/phpunit/tests/query/postStatus.php
r54865 r60251 241 241 ); 242 242 243 foreach ( get_post_stati( array( 'public' => true ) ) as $status ) { 243 $stati = get_post_stati( array( 'public' => true ) ); 244 245 $this->assertNotEmpty( $stati ); 246 247 foreach ( $stati as $status ) { 244 248 $this->assertStringContainsString( "post_status = '$status'", $q->request ); 245 249 } -
trunk/tests/phpunit/tests/query/setupPostdata.php
r54891 r60251 122 122 ) 123 123 ); 124 125 $this->assertTrue( $q->have_posts() ); 126 124 127 if ( $q->have_posts() ) { 125 128 while ( $q->have_posts() ) { … … 222 225 ) 223 226 ); 227 228 $this->assertTrue( $q->have_posts() ); 229 224 230 if ( $q->have_posts() ) { 225 231 while ( $q->have_posts() ) { … … 282 288 ) 283 289 ); 290 291 $this->assertTrue( $q->have_posts() ); 292 284 293 if ( $q->have_posts() ) { 285 294 while ( $q->have_posts() ) { … … 368 377 ) 369 378 ); 379 380 $this->assertTrue( $q->have_posts() ); 381 370 382 if ( $q->have_posts() ) { 371 383 while ( $q->have_posts() ) { -
trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php
r59970 r60251 3443 3443 $this->assertSame( $comment->comment_agent, $data['author_user_agent'] ); 3444 3444 $this->assertSame( $comment->comment_content, $data['content']['raw'] ); 3445 } 3446 3447 if ( 'edit' !== $context ) { 3445 } else { 3448 3446 $this->assertArrayNotHasKey( 'author_email', $data ); 3449 3447 $this->assertArrayNotHasKey( 'author_ip', $data ); -
trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php
r60197 r60251 877 877 878 878 $all_data = $response->get_data(); 879 880 $this->assertNotEmpty( $all_data ); 881 879 882 foreach ( $all_data as $post ) { 880 883 $this->assertNotEquals( $draft_id, $post['id'] ); -
trunk/tests/phpunit/tests/rest-api/rest-server.php
r59880 r60251 1872 1872 $routes = rest_get_server()->get_routes( 'oembed/1.0' ); 1873 1873 1874 $this->assertNotEmpty( $routes ); 1875 1874 1876 foreach ( $routes as $route => $handlers ) { 1875 1877 $this->assertStringStartsWith( '/oembed/1.0', $route ); -
trunk/tests/phpunit/tests/rest-api/rest-users-controller.php
r60141 r60251 308 308 309 309 $rest_post_types = array_values( get_post_types( array( 'show_in_rest' => true ), 'names' ) ); 310 311 $this->assertNotEmpty( $users ); 310 312 311 313 foreach ( $users as $user ) { … … 3360 3362 $this->assertSame( $user->roles, $data['roles'] ); 3361 3363 $this->assertSame( get_user_locale( $user ), $data['locale'] ); 3362 } 3363 3364 if ( 'edit' !== $context ) { 3364 } else { 3365 3365 $this->assertArrayNotHasKey( 'roles', $data ); 3366 3366 $this->assertArrayNotHasKey( 'capabilities', $data ); -
trunk/tests/phpunit/tests/shortcode.php
r57597 r60251 694 694 add_shortcode( $input, '' ); 695 695 $actual = shortcode_exists( $input ); 696 $this->assertSame( $expected, $actual );697 696 if ( $actual ) { 698 697 remove_shortcode( $input ); 699 698 } 699 700 $this->assertSame( $expected, $actual ); 700 701 } 701 702 -
trunk/tests/phpunit/tests/taxonomy.php
r56642 r60251 29 29 30 30 public function test_get_post_taxonomy() { 31 foreach ( get_object_taxonomies( 'post' ) as $taxonomy ) { 31 $taxonomies = get_object_taxonomies( 'post' ); 32 33 $this->assertNotEmpty( $taxonomies ); 34 35 foreach ( $taxonomies as $taxonomy ) { 32 36 $tax = get_taxonomy( $taxonomy ); 33 37 // Should return an object with the correct taxonomy object type. … … 111 115 112 116 public function test_get_link_taxonomy() { 113 foreach ( get_object_taxonomies( 'link' ) as $taxonomy ) { 117 $taxonomies = get_object_taxonomies( 'link' ); 118 119 $this->assertNotEmpty( $taxonomies ); 120 121 foreach ( $taxonomies as $taxonomy ) { 114 122 $tax = get_taxonomy( $taxonomy ); 115 123 // Should return an object with the correct taxonomy object type. -
trunk/tests/phpunit/tests/term/cache.php
r59015 r60251 223 223 update_term_cache( $terms ); 224 224 225 $this->assertNotEmpty( $terms ); 226 225 227 foreach ( $terms as $term ) { 226 228 $this->assertSame( $p, $term->object_id ); -
trunk/tests/phpunit/tests/term/meta.php
r56549 r60251 133 133 remove_action( 'pre_get_posts', array( $this, 'set_cache_results' ) ); 134 134 135 if ( have_posts() ) {136 while ( have_posts() ) { 137 the_post();138 139 // First request will hit the database. 140 $num_queries = get_num_queries();141 $this->assertSame( 'bar', get_term_meta( $terms[0], 'foo', true ));142 ++$num_queries;143 $this->assertSame( $num_queries, get_num_queries() );144 145 // Second and third requests should be in cache. 146 $this->assertSame( 'bar', get_term_meta( $terms[1], 'foo', true ) );147 $this->assertSame( 'bar', get_term_meta( $terms[2], 'foo', true ) );148 $this->assertSame( $num_queries, get_num_queries() );149 150 // Querying a term not primed should result in a hit. 151 ++$num_queries;152 $this->assertSame( 'bar', get_term_meta( $orphan_term, 'foo', true ) );153 $this->assertSame( $num_queries, get_num_queries() );154 }135 $this->assertTrue( have_posts() ); 136 137 while ( have_posts() ) { 138 the_post(); 139 140 // First request will hit the database. 141 $num_queries = get_num_queries(); 142 $this->assertSame( 'bar', get_term_meta( $terms[0], 'foo', true ) ); 143 ++$num_queries; 144 $this->assertSame( $num_queries, get_num_queries() ); 145 146 // Second and third requests should be in cache. 147 $this->assertSame( 'bar', get_term_meta( $terms[1], 'foo', true ) ); 148 $this->assertSame( 'bar', get_term_meta( $terms[2], 'foo', true ) ); 149 $this->assertSame( $num_queries, get_num_queries() ); 150 151 // Querying a term not primed should result in a hit. 152 ++$num_queries; 153 $this->assertSame( 'bar', get_term_meta( $orphan_term, 'foo', true ) ); 154 $this->assertSame( $num_queries, get_num_queries() ); 155 155 } 156 156 } … … 202 202 ); 203 203 204 if ( $q->have_posts() ) {205 while ( $q->have_posts() ) { 206 $q->the_post();207 208 // Requests will hit the database. 209 $num_queries = get_num_queries();210 $this->assertSame( 'bar', get_term_meta( $terms[0], 'foo', true ));211 ++$num_queries;212 $this->assertSame( $num_queries, get_num_queries() );213 214 $this->assertSame( 'bar', get_term_meta( $terms[1], 'foo', true ) ); 215 ++$num_queries;216 $this->assertSame( $num_queries, get_num_queries() );217 }204 $this->assertTrue( $q->have_posts() ); 205 206 while ( $q->have_posts() ) { 207 $q->the_post(); 208 209 // Requests will hit the database. 210 $num_queries = get_num_queries(); 211 $this->assertSame( 'bar', get_term_meta( $terms[0], 'foo', true ) ); 212 ++$num_queries; 213 $this->assertSame( $num_queries, get_num_queries() ); 214 215 $this->assertSame( 'bar', get_term_meta( $terms[1], 'foo', true ) ); 216 ++$num_queries; 217 $this->assertSame( $num_queries, get_num_queries() ); 218 218 } 219 219 } -
trunk/tests/phpunit/tests/term/wpGenerateTagCloud.php
r55562 r60251 157 157 ); 158 158 159 $this->assertNotEmpty( $tags ); 160 159 161 foreach ( $tags as $tag ) { 160 162 $this->assertStringContainsString( '>' . $tag->name . '<', $found ); … … 187 189 $this->assertMatchesRegularExpression( "|^<ul class='wp-tag-cloud' role='list'>|", $found ); 188 190 $this->assertMatchesRegularExpression( "|</ul>\n|", $found ); 191 192 $this->assertNotEmpty( $tags ); 189 193 190 194 foreach ( $tags as $tag ) { -
trunk/tests/phpunit/tests/term/wpGetObjectTerms.php
r56421 r60251 111 111 $terms = wp_get_object_terms( $post_id, $this->taxonomy ); 112 112 remove_filter( 'wp_get_object_terms', array( $this, 'filter_get_object_terms' ) ); 113 114 $this->assertNotEmpty( $terms ); 115 113 116 foreach ( $terms as $term ) { 114 117 $this->assertIsObject( $term ); … … 845 848 ) 846 849 ); 850 851 $this->assertNotEmpty( $found ); 847 852 848 853 foreach ( $found as $f ) { -
trunk/tests/phpunit/tests/term/wpTaxonomy.php
r56548 r60251 7 7 public function test_instances() { 8 8 global $wp_taxonomies; 9 10 $this->assertNotEmpty( $wp_taxonomies ); 9 11 10 12 foreach ( $wp_taxonomies as $taxonomy ) { -
trunk/tests/phpunit/tests/theme.php
r59823 r60251 90 90 public function test_get_theme() { 91 91 $themes = get_themes(); 92 93 $this->assertNotEmpty( $themes ); 94 92 95 foreach ( array_keys( $themes ) as $name ) { 93 96 $theme = get_theme( $name ); … … 101 104 public function test_wp_get_theme() { 102 105 $themes = wp_get_themes(); 106 107 $this->assertNotEmpty( $themes ); 108 103 109 foreach ( $themes as $theme ) { 104 110 $this->assertInstanceOf( 'WP_Theme', $theme ); … … 116 122 public function test_get_themes_contents() { 117 123 $themes = get_themes(); 124 125 $this->assertNotEmpty( $themes ); 126 118 127 // Generic tests that should hold true for any theme. 119 128 foreach ( $themes as $k => $theme ) { … … 362 371 $themes = get_themes(); 363 372 373 $this->assertNotEmpty( $themes ); 374 364 375 // Switch to each theme in sequence. 365 376 // Do it twice to make sure we switch to the first theme, even if it's our starting theme. -
trunk/tests/phpunit/tests/xmlrpc/wp/getComments.php
r52010 r60251 29 29 $results = $this->myxmlrpcserver->wp_getComments( array( 1, 'editor', 'editor', array() ) ); 30 30 $this->assertNotIXRError( $results ); 31 $this->assertNotEmpty( $results ); 31 32 32 33 foreach ( $results as $result ) { … … 53 54 ); 54 55 $this->assertNotIXRError( $results ); 56 $this->assertNotEmpty( $results ); 55 57 56 58 foreach ( $results as $result ) { -
trunk/tests/phpunit/tests/xmlrpc/wp/getPageList.php
r52010 r60251 42 42 $results = $this->myxmlrpcserver->wp_getPageList( array( 1, 'editor', 'editor' ) ); 43 43 $this->assertNotIXRError( $results ); 44 $this->assertNotEmpty( $results ); 44 45 45 46 foreach ( $results as $result ) { -
trunk/tests/phpunit/tests/xmlrpc/wp/getPages.php
r56547 r60251 48 48 $results = $this->myxmlrpcserver->wp_getPages( array( 1, 'administrator', 'administrator' ) ); 49 49 $this->assertNotIXRError( $results ); 50 $this->assertNotEmpty( $results ); 50 51 51 52 foreach ( $results as $result ) { -
trunk/tests/phpunit/tests/xmlrpc/wp/getPosts.php
r56547 r60251 101 101 $results2 = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter2 ) ); 102 102 $this->assertNotIXRError( $results2 ); 103 $this->assertNotEmpty( $results2 ); 104 103 105 $last_comment_count = 100; 104 106 foreach ( $results2 as $post ) { -
trunk/tests/phpunit/tests/xmlrpc/wp/getTerms.php
r52010 r60251 47 47 $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category' ) ); 48 48 $this->assertNotIXRError( $results ); 49 $this->assertNotEmpty( $results ); 49 50 50 51 foreach ( $results as $term ) { -
trunk/tests/phpunit/tests/xmlrpc/wp/getUsers.php
r52010 r60251 118 118 $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) ); 119 119 $this->assertNotIXRError( $results ); 120 $this->assertNotEmpty( $results ); 120 121 121 122 $last_email = '';
Note: See TracChangeset
for help on using the changeset viewer.