Editor: Use stricter assertions in comment template tests.

Backport of the remaining Comment Template block tests from Gutenberg:

* `assertEquals()` replaced with `assertSameSetsWithIndex()`.
* assertion's argument order changed to ensure expected and then actual.

Follow-up to [53353], [53298], [53172], [53138].

Props bernhard-reiter.
Fixes #55708.

git-svn-id: https://develop.svn.wordpress.org/trunk@53388 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Tonya Mork 2022-05-10 21:28:18 +00:00
parent c25f79f21a
commit c70e76772c

View File

@ -66,7 +66,7 @@ class Tests_Blocks_RenderReusableCommentTemplate extends WP_UnitTestCase {
)
);
$this->assertEquals(
$this->assertSameSetsWithIndex(
array(
'orderby' => 'comment_date_gmt',
'order' => 'ASC',
@ -123,7 +123,7 @@ class Tests_Blocks_RenderReusableCommentTemplate extends WP_UnitTestCase {
$block = new WP_Block( $parsed_blocks[0] );
$this->assertEquals(
$this->assertSameSetsWithIndex(
array(
'orderby' => 'comment_date_gmt',
'order' => 'ASC',
@ -421,8 +421,7 @@ END
add_filter( 'wp_get_current_commenter', $commenter_filter );
$this->assertEquals(
build_comment_query_vars_from_block( $block ),
$this->assertSameSetsWithIndex(
array(
'orderby' => 'comment_date_gmt',
'order' => 'ASC',
@ -433,7 +432,8 @@ END
'hierarchical' => 'threaded',
'number' => 5,
'paged' => 1,
)
),
build_comment_query_vars_from_block( $block )
);
}