get_blog_details()->post_count should update on more actions than just publish_post.

Adds unit test.

Props 5um17, midxcat, strangerstudios.
Fixes #27952.


git-svn-id: https://develop.svn.wordpress.org/trunk@28835 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-06-26 00:52:25 +00:00
parent 8621b2c92c
commit b917e7998d
4 changed files with 50 additions and 2 deletions

View File

@@ -1385,6 +1385,18 @@ class Tests_MS extends WP_UnitTestCase {
$GLOBALS['super_admins'] = $old_global;
}
}
/**
* @ticket 27952
*/
function test_posts_count() {
$this->factory->post->create();
$post2 = $this->factory->post->create();
$this->assertEquals( 2, get_blog_details()->post_count );
wp_delete_post( $post2 );
$this->assertEquals( 1, get_blog_details()->post_count );
}
}
endif;