Changeset 61417
- Timestamp:
- 12/29/2025 11:13:54 PM (3 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/post.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post.php
r61173 r61417 184 184 185 185 $count = wp_count_posts( $post_type, 'readable' ); 186 $this->assert Equals( 1, $count->publish );186 $this->assertSame( '1', $count->publish ); 187 187 188 188 _unregister_post_type( $post_type ); … … 227 227 228 228 $count = wp_count_posts( $post_type, 'readable' ); 229 $this->assert Equals( 5, $count->publish );229 $this->assertSame( '5', $count->publish ); 230 230 _unregister_post_type( $post_type ); 231 231 } … … 246 246 247 247 $count1 = wp_count_posts( $post_type, 'readable' ); 248 $this->assert Equals( 3, $count1->publish );248 $this->assertSame( '3', $count1->publish ); 249 249 250 250 add_filter( 'wp_count_posts', array( $this, 'filter_wp_count_posts' ) ); 251 251 $count2 = wp_count_posts( $post_type, 'readable' ); 252 252 remove_filter( 'wp_count_posts', array( $this, 'filter_wp_count_posts' ) ); 253 $this->assert Equals( 2, $count2->publish );253 $this->assertSame( '2', $count2->publish ); 254 254 } 255 255 256 256 public function filter_wp_count_posts( $counts ) { 257 $counts->publish = 2;257 $counts->publish = '2'; 258 258 return $counts; 259 259 } … … 277 277 278 278 $after_draft_counts = wp_count_posts(); 279 $this->assert Equals( 1, $after_draft_counts->draft );280 $this->assert Equals( 2, $after_draft_counts->publish );279 $this->assertSame( '1', $after_draft_counts->draft ); 280 $this->assertSame( '2', $after_draft_counts->publish ); 281 281 $this->assertNotEquals( $initial_counts->publish, $after_draft_counts->publish ); 282 282 } … … 298 298 299 299 $after_trash_counts = wp_count_posts(); 300 $this->assert Equals( 1, $after_trash_counts->trash );301 $this->assert Equals( 2, $after_trash_counts->publish );300 $this->assertSame( '1', $after_trash_counts->trash ); 301 $this->assertSame( '2', $after_trash_counts->publish ); 302 302 $this->assertNotEquals( $initial_counts->publish, $after_trash_counts->publish ); 303 303 }
Note: See TracChangeset
for help on using the changeset viewer.