Make WordPress Core


Ignore:
Timestamp:
06/26/2014 12:52:25 AM (10 years ago)
Author:
wonderboymusic
Message:

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

Adds unit test.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/ms.php

    r28280 r28835  
    13861386        }
    13871387    }
     1388
     1389    /**
     1390     * @ticket 27952
     1391     */
     1392    function test_posts_count() {
     1393        $this->factory->post->create();
     1394        $post2 = $this->factory->post->create();
     1395        $this->assertEquals( 2, get_blog_details()->post_count );
     1396
     1397        wp_delete_post( $post2 );
     1398        $this->assertEquals( 1, get_blog_details()->post_count );
     1399    }
    13881400}
    13891401
Note: See TracChangeset for help on using the changeset viewer.