woocommerce / woocommerce-rest-api

This is the WooCommerce core REST API Package. It runs standalone as a feature plugin too.
70 stars 46 forks source link

Doing it wrong notices sent with WordPress 5.5 #224

Closed Chouby closed 4 years ago

Chouby commented 4 years ago

WooCommerce 4.3 WordPress 5.5-beta2

I am creating a simple order with phpunit:

$request = new WP_REST_Request( 'POST', '/wc/v3/orders' );
$request->set_body_params(
    array(
        'payment_method' => 'bacs',
        'line_items'     => array(
            array(
                'product_id' => $product->get_id(),
                'quantity'   => 2,
            ),
        ),
    )
);

$response = $this->server->dispatch( $request );

This raises 2 unexpected incorrect usage notice for rest_validate_value_from_schema and rest_sanitize_value_from_schema.

vedanshujain commented 4 years ago

This is now fixed since WC 4.3.3.