diff --git a/tests/phpunit/tests/query/generatePostdata.php b/tests/phpunit/tests/query/generatePostdata.php index 5d39dfb5d4ba5..bb45ba8f8449e 100644 --- a/tests/phpunit/tests/query/generatePostdata.php +++ b/tests/phpunit/tests/query/generatePostdata.php @@ -53,6 +53,7 @@ public function test_authordata() { $data = generate_postdata( $p ); $this->assertNotEmpty( $data['authordata'] ); + // Keep assertEquals() because the objects are intentionally compared by value. $this->assertEquals( $u, $data['authordata'] ); } diff --git a/tests/phpunit/tests/query/isTerm.php b/tests/phpunit/tests/query/isTerm.php index 8eb6d05d6b7bb..14c61cfad7f43 100644 --- a/tests/phpunit/tests/query/isTerm.php +++ b/tests/phpunit/tests/query/isTerm.php @@ -68,6 +68,7 @@ public function test_tag_action_tax() { $this->assertNotEmpty( get_query_var( 'taxonomy' ) ); $this->assertNotEmpty( get_query_var( 'term_id' ) ); $this->assertNotEmpty( get_query_var( 'tag_id' ) ); + // Keep assertEquals() because the objects are intentionally compared by value. $this->assertEquals( get_queried_object(), $this->tag ); } @@ -80,6 +81,7 @@ public function test_tag_query_cat_action_tax() { $this->assertNotEmpty( get_query_var( 'term_id' ) ); $this->assertNotEmpty( get_query_var( 'cat' ) ); $this->assertNotEmpty( get_query_var( 'tag_id' ) ); + // Keep assertEquals() because the objects are intentionally compared by value. $this->assertEquals( get_queried_object(), $this->cat ); } @@ -93,6 +95,7 @@ public function test_tag_query_cat_query_tax_action_tax() { $this->assertNotEmpty( get_query_var( 'cat' ) ); $this->assertNotEmpty( get_query_var( 'tag_id' ) ); $this->assertNotEmpty( get_query_var( 'testtax' ) ); + // Keep assertEquals() because the objects are intentionally compared by value. $this->assertEquals( get_queried_object(), $this->cat ); } @@ -104,6 +107,7 @@ public function test_cat_action_tax() { $this->assertNotEmpty( get_query_var( 'tax_query' ) ); $this->assertNotEmpty( get_query_var( 'taxonomy' ) ); $this->assertNotEmpty( get_query_var( 'term_id' ) ); + // Keep assertEquals() because the objects are intentionally compared by value. $this->assertEquals( get_queried_object(), $this->cat ); } @@ -120,6 +124,7 @@ public function test_cat_uncat_action_tax() { $this->assertNotEmpty( get_query_var( 'tax_query' ) ); $this->assertNotEmpty( get_query_var( 'taxonomy' ) ); $this->assertNotEmpty( get_query_var( 'term_id' ) ); + // Keep assertEquals() because the objects are intentionally compared by value. $this->assertEquals( get_queried_object(), $this->uncat ); remove_action( 'pre_get_posts', array( $this, 'cat_uncat_action_tax' ), 11 ); @@ -130,6 +135,7 @@ public function cat_uncat_action_tax( &$query ) { $this->assertTrue( $query->is_archive() ); $this->assertNotEmpty( $query->get( 'category_name' ) ); $this->assertNotEmpty( $query->get( 'tax_query' ) ); + // Keep assertEquals() because the objects are intentionally compared by value. $this->assertEquals( $query->get_queried_object(), $this->uncat ); } @@ -143,6 +149,7 @@ public function test_tax_action_tax() { $this->assertNotEmpty( get_query_var( 'tax_query' ) ); $this->assertNotEmpty( get_query_var( 'taxonomy' ) ); $this->assertNotEmpty( get_query_var( 'term_id' ) ); + // Keep assertEquals() because the objects are intentionally compared by value. $this->assertEquals( get_queried_object(), get_term( $this->tax_id, 'testtax' ) ); } @@ -154,6 +161,7 @@ public function test_tax_query_tag_action_tax() { $this->assertNotEmpty( get_query_var( 'taxonomy' ) ); $this->assertNotEmpty( get_query_var( 'term_id' ) ); $this->assertNotEmpty( get_query_var( 'tag_id' ) ); + // Keep assertEquals() because the objects are intentionally compared by value. $this->assertEquals( get_queried_object(), $this->tag ); } @@ -165,6 +173,7 @@ public function test_tax_query_cat_action_tax() { $this->assertNotEmpty( get_query_var( 'taxonomy' ) ); $this->assertNotEmpty( get_query_var( 'term_id' ) ); $this->assertNotEmpty( get_query_var( 'cat' ) ); + // Keep assertEquals() because the objects are intentionally compared by value. $this->assertEquals( get_queried_object(), $this->cat ); } @@ -206,6 +215,7 @@ public function test_get_queried_object_with_custom_taxonomy_tax_query_and_field $expected = get_term( $this->tax_id, 'testtax' ); + // Keep assertEquals() because the objects are intentionally compared by value. $this->assertEquals( $expected, $object ); } diff --git a/tests/phpunit/tests/query/setupPostdata.php b/tests/phpunit/tests/query/setupPostdata.php index 9b93558e1dfcf..2658bbd4c8236 100644 --- a/tests/phpunit/tests/query/setupPostdata.php +++ b/tests/phpunit/tests/query/setupPostdata.php @@ -64,6 +64,7 @@ public function test_authordata() { setup_postdata( $p ); $this->assertNotEmpty( $GLOBALS['authordata'] ); + // Keep assertEquals() because the objects are intentionally compared by value. $this->assertEquals( $u, $GLOBALS['authordata'] ); } @@ -111,6 +112,7 @@ public function test_secondary_query_post_vars() { // Main loop. $this->assertSame( $post1->ID, $GLOBALS['id'] ); + // Keep assertEquals() because the objects are intentionally compared by value. $this->assertEquals( get_userdata( $users[0] ), $GLOBALS['authordata'] ); $this->assertSame( '02.02.12', $GLOBALS['currentday'] ); $this->assertSame( '02', $GLOBALS['currentmonth'] ); @@ -130,6 +132,7 @@ public function test_secondary_query_post_vars() { // Should refer to the current loop. $this->assertSame( $post2->ID, $GLOBALS['id'] ); + // Keep assertEquals() because the objects are intentionally compared by value. $this->assertEquals( get_userdata( $users[1] ), $GLOBALS['authordata'] ); $this->assertSame( '03.03.13', $GLOBALS['currentday'] ); $this->assertSame( '03', $GLOBALS['currentmonth'] ); @@ -139,6 +142,7 @@ public function test_secondary_query_post_vars() { // Should be reset to main loop. $this->assertSame( $post1->ID, $GLOBALS['id'] ); + // Keep assertEquals() because the objects are intentionally compared by value. $this->assertEquals( get_userdata( $users[0] ), $GLOBALS['authordata'] ); $this->assertSame( '02.02.12', $GLOBALS['currentday'] ); $this->assertSame( '02', $GLOBALS['currentmonth'] );