Skip to content

Commit

Permalink
Build/Test Tools: Re-order assertion parameters query block tests.
Browse files Browse the repository at this point in the history
Corrects the order of the expected and actual values in several tests of the `build_query_vars_from_query_block()` function.

See #61530.


git-svn-id: https://develop.svn.wordpress.org/trunk@59116 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
peterwilsoncc committed Sep 30, 2024
1 parent b1db74a commit c1fe739
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/phpunit/tests/blocks/wpBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@ public function test_build_query_vars_from_query_block() {
$query = build_query_vars_from_query_block( $block, 1 );

$this->assertSame(
$query,
array(
'post_type' => 'page',
'order' => 'DESC',
Expand All @@ -459,7 +458,8 @@ public function test_build_query_vars_from_query_block() {
),
),
'post_parent__in' => array( 1, 2 ),
)
),
$query
);
}

Expand Down Expand Up @@ -603,14 +603,14 @@ public function test_build_query_vars_from_query_block_no_context() {
$query = build_query_vars_from_query_block( $block_no_context, 1 );

$this->assertSame(
$query,
array(
'post_type' => 'post',
'order' => 'DESC',
'orderby' => 'date',
'post__not_in' => array(),
'tax_query' => array(),
)
),
$query
);
}

Expand All @@ -635,7 +635,6 @@ public function test_build_query_vars_from_query_block_first_page() {
$query = build_query_vars_from_query_block( $block, 1 );

$this->assertSame(
$query,
array(
'post_type' => 'post',
'order' => 'DESC',
Expand All @@ -644,7 +643,8 @@ public function test_build_query_vars_from_query_block_first_page() {
'tax_query' => array(),
'offset' => 0,
'posts_per_page' => 2,
)
),
$query
);
}

Expand All @@ -668,7 +668,6 @@ public function test_build_query_vars_from_query_block_page_no_offset() {
$block = new WP_Block( $parsed_block, $context, $this->registry );
$query = build_query_vars_from_query_block( $block, 3 );
$this->assertSame(
$query,
array(
'post_type' => 'post',
'order' => 'DESC',
Expand All @@ -677,7 +676,8 @@ public function test_build_query_vars_from_query_block_page_no_offset() {
'tax_query' => array(),
'offset' => 10,
'posts_per_page' => 5,
)
),
$query
);
}

Expand All @@ -701,7 +701,6 @@ public function test_build_query_vars_from_query_block_page_with_offset() {
$block = new WP_Block( $parsed_block, $context, $this->registry );
$query = build_query_vars_from_query_block( $block, 3 );
$this->assertSame(
$query,
array(
'post_type' => 'post',
'order' => 'DESC',
Expand All @@ -710,7 +709,8 @@ public function test_build_query_vars_from_query_block_page_with_offset() {
'tax_query' => array(),
'offset' => 12,
'posts_per_page' => 5,
)
),
$query
);
}

Expand Down Expand Up @@ -745,14 +745,14 @@ static function ( $query, $block, $page ) {

$query = build_query_vars_from_query_block( $block, 1 );
$this->assertSame(
$query,
array(
'post_type' => 'book',
'order' => 'DESC',
'orderby' => 'title',
'post__not_in' => array(),
'tax_query' => array(),
)
),
$query
);
}

Expand Down

0 comments on commit c1fe739

Please sign in to comment.