Make WordPress Core

Ticket #30904: 30904-tests.patch

File 30904-tests.patch, 743 bytes (added by tyxla, 9 years ago)

Adding an assertion in the unit test Tests_User_Author::test_get_the_author_posts() that checks for the new $post->post_type parameter usage in the count_user_posts() call within get_the_author_posts().

  • tests/phpunit/tests/user/author.php

     
    8181                $this->assertEquals( 0, get_the_author_posts() );
    8282                $GLOBALS['post'] = $this->post_id;
    8383                $this->assertEquals( 1, get_the_author_posts() );
     84
     85                /**
     86                 * @ticket 30904
     87                 */
     88                register_post_type( 'wptests_pt' );
     89                $cpt_ids = $this->factory->post->create_many( 2, array(
     90                        'post_author' => $this->author_id,
     91                        'post_type'   => 'wptests_pt',
     92                ) );
     93                $GLOBALS['post'] = $cpt_ids[0];
     94                $this->assertEquals(2, get_the_author_posts() );
     95                _unregister_post_type( 'wptests_pt' );
    8496        }
    8597}