From a1e19248a3ff6b1e261c10b22e772dee55212d1f Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Mon, 6 Jun 2016 23:42:43 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/term/wpSetObjectTerms.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/tests/term/wpSetObjectTerms.php b/tests/phpunit/tests/term/wpSetObjectTerms.php index 2dde5fd72f..f14516b119 100644 --- a/tests/phpunit/tests/term/wpSetObjectTerms.php +++ b/tests/phpunit/tests/term/wpSetObjectTerms.php @@ -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 ); }