Posts, Post Types: Add initial tests for `get_post_type_labels()`.
See #38218. Fixes #38157. git-svn-id: https://develop.svn.wordpress.org/trunk@40635 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d8ca95415e
commit
ec6de050b7
|
@ -219,27 +219,6 @@ class Tests_Post_Types extends WP_UnitTestCase {
|
||||||
_unregister_post_type( 'foo' );
|
_unregister_post_type( 'foo' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @ticket 33543
|
|
||||||
*/
|
|
||||||
function test_get_post_type_labels_should_fall_back_on_defaults_when_filtered_labels_do_not_contain_the_keys() {
|
|
||||||
add_filter( 'post_type_labels_foo', array( $this, 'filter_post_type_labels' ) );
|
|
||||||
register_post_type( 'foo' );
|
|
||||||
|
|
||||||
$this->assertObjectHasAttribute( 'featured_image', get_post_type_object( 'foo' )->labels );
|
|
||||||
$this->assertObjectHasAttribute( 'set_featured_image', get_post_type_object( 'foo' )->labels );
|
|
||||||
|
|
||||||
_unregister_post_type( 'foo' );
|
|
||||||
remove_filter( 'post_type_labels_foo', array( $this, 'filter_post_type_labels' ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
public function filter_post_type_labels( $labels ) {
|
|
||||||
unset( $labels->featured_image );
|
|
||||||
unset( $labels->set_featured_image );
|
|
||||||
return $labels;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ticket 30013
|
* @ticket 30013
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue