Removed filter unit tests
This commit is contained in:
parent
0410518f31
commit
8f38924fe0
|
@ -435,28 +435,6 @@ class Products_API extends WC_REST_Unit_Test_Case {
|
|||
}
|
||||
}
|
||||
|
||||
// Test filtering with filter[post_status]=publish
|
||||
$request = new WP_REST_Request( 'GET', '/wc/v2/products' );
|
||||
$request->set_param( 'filter', array( 'post_status' => 'publish' ) );
|
||||
$response = $this->server->dispatch( $request );
|
||||
$products = $response->get_data();
|
||||
|
||||
$this->assertEquals( 4, count( $products ) );
|
||||
foreach ( $products as $product ) {
|
||||
$this->assertEquals( 'publish', $product['status'] );
|
||||
}
|
||||
|
||||
// Test filtering with filter[post_status]=draft
|
||||
$request = new WP_REST_Request( 'GET', '/wc/v2/products' );
|
||||
$request->set_param( 'filter', array( 'post_status' => 'draft' ) );
|
||||
$response = $this->server->dispatch( $request );
|
||||
$products = $response->get_data();
|
||||
|
||||
$this->assertEquals( 4, count( $products ) );
|
||||
foreach ( $products as $product ) {
|
||||
$this->assertEquals( 'draft', $product['status'] );
|
||||
}
|
||||
|
||||
// Test filtering with status=publish
|
||||
$request = new WP_REST_Request( 'GET', '/wc/v2/products' );
|
||||
$request->set_param( 'status', 'publish' );
|
||||
|
@ -479,19 +457,6 @@ class Products_API extends WC_REST_Unit_Test_Case {
|
|||
$this->assertEquals( 'draft', $product['status'] );
|
||||
}
|
||||
|
||||
// Test filtering with status=draft and filter[post_status]=publish
|
||||
// filter[post_status]=publish should win
|
||||
$request = new WP_REST_Request( 'GET', '/wc/v2/products' );
|
||||
$request->set_param( 'status', 'draft' );
|
||||
$request->set_param( 'filter', array( 'post_status' => 'publish' ) );
|
||||
$response = $this->server->dispatch( $request );
|
||||
$products = $response->get_data();
|
||||
|
||||
$this->assertEquals( 4, count( $products ) );
|
||||
foreach ( $products as $product ) {
|
||||
$this->assertEquals( 'publish', $product['status'] );
|
||||
}
|
||||
|
||||
// Test filtering with no filters - which should return 'any' (all 8)
|
||||
$request = new WP_REST_Request( 'GET', '/wc/v2/products' );
|
||||
$response = $this->server->dispatch( $request );
|
||||
|
|
Loading…
Reference in New Issue