mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-04 17:20:07 +00:00
REST API: Improve test coverage of single user endpoint for public data.
Add test coverage for requests of a single user resource for authors of post types registered as: - public = true, show_in_rest = true: success without auth. - public = true, show_in_rest = false: fail without auth. - public = false, show_in_rest = true: success without auth. - public = false, show_in_rest = false: fail without auth. See #38878. Fixes #39546. git-svn-id: https://develop.svn.wordpress.org/trunk@39913 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -184,8 +184,10 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase {
|
||||
* it has a chance to do so.
|
||||
*/
|
||||
protected function reset_post_types() {
|
||||
foreach ( get_post_types() as $pt ) {
|
||||
_unregister_post_type( $pt );
|
||||
foreach ( get_post_types( array(), 'objects' ) as $pt ) {
|
||||
if ( empty( $pt->tests_no_auto_unregister ) ) {
|
||||
_unregister_post_type( $pt->name );
|
||||
}
|
||||
}
|
||||
create_initial_post_types();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user