Fixed non existing product on Products_API::test_get_products_without_permission

This commit is contained in:
Claudio Sanches 2017-11-16 16:59:21 -02:00
parent a899b53b57
commit 876f67a5a9
1 changed files with 3 additions and 0 deletions

View File

@ -69,6 +69,9 @@ class Products_API extends WC_REST_Unit_Test_Case {
$response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/products' ) );
$this->assertEquals( 401, $response->get_status() );
// Remove product.
wp_set_current_user( $this->user );
$response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/products' ) );
$products = $response->get_data();
$product = wc_get_product( $products[0]['id'] );
$product->delete( true );