Skip to content

Commit 3d81878

Browse files
committed
Tests: Clean up custom post types in sitemap tests.
Unregister the public, private, and non-viewable fixture post types used by the post and user sitemap tests. Developed in: #14917 Props huzaifaalmesbah. See #65893. git-svn-id: https://develop.svn.wordpress.org/trunk@64841 602fd350-edb4-49c9-b593-d223f7449a82
1 parent d7bce3c commit 3d81878

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎tests/phpunit/tests/sitemaps/wpSitemapsPosts.php‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
*/
66
class Tests_Sitemaps_wpSitemapsPosts extends WP_UnitTestCase {
77

8+
public function tear_down() {
9+
unregister_post_type( 'public_cpt' );
10+
unregister_post_type( 'private_cpt' );
11+
unregister_post_type( 'not_viewable_cpt' );
12+
13+
parent::tear_down();
14+
}
15+
816
/**
917
* Tests getting sitemap entries for post type page with 'posts' homepage.
1018
*

‎tests/phpunit/tests/sitemaps/wpSitemapsUsers.php‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
3131
self::$editor_id = self::$users[0];
3232
}
3333

34+
public function tear_down() {
35+
unregister_post_type( 'public_cpt' );
36+
unregister_post_type( 'private_cpt' );
37+
38+
parent::tear_down();
39+
}
40+
3441
/**
3542
* Test getting a URL list for a users sitemap page via
3643
* WP_Sitemaps_Users::get_url_list().

0 commit comments

Comments
 (0)