Ensure products have different timestamps in tests.

This commit is contained in:
Mike Jolley 2016-12-06 10:46:48 +00:00
parent 84a930a607
commit 44ee5f7ed3
1 changed files with 2 additions and 1 deletions

View File

@ -38,8 +38,9 @@ class Products_API extends WC_REST_Unit_Test_Case {
*/
public function test_get_products() {
wp_set_current_user( $this->user );
WC_Helper_Product::create_simple_product();
WC_Helper_Product::create_external_product();
sleep( 1 ); // So both proudcts have different timestamps.
WC_Helper_Product::create_simple_product();
$response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/products' ) );
$products = $response->get_data();