Test should run without explicitly calling update for lookups.
Same as code in general, tests should also check whether the lookups are updated correctly without explicitly needing to call update on data stores.
This commit is contained in:
parent
deba4a354a
commit
256a7fd708
|
@ -71,8 +71,6 @@ class WC_Tests_API_Reports_Products_Stats extends WC_REST_Unit_Test_Case {
|
|||
$order->set_total( 97 ); // $25x4 products + $10 shipping - $20 discount + $7 tax.
|
||||
$order->save();
|
||||
|
||||
WC_Admin_Reports_Orders_Data_Store::update( $order );
|
||||
|
||||
$request = new WP_REST_Request( 'GET', $this->endpoint );
|
||||
$request->set_query_params(
|
||||
array(
|
||||
|
|
|
@ -42,7 +42,6 @@ class WC_Tests_Reports_Orders extends WC_Unit_Test_Case {
|
|||
);
|
||||
|
||||
$data_store = new WC_Admin_Reports_Orders_Data_Store();
|
||||
$data_store::update( $order );
|
||||
|
||||
$start_time = date( 'Y-m-d H:00:00', $order->get_date_created()->getOffsetTimestamp() );
|
||||
$end_time = date( 'Y-m-d H:59:59', $order->get_date_created()->getOffsetTimestamp() );
|
||||
|
|
|
@ -39,7 +39,6 @@ class WC_Admin_Tests_Reports_Revenue_Stats extends WC_Unit_Test_Case {
|
|||
|
||||
// /reports/revenue/stats is mapped to Orders_Data_Store.
|
||||
$data_store = new WC_Admin_Reports_Orders_Data_Store();
|
||||
$data_store::update( $order );
|
||||
|
||||
$start_time = date( 'Y-m-d H:00:00', $order->get_date_created()->getOffsetTimestamp() );
|
||||
$end_time = date( 'Y-m-d H:59:59', $order->get_date_created()->getOffsetTimestamp() );
|
||||
|
|
Loading…
Reference in New Issue