697 | | } |
698 | | No newline at end of file |
| 697 | |
| 698 | function test_wp_count_posts() { |
| 699 | global $wp_post_types; |
| 700 | |
| 701 | register_post_type( 'wp_count' ); |
| 702 | $this->factory->post->create( array( |
| 703 | 'post_type' => 'wp_count', |
| 704 | 'post_author' => $this->author_id |
| 705 | ) ); |
| 706 | $count = wp_count_posts( 'wp_count', 'readable' ); |
| 707 | $this->assertEquals( 1, $count->publish ); |
| 708 | unset( $wp_post_types['wp_count'] ); |
| 709 | $this->assertEquals( new stdClass, wp_count_posts( 'wp_count', 'readable' ) ); |
| 710 | } |
| 711 | } |