Remove unit test related to pre-4.1 term splitting during wp_update_term()
.
After [33615], `wp_update_term()` no longer checks `$wp_db_version` before attempting a split. This is because pre-4.1 versions of WordPress must be allowed to update to 4.3+. See #30261. git-svn-id: https://develop.svn.wordpress.org/trunk@33616 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f18355e66e
commit
6d5da327f5
@ -300,50 +300,6 @@ class Tests_Term_WpUpdateTerm extends WP_UnitTestCase {
|
|||||||
$this->assertNotEquals( $t1_terms[0]->term_id, $t2_terms[0]->term_id );
|
$this->assertNotEquals( $t1_terms[0]->term_id, $t2_terms[0]->term_id );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @ticket 5809
|
|
||||||
*/
|
|
||||||
public function test_wp_update_term_should_not_split_shared_term_before_410_schema_change() {
|
|
||||||
global $wpdb;
|
|
||||||
|
|
||||||
$db_version = get_option( 'db_version' );
|
|
||||||
update_option( 'db_version', 30055 );
|
|
||||||
|
|
||||||
register_taxonomy( 'wptests_tax', 'post' );
|
|
||||||
register_taxonomy( 'wptests_tax_2', 'post' );
|
|
||||||
|
|
||||||
$t1 = wp_insert_term( 'Foo', 'wptests_tax' );
|
|
||||||
$t2 = wp_insert_term( 'Foo', 'wptests_tax_2' );
|
|
||||||
|
|
||||||
// Manually modify because shared terms shouldn't naturally occur.
|
|
||||||
$wpdb->update( $wpdb->term_taxonomy,
|
|
||||||
array( 'term_id' => $t1['term_id'] ),
|
|
||||||
array( 'term_taxonomy_id' => $t2['term_taxonomy_id'] ),
|
|
||||||
array( '%d' ),
|
|
||||||
array( '%d' )
|
|
||||||
);
|
|
||||||
|
|
||||||
$posts = $this->factory->post->create_many( 2 );
|
|
||||||
wp_set_object_terms( $posts[0], array( 'Foo' ), 'wptests_tax' );
|
|
||||||
wp_set_object_terms( $posts[1], array( 'Foo' ), 'wptests_tax_2' );
|
|
||||||
|
|
||||||
// Verify that the term is shared.
|
|
||||||
$t1_terms = wp_get_object_terms( $posts[0], 'wptests_tax' );
|
|
||||||
$t2_terms = wp_get_object_terms( $posts[1], 'wptests_tax_2' );
|
|
||||||
$this->assertSame( $t1_terms[0]->term_id, $t2_terms[0]->term_id );
|
|
||||||
|
|
||||||
wp_update_term( $t2_terms[0]->term_id, 'wptests_tax_2', array(
|
|
||||||
'name' => 'New Foo',
|
|
||||||
) );
|
|
||||||
|
|
||||||
// Term should still be shared.
|
|
||||||
$t1_terms = wp_get_object_terms( $posts[0], 'wptests_tax' );
|
|
||||||
$t2_terms = wp_get_object_terms( $posts[1], 'wptests_tax_2' );
|
|
||||||
$this->assertSame( $t1_terms[0]->term_id, $t2_terms[0]->term_id );
|
|
||||||
|
|
||||||
update_option( 'db_version', $db_version );
|
|
||||||
}
|
|
||||||
|
|
||||||
public function test_wp_update_term_alias_of_no_term_group() {
|
public function test_wp_update_term_alias_of_no_term_group() {
|
||||||
register_taxonomy( 'wptests_tax', 'post' );
|
register_taxonomy( 'wptests_tax', 'post' );
|
||||||
$t1 = $this->factory->term->create( array(
|
$t1 = $this->factory->term->create( array(
|
||||||
|
Loading…
Reference in New Issue
Block a user