Corrected failing tests.

This commit is contained in:
Peter Fabian 2018-11-02 12:24:21 +01:00
parent 3c490a5ce6
commit a1f2c867f4
2 changed files with 42 additions and 28 deletions

View File

@ -67,16 +67,18 @@ class WC_Tests_Reports_Orders extends WC_Unit_Test_Case {
'date_end' => $end_time, 'date_end' => $end_time,
'date_end_gmt' => $end_time, 'date_end_gmt' => $end_time,
'subtotals' => array( 'subtotals' => array(
'gross_revenue' => 97, 'gross_revenue' => 97,
'net_revenue' => 80, 'net_revenue' => 80,
'coupons' => 20, 'coupons' => 20,
'shipping' => 10, 'shipping' => 10,
'taxes' => 7, 'taxes' => 7,
'refunds' => 0, 'refunds' => 0,
'orders_count' => 1, 'orders_count' => 1,
'num_items_sold' => 4, 'num_items_sold' => 4,
'avg_items_per_order' => 4, 'avg_items_per_order' => 4,
'avg_order_value' => 97, 'avg_order_value' => 97,
'num_returning_customers' => 0,
'num_new_customers' => 1,
), ),
), ),
), ),
@ -92,10 +94,15 @@ class WC_Tests_Reports_Orders extends WC_Unit_Test_Case {
$query = new WC_Admin_Reports_Orders_Stats_Query( $args ); $query = new WC_Admin_Reports_Orders_Stats_Query( $args );
$expected_stats = array( $expected_stats = array(
'totals' => array( 'totals' => array(
'net_revenue' => 80, 'net_revenue' => 80,
'avg_order_value' => 97, 'avg_order_value' => 97,
'orders_count' => 1, 'orders_count' => 1,
'avg_items_per_order' => 4, 'avg_items_per_order' => 4,
'num_items_sold' => 4,
'coupons' => 20,
'num_returning_customers' => 0,
'num_new_customers' => 1,
'products' => '1',
), ),
'intervals' => array( 'intervals' => array(
array( array(
@ -105,10 +112,14 @@ class WC_Tests_Reports_Orders extends WC_Unit_Test_Case {
'date_end' => $end_time, 'date_end' => $end_time,
'date_end_gmt' => $end_time, 'date_end_gmt' => $end_time,
'subtotals' => array( 'subtotals' => array(
'net_revenue' => 80, 'net_revenue' => 80,
'avg_order_value' => 97, 'avg_order_value' => 97,
'orders_count' => 1, 'orders_count' => 1,
'avg_items_per_order' => 4, 'avg_items_per_order' => 4,
'num_items_sold' => 4,
'coupons' => 20,
'num_returning_customers' => 0,
'num_new_customers' => 1,
), ),
), ),
), ),

View File

@ -70,16 +70,18 @@ class WC_Admin_Tests_Reports_Revenue_Stats extends WC_Unit_Test_Case {
'date_end' => $end_time, 'date_end' => $end_time,
'date_end_gmt' => $end_time, 'date_end_gmt' => $end_time,
'subtotals' => array( 'subtotals' => array(
'orders_count' => 1, 'orders_count' => 1,
'num_items_sold' => 4, 'num_items_sold' => 4,
'gross_revenue' => 97, 'gross_revenue' => 97,
'coupons' => 20, 'coupons' => 20,
'refunds' => 0, 'refunds' => 0,
'taxes' => 7, 'taxes' => 7,
'shipping' => 10, 'shipping' => 10,
'net_revenue' => 80, 'net_revenue' => 80,
'avg_items_per_order' => 4, 'avg_items_per_order' => 4,
'avg_order_value' => 97, 'avg_order_value' => 97,
'num_returning_customers' => 0,
'num_new_customers' => 1,
), ),
), ),
), ),
@ -102,6 +104,7 @@ class WC_Admin_Tests_Reports_Revenue_Stats extends WC_Unit_Test_Case {
'taxes' => 7, 'taxes' => 7,
'shipping' => 10, 'shipping' => 10,
'net_revenue' => 80, 'net_revenue' => 80,
'products' => '1',
), ),
'intervals' => array( 'intervals' => array(
array( array(