Changeset 51367 for trunk/tests/phpunit/tests/post/getPages.php
- Timestamp:
- 07/07/2021 10:32:56 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/getPages.php
r50449 r51367 17 17 18 18 $pages = get_pages(); 19 $this->assert Same( 3, count( $pages ));19 $this->assertCount( 3, $pages ); 20 20 $time1 = wp_cache_get( 'last_changed', 'posts' ); 21 21 $this->assertNotEmpty( $time1 ); … … 27 27 // Again. num_queries and last_changed should remain the same. 28 28 $pages = get_pages(); 29 $this->assert Same( 3, count( $pages ));29 $this->assertCount( 3, $pages ); 30 30 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) ); 31 31 $this->assertSame( $num_queries, $wpdb->num_queries ); … … 37 37 // different args to get_pages(). num_queries should bump by 1. 38 38 $pages = get_pages( array( 'number' => 2 ) ); 39 $this->assert Same( 2, count( $pages ));39 $this->assertCount( 2, $pages ); 40 40 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) ); 41 41 $this->assertSame( $num_queries + 1, $wpdb->num_queries ); … … 48 48 // Again. num_queries and last_changed should remain the same. 49 49 $pages = get_pages( array( 'number' => 2 ) ); 50 $this->assert Same( 2, count( $pages ));50 $this->assertCount( 2, $pages ); 51 51 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) ); 52 52 $this->assertSame( $num_queries, $wpdb->num_queries ); … … 57 57 // Do the first query again. The interim queries should not affect it. 58 58 $pages = get_pages(); 59 $this->assert Same( 3, count( $pages ));59 $this->assertCount( 3, $pages ); 60 60 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) ); 61 61 $this->assertSame( $num_queries, $wpdb->num_queries ); … … 72 72 // last_changed bumped so num_queries should increment. 73 73 $pages = get_pages( array( 'number' => 2 ) ); 74 $this->assert Same( 2, count( $pages ));74 $this->assertCount( 2, $pages ); 75 75 $this->assertSame( $time2, wp_cache_get( 'last_changed', 'posts' ) ); 76 76 $this->assertSame( $num_queries + 1, $wpdb->num_queries ); … … 92 92 // num_queries should bump after wp_delete_post() bumps last_changed. 93 93 $pages = get_pages(); 94 $this->assert Same( 2, count( $pages ));94 $this->assertCount( 2, $pages ); 95 95 $this->assertSame( $last_changed, wp_cache_get( 'last_changed', 'posts' ) ); 96 96 $this->assertSame( $num_queries + 1, $wpdb->num_queries ); … … 278 278 ) 279 279 ); 280 $this->assert Same( 3, count( get_pages( array( 'meta_key' => 'some-meta-key' )) ) );280 $this->assertCount( 3, get_pages( array( 'meta_key' => 'some-meta-key' ) ) ); 281 281 } 282 282 … … 373 373 preg_match_all( '#<option#', wp_dropdown_pages( 'echo=0' ), $matches ); 374 374 375 $this->assert Same( 5, count( $matches[0] ));375 $this->assertCount( 5, $matches[0] ); 376 376 } 377 377
Note: See TracChangeset
for help on using the changeset viewer.