mirror of
https://github.com/wp-graphql/wp-graphql-woocommerce.git
synced 2026-08-14 12:53:44 +02:00
fix: Order status filter incorrectly uses single value (#999)
* fix: Order status filter incorrectly uses single value when statuses is the only filter arg The condition `1 === count($where_args)` checked the total number of filter args instead of `1 === count($where_args['statuses'])`, causing multi-status queries to only return results for the first status when no other filters were provided. Closes #968 * fix: Upgrade phpcov to v9 for newer coverage file format The Docker test environment produces .cov files in the php-code-coverage v10+ format (PHP file wrapper around serialized data). phpcov v8 only supports raw serialized data and silently produces empty coverage.
This commit is contained in:
@@ -120,6 +120,17 @@ class OrderConnectionFiltersTest extends \Tests\WPGraphQL\WooCommerce\TestCase\W
|
||||
];
|
||||
|
||||
$this->assertQuerySuccessful( $response, $expected );
|
||||
|
||||
// Filter by multiple statuses as the only filter arg.
|
||||
$variables = [ 'statuses' => [ 'PENDING', 'PROCESSING' ] ];
|
||||
$response = $this->graphql( compact( 'query', 'variables' ) );
|
||||
$expected = [
|
||||
$this->expectedField( 'orders.nodes.#.databaseId', $pending_id ),
|
||||
$this->expectedField( 'orders.nodes.#.databaseId', $processing_id ),
|
||||
$this->not()->expectedField( 'orders.nodes.#.databaseId', $completed_id ),
|
||||
];
|
||||
|
||||
$this->assertQuerySuccessful( $response, $expected );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user