Skip to content

Commit

Permalink
Fix argument order in assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
DAreRodz committed Apr 11, 2022
1 parent 269aef2 commit 537d272
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/phpunit/tests/block-library/commentTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ function test_build_comment_query_vars_from_block_with_context() {
);

$this->assertEquals(
build_comment_query_vars_from_block( $block ),
array(
'orderby' => 'comment_date_gmt',
'order' => 'ASC',
Expand All @@ -73,7 +72,8 @@ function test_build_comment_query_vars_from_block_with_context() {
'hierarchical' => 'threaded',
'number' => 5,
'paged' => 1,
)
),
build_comment_query_vars_from_block( $block )
);
}

Expand All @@ -85,7 +85,6 @@ function test_build_comment_query_vars_from_block_no_context() {
$block = new WP_Block( $parsed_blocks[0] );

$this->assertEquals(
build_comment_query_vars_from_block( $block ),
array(
'orderby' => 'comment_date_gmt',
'order' => 'ASC',
Expand All @@ -95,7 +94,8 @@ function test_build_comment_query_vars_from_block_no_context() {
'hierarchical' => 'threaded',
'number' => 5,
'paged' => 1,
)
),
build_comment_query_vars_from_block( $block )
);
}

Expand All @@ -117,8 +117,8 @@ function test_rendering_comment_template() {
// Here we use the function prefixed with 'gutenberg_*' because it's added
// in the build step.
$this->assertEquals(
render_block_core_comment_template( null, null, $block ),
'<ol ><li><div class="wp-block-comment-author-name">Test</div><div class="wp-block-comment-content">Hello world</div></li></ol>'
'<ol ><li><div class="wp-block-comment-author-name">Test</div><div class="wp-block-comment-content">Hello world</div></li></ol>',
render_block_core_comment_template( null, null, $block )
);
}

Expand Down Expand Up @@ -164,8 +164,8 @@ function test_rendering_comment_template_nested() {
);

$this->assertEquals(
render_block_core_comment_template( null, null, $block ),
'<ol ><li><div class="wp-block-comment-author-name">Test</div><div class="wp-block-comment-content">Hello world</div><ol><li><div class="wp-block-comment-author-name">Test</div><div class="wp-block-comment-content">Hello world</div><ol><li><div class="wp-block-comment-author-name">Test</div><div class="wp-block-comment-content">Hello world</div></li></ol></li></ol></li></ol>'
'<ol ><li><div class="wp-block-comment-author-name">Test</div><div class="wp-block-comment-content">Hello world</div><ol><li><div class="wp-block-comment-author-name">Test</div><div class="wp-block-comment-content">Hello world</div><ol><li><div class="wp-block-comment-author-name">Test</div><div class="wp-block-comment-content">Hello world</div></li></ol></li></ol></li></ol>',
render_block_core_comment_template( null, null, $block )
);
}
/**
Expand Down Expand Up @@ -200,7 +200,7 @@ function test_build_comment_query_vars_from_block_sets_cpage_var() {
)
);
$actual = build_comment_query_vars_from_block( $block );
$this->assertEquals( $actual['paged'], $comment_query_max_num_pages );
$this->assertEquals( get_query_var( 'cpage' ), $comment_query_max_num_pages );
$this->assertEquals( $comment_query_max_num_pages, $actual['paged'] );
$this->assertEquals( $comment_query_max_num_pages, get_query_var( 'cpage' ) );
}
}

0 comments on commit 537d272

Please sign in to comment.