Add edge case test
This commit is contained in:
parent
489e67dbe1
commit
62064d56f8
|
@ -655,7 +655,7 @@ class WC_Order_Data_Store_CPT extends Abstract_WC_Order_Data_Store_CPT implement
|
|||
if ( isset( $query_vars['customer'] ) && '' !== $query_vars['customer'] && array() !== $query_vars['customer'] ) {
|
||||
$values = is_array( $query_vars['customer'] ) ? $query_vars['customer'] : array( $query_vars['customer'] );
|
||||
$customer_query = $this->get_orders_generate_customer_meta_query( $values );
|
||||
if ( is_wp_error( $customer_query) ) {
|
||||
if ( is_wp_error( $customer_query ) ) {
|
||||
$wp_query_args['errors'][] = $customer_query;
|
||||
} else {
|
||||
$wp_query_args['meta_query'][] = $customer_query;
|
||||
|
|
|
@ -657,6 +657,9 @@ class WC_Tests_Order_Functions extends WC_Unit_Test_Case {
|
|||
$orders = wc_get_orders( array( 'customer' => array( 'invalid' ) ) );
|
||||
$this->assertEmpty( $orders );
|
||||
|
||||
$orders = wc_get_orders( array( 'customer' => array( '' ) ) );
|
||||
$this->assertEmpty( $orders );
|
||||
|
||||
$orders = wc_get_orders( array( 'customer' => 'doesnt@exist.com' ) );
|
||||
$this->assertEmpty( $orders );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue