Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tests/phpunit/tests/user/getTheAuthorPosts.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ public function set_up() {
setup_postdata( get_post( self::$post_id ) );
}

public function tear_down() {
unregister_post_type( 'wptests_pt' );

parent::tear_down();
}

public function test_get_the_author_posts() {
// Test with no global post, result should be 0 because no author is found.
$this->assertSame( 0, get_the_author_posts() );
Expand All @@ -61,7 +67,5 @@ public function test_get_the_author_posts_with_custom_post_type() {
$GLOBALS['post'] = $cpt_ids[0];

$this->assertSame( 2, get_the_author_posts() );

_unregister_post_type( 'wptests_pt' );
}
}
Loading