diff --git a/tests/phpunit/tests/user/mapMetaCap.php b/tests/phpunit/tests/user/mapMetaCap.php index b969a5d8f4f58..d4275166a7ee4 100644 --- a/tests/phpunit/tests/user/mapMetaCap.php +++ b/tests/phpunit/tests/user/mapMetaCap.php @@ -36,7 +36,7 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { public static function wpTearDownAfterClass() { $GLOBALS['super_admins'] = self::$super_admins; - unset( $GLOBALS['wp_post_types'][ self::$post_type ] ); + unregister_post_type( self::$post_type ); } /**