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.
Merges [53388] to the 6.0 branch.
Fixes #55708.

git-svn-id: https://develop.svn.wordpress.org/branches/6.0@53389 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Tonya Mork 2022-05-10 21:40:16 +00:00
parent 7ae573f278
commit 4458cb317a

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',
@ -389,8 +389,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',
@ -401,7 +400,8 @@ END
'hierarchical' => 'threaded',
'number' => 5,
'paged' => 1,
)
),
build_comment_query_vars_from_block( $block )
);
}
}