mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user