mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
wp_update_term() should check if get_term() returned null.
props dlh. fixes #31954. git-svn-id: https://develop.svn.wordpress.org/trunk@32117 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -653,4 +653,16 @@ class Tests_Term_WpUpdateTerm extends WP_UnitTestCase {
|
||||
|
||||
_unregister_taxonomy( 'wptests_tax' );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 31954
|
||||
*/
|
||||
public function test_wp_update_term_with_null_get_term() {
|
||||
$t = $this->factory->term->create( array( 'taxonomy' => 'category' ) );
|
||||
$found = wp_update_term( $t, 'post_tag', array( 'slug' => 'foo' ) );
|
||||
|
||||
$this->assertWPError( $found );
|
||||
$this->assertSame( 'invalid_term', $found->get_error_code() );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user