Skip to content

Commit 0d4eca5

Browse files
committed
Tests: Clean up custom post types in link tests.
Unregister `wptests_books` and `non_viewable_cpt` after the archive feed and preview link tests. Developed in: #14921 Props huzaifaalmesbah. See #65893. git-svn-id: https://develop.svn.wordpress.org/trunk@64843 602fd350-edb4-49c9-b593-d223f7449a82
1 parent f54bdbf commit 0d4eca5

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎tests/phpunit/tests/link/getPostTypeArchiveFeedLink.php‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
*/
1111
class Tests_Link_GetPostTypeArchiveFeedLink extends WP_UnitTestCase {
1212

13+
public function tear_down() {
14+
unregister_post_type( 'wptests_books' );
15+
16+
parent::tear_down();
17+
}
18+
1319
/**
1420
* Registers a post type with an archive.
1521
*

‎tests/phpunit/tests/link/getPreviewPostLink.php‎

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

8+
public function tear_down() {
9+
unregister_post_type( 'non_viewable_cpt' );
10+
11+
parent::tear_down();
12+
}
13+
814
public function test_get_preview_post_link() {
915
$post = self::factory()->post->create();
1016

0 commit comments

Comments
 (0)