Changeset 51367 for trunk/tests/phpunit/tests/term/getTerms.php
- Timestamp:
- 07/07/2021 10:32:56 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/getTerms.php
r51331 r51367 116 116 // last_changed and num_queries should bump. 117 117 $terms = get_terms( 'post_tag', array( 'update_term_meta_cache' => false ) ); 118 $this->assert Same( 3, count( $terms ));118 $this->assertCount( 3, $terms ); 119 119 $time1 = wp_cache_get( 'last_changed', 'terms' ); 120 120 $this->assertNotEmpty( $time1 ); … … 125 125 // Again. last_changed and num_queries should remain the same. 126 126 $terms = get_terms( 'post_tag', array( 'update_term_meta_cache' => false ) ); 127 $this->assert Same( 3, count( $terms ));127 $this->assertCount( 3, $terms ); 128 128 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'terms' ) ); 129 129 $this->assertSame( $num_queries, $wpdb->num_queries ); … … 145 145 // num_queries should bump, last_changed should remain the same. 146 146 $terms = get_terms( 'post_tag', array( 'number' => 2 ) ); 147 $this->assert Same( 2, count( $terms ));147 $this->assertCount( 2, $terms ); 148 148 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'terms' ) ); 149 149 $this->assertSame( $num_queries + 1, $wpdb->num_queries ); … … 153 153 // Again. last_changed and num_queries should remain the same. 154 154 $terms = get_terms( 'post_tag', array( 'number' => 2 ) ); 155 $this->assert Same( 2, count( $terms ));155 $this->assertCount( 2, $terms ); 156 156 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'terms' ) ); 157 157 $this->assertSame( $num_queries, $wpdb->num_queries ); … … 180 180 // last_changed and num_queries should bump after a term is deleted. 181 181 $terms = get_terms( 'post_tag' ); 182 $this->assert Same( 2, count( $terms ));182 $this->assertCount( 2, $terms ); 183 183 $this->assertSame( $time2, wp_cache_get( 'last_changed', 'terms' ) ); 184 184 $this->assertSame( $num_queries + 1, $wpdb->num_queries ); … … 188 188 // Again. last_changed and num_queries should remain the same. 189 189 $terms = get_terms( 'post_tag' ); 190 $this->assert Same( 2, count( $terms ));190 $this->assertCount( 2, $terms ); 191 191 $this->assertSame( $time2, wp_cache_get( 'last_changed', 'terms' ) ); 192 192 $this->assertSame( $num_queries, $wpdb->num_queries ); … … 618 618 ) 619 619 ); 620 $this->assert Same( 2, count( $terms ));620 $this->assertCount( 2, $terms ); 621 621 $this->assertSame( wp_list_pluck( $terms, 'name' ), array( 'Cheese', 'Crackers' ) ); 622 622 } … … 661 661 ) 662 662 ); 663 $this->assert Same( 1, count( $terms ));663 $this->assertCount( 1, $terms ); 664 664 $this->assertSame( array( 'Cheese' ), wp_list_pluck( $terms, 'name' ) ); 665 665 … … 697 697 ) 698 698 ); 699 $this->assert Same( 1, count( $terms ));699 $this->assertCount( 1, $terms ); 700 700 $this->assertSame( array( 'term1' ), wp_list_pluck( $terms, 'name' ) ); 701 701 … … 717 717 ) 718 718 ); 719 $this->assert Same( 1, count( $terms ));719 $this->assertCount( 1, $terms ); 720 720 } 721 721 … … 2309 2309 2310 2310 // Verify that there are no children. 2311 $this->assert Same( 0, count( $terms ));2311 $this->assertCount( 0, $terms ); 2312 2312 } 2313 2313 … … 2375 2375 2376 2376 // Verify that there are no children. 2377 $this->assert Same( 0, count( $terms ));2377 $this->assertCount( 0, $terms ); 2378 2378 } 2379 2379 … … 2488 2488 2489 2489 // 'hierarchical=false' means that descendants are not fetched. 2490 $this->assert Same( 0, count( $terms ));2490 $this->assertCount( 0, $terms ); 2491 2491 } 2492 2492
Note: See TracChangeset
for help on using the changeset viewer.