mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Return a WP_Error if an empty name is provided when registering a post type.
Fixes #31134 Props tyxla, MikeHansenMe git-svn-id: https://develop.svn.wordpress.org/trunk@31450 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -19,6 +19,26 @@ class Tests_Post_Types extends WP_UnitTestCase {
|
||||
_unregister_post_type( 'foo' );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 31134
|
||||
*
|
||||
* @expectedIncorrectUsage register_post_type
|
||||
*/
|
||||
function test_register_post_type_length_long() {
|
||||
// post type too long
|
||||
$this->assertInstanceOf( 'WP_Error', register_post_type( 'abcdefghijklmnopqrstuvwxyz0123456789' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 31134
|
||||
*
|
||||
* @expectedIncorrectUsage register_post_type
|
||||
*/
|
||||
function test_register_post_type_length_short() {
|
||||
// post type too short
|
||||
$this->assertInstanceOf( 'WP_Error', register_post_type( '' ) );
|
||||
}
|
||||
|
||||
function test_register_taxonomy_for_object_type() {
|
||||
global $wp_taxonomies;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user