WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/16/2017 04:21:00 PM (4 years ago)
Author:
jnylen0
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/testcase.php

    r39906 r39913  
    185185     */
    186186    protected function reset_post_types() {
    187         foreach ( get_post_types() as $pt ) {
    188             _unregister_post_type( $pt );
     187        foreach ( get_post_types( array(), 'objects' ) as $pt ) {
     188            if ( empty( $pt->tests_no_auto_unregister ) ) {
     189                _unregister_post_type( $pt->name );
     190            }
    189191        }
    190192        create_initial_post_types();
Note: See TracChangeset for help on using the changeset viewer.