Ensure products have different timestamps in tests.
This commit is contained in:
parent
84a930a607
commit
44ee5f7ed3
|
@ -38,8 +38,9 @@ class Products_API extends WC_REST_Unit_Test_Case {
|
||||||
*/
|
*/
|
||||||
public function test_get_products() {
|
public function test_get_products() {
|
||||||
wp_set_current_user( $this->user );
|
wp_set_current_user( $this->user );
|
||||||
WC_Helper_Product::create_simple_product();
|
|
||||||
WC_Helper_Product::create_external_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' ) );
|
$response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v1/products' ) );
|
||||||
$products = $response->get_data();
|
$products = $response->get_data();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue