woocommerce/plugins/woocommerce-blocks/tests/php/StoreApi/Routes/CartExtensions.php

32 lines
648 B
PHP

<?php
/**
* Cart extensions route tests.
*/
namespace Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes;
use Automattic\WooCommerce\Blocks\Tests\StoreApi\Routes\ControllerTestCase;
/**
* Cart Controller Tests.
*/
class CartExtensions extends ControllerTestCase {
/**
* Test getting cart with invalid namespace.
*/
public function test_post() {
$request = new \WP_REST_Request( 'POST', '/wc/store/v1/cart/extensions' );
$request->set_header( 'Nonce', wp_create_nonce( 'wc_store_api' ) );
$request->set_body_params(
array(
'namespace' => 'test-plugin',
)
);
$this->assertAPIResponse(
$request,
400
);
}
}