Make WordPress Core


Ignore:
Timestamp:
05/21/2015 06:42:49 PM (9 years ago)
Author:
boonebgorges
Message:

Support multiple post types in count_user_posts() and other functions that use get_posts_by_author_sql().

Props nikonratm.
Fixes #32243.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/user/countUserPosts.php

    r31622 r32523  
    7979        $this->assertEquals( 3, count_user_posts( self::$user_id, 'wptests_pt' ) );
    8080    }
     81
     82    /**
     83     * @ticket 32243
     84     */
     85    public function test_count_user_posts_with_multiple_post_types() {
     86        $this->assertEquals( 7, count_user_posts( self::$user_id, array( 'wptests_pt', 'post' ) ) );
     87    }
     88
     89    /**
     90     * @ticket 32243
     91     */
     92    public function test_count_user_posts_should_ignore_non_existent_post_types() {
     93        $this->assertEquals( 4, count_user_posts( self::$user_id, array( 'foo', 'post' ) ) );
     94    }
    8195}
Note: See TracChangeset for help on using the changeset viewer.