Tests: Replace some occurrences of assertEquals() with assertSame().

This ensures that not only the return values match the expected results, but also that their type is the same.

Props costdev, desrosj.
See #55654.

git-svn-id: https://develop.svn.wordpress.org/trunk@54402 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers
2022-10-07 01:02:07 +00:00
parent 8128f19599
commit 28fdf705dc
40 changed files with 119 additions and 128 deletions

View File

@@ -59,7 +59,7 @@ class Tests_Term_Tax_Query extends WP_UnitTestCase {
'operator' => 'IN',
);
$this->assertEquals( $expected, $tq->queries[0] );
$this->assertSameSetsWithIndex( $expected, $tq->queries[0] );
}
public function test_construct_fill_missing_query_params_merge_with_passed_values() {
@@ -82,7 +82,7 @@ class Tests_Term_Tax_Query extends WP_UnitTestCase {
'foo' => 'bar',
);
$this->assertEquals( $expected, $tq->queries[0] );
$this->assertSameSetsWithIndex( $expected, $tq->queries[0] );
}
public function test_construct_cast_terms_to_array() {
@@ -262,7 +262,7 @@ class Tests_Term_Tax_Query extends WP_UnitTestCase {
);
$tq->transform_query( $tq->queries[0], 'term_taxonomy_id' );
$this->assertEquals( $tt_ids, $tq->queries[0]['terms'] );
$this->assertEqualSets( $tt_ids, $tq->queries[0]['terms'] );
$this->assertSame( 'term_taxonomy_id', $tq->queries[0]['field'] );
}