WordPress.org

Make WordPress Core

Changeset 40635


Ignore:
Timestamp:
05/11/2017 07:18:53 PM (3 years ago)
Author:
swissspidy
Message:

Posts, Post Types: Add initial tests for get_post_type_labels().

See #38218.
Fixes #38157.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post/types.php

    r38571 r40635  
    221221
    222222    /**
    223      * @ticket 33543
    224      */
    225     function test_get_post_type_labels_should_fall_back_on_defaults_when_filtered_labels_do_not_contain_the_keys() {
    226         add_filter( 'post_type_labels_foo', array( $this, 'filter_post_type_labels' ) );
    227         register_post_type( 'foo' );
    228 
    229         $this->assertObjectHasAttribute( 'featured_image', get_post_type_object( 'foo' )->labels );
    230         $this->assertObjectHasAttribute( 'set_featured_image', get_post_type_object( 'foo' )->labels );
    231 
    232         _unregister_post_type( 'foo' );
    233         remove_filter( 'post_type_labels_foo', array( $this, 'filter_post_type_labels' ) );
    234     }
    235 
    236     public function filter_post_type_labels( $labels ) {
    237         unset( $labels->featured_image );
    238         unset( $labels->set_featured_image );
    239         return $labels;
    240     }
    241 
    242 
    243     /**
    244223     * @ticket 30013
    245224     */
Note: See TracChangeset for help on using the changeset viewer.