From c70e76772cd2fe8a226e02071b30583bff4000dc Mon Sep 17 00:00:00 2001 From: Tonya Mork Date: Tue, 10 May 2022 21:28:18 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/blocks/renderCommentTemplate.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/tests/blocks/renderCommentTemplate.php b/tests/phpunit/tests/blocks/renderCommentTemplate.php index 49769ee6e0..f5b78ca92a 100644 --- a/tests/phpunit/tests/blocks/renderCommentTemplate.php +++ b/tests/phpunit/tests/blocks/renderCommentTemplate.php @@ -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 ) ); }