Tests: Compare `wp_set_object_terms()` results using `term_taxonomy_id`.

`term_id` and `term_taxonomy_id` become offset when running the entire test
suite.

Introduced in [37647].

See #37009.

git-svn-id: https://develop.svn.wordpress.org/trunk@37649 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges 2016-06-06 23:42:43 +00:00
parent 30b1f09c21
commit a1e19248a3
1 changed files with 4 additions and 4 deletions

View File

@ -318,7 +318,7 @@ class Tests_Term_WpSetObjectTerms extends WP_UnitTestCase {
$tt_ids = wp_set_object_terms( self::$post_ids[0], 'foo', 'wptests_tax' );
$this->assertNotEmpty( $tt_ids );
$term = get_term( $tt_ids[0] );
$term = get_term_by( 'term_taxonomy_id', $tt_ids[0] );
$this->assertInstanceOf( 'WP_Term', $term );
$this->assertSame( 'foo', $term->slug );
}
@ -335,7 +335,7 @@ class Tests_Term_WpSetObjectTerms extends WP_UnitTestCase {
$tt_ids = wp_set_object_terms( self::$post_ids[0], 'foo', 'wptests_tax' );
$this->assertNotEmpty( $tt_ids );
$term = get_term( $tt_ids[0] );
$term = get_term_by( 'term_taxonomy_id', $tt_ids[0] );
$this->assertInstanceOf( 'WP_Term', $term );
$this->assertSame( $t, $term->term_id );
}
@ -352,7 +352,7 @@ class Tests_Term_WpSetObjectTerms extends WP_UnitTestCase {
$tt_ids = wp_set_object_terms( self::$post_ids[0], 'Bar', 'wptests_tax' );
$this->assertNotEmpty( $tt_ids );
$term = get_term( $tt_ids[0] );
$term = get_term_by( 'term_taxonomy_id', $tt_ids[0] );
$this->assertInstanceOf( 'WP_Term', $term );
$this->assertSame( $t, $term->term_id );
}
@ -375,7 +375,7 @@ class Tests_Term_WpSetObjectTerms extends WP_UnitTestCase {
$tt_ids = wp_set_object_terms( self::$post_ids[0], 'Bar', 'wptests_tax' );
$this->assertNotEmpty( $tt_ids );
$term = get_term( $tt_ids[0] );
$term = get_term_by( 'term_taxonomy_id', $tt_ids[0] );
$this->assertInstanceOf( 'WP_Term', $term );
$this->assertSame( $t2, $term->term_id );
}