Invoke queue test helper in new Order Stats and Products Report tests.

This commit is contained in:
Jeff Stieler 2019-02-04 11:46:46 -07:00
parent bebe1bdead
commit f938dd5708
2 changed files with 6 additions and 2 deletions

View File

@ -178,8 +178,8 @@ class WC_Tests_Reports_Orders_Stats extends WC_Unit_Test_Case {
$order->set_shipping_total( 0 );
$order->set_cart_tax( 0 );
$order->save();
// Wait one second to avoid potentially ambiguous new/returning customer.
sleep( 1 );
WC_Helper_Queue::run_all_pending();
}
$data_store = new WC_Admin_Reports_Orders_Stats_Data_Store();
@ -3330,6 +3330,8 @@ class WC_Tests_Reports_Orders_Stats extends WC_Unit_Test_Case {
$order_2->calculate_totals();
$order_2->save();
WC_Helper_Queue::run_all_pending();
$data_store = new WC_Admin_Reports_Orders_Stats_Data_Store();
// Tests for before & after set to current hour.

View File

@ -296,6 +296,8 @@ class WC_Tests_Reports_Products extends WC_Unit_Test_Case {
break;
}
WC_Helper_Queue::run_all_pending();
$data_store = new WC_Admin_Reports_Products_Data_Store();
$start_time = date( 'Y-m-d H:00:00', $order->get_date_created()->getOffsetTimestamp() );
$end_time = date( 'Y-m-d H:00:00', $order->get_date_created()->getOffsetTimestamp() + HOUR_IN_SECONDS );