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:
Geoff Taylor
2026-03-26 22:45:38 -04:00
committed by GitHub
parent 19c9fa31c0
commit cfd5115498
3 changed files with 14 additions and 6 deletions
@@ -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 );
}
/**