From 9c469a9f600732ac3475f20f23eb42e84db780b0 Mon Sep 17 00:00:00 2001 From: Jeff Stieler Date: Mon, 29 Jul 2019 16:44:09 -0600 Subject: [PATCH] Fix tests. --- .../woocommerce-admin/bin/generate-feature-config.php | 10 ++++++---- .../tests/api/reports-stock-stats.php | 8 ++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/plugins/woocommerce-admin/bin/generate-feature-config.php b/plugins/woocommerce-admin/bin/generate-feature-config.php index 0fbe969a755..4dd23a67965 100644 --- a/plugins/woocommerce-admin/bin/generate-feature-config.php +++ b/plugins/woocommerce-admin/bin/generate-feature-config.php @@ -23,12 +23,14 @@ if ( 'core' !== $phase ) { $write = "features as $feature => $bool ) { - $write .= "\t\t'{$feature}' => " . ( $bool ? 'true' : 'false' ) . ",\n"; + $write .= "\t\t\t'{$feature}' => " . ( $bool ? 'true' : 'false' ) . ",\n"; } - $write .= "\t);\n"; + $write .= "\t\t);\n"; + $write .= "\t}\n"; $write .= "}\n"; $config_file = fopen( 'includes/feature-config.php', 'w' ); diff --git a/plugins/woocommerce-admin/tests/api/reports-stock-stats.php b/plugins/woocommerce-admin/tests/api/reports-stock-stats.php index a4e0e95d54e..a670839c2ae 100644 --- a/plugins/woocommerce-admin/tests/api/reports-stock-stats.php +++ b/plugins/woocommerce-admin/tests/api/reports-stock-stats.php @@ -94,6 +94,14 @@ class WC_Tests_API_Reports_Stock_Stats extends WC_REST_Unit_Test_Case { $backorder_stock->set_stock_status( 'onbackorder' ); $backorder_stock->save(); + // Clear caches + delete_transient( 'wc_admin_stock_count_lowstock' ); + delete_transient( 'wc_admin_stock_count_outofstock' ); + delete_transient( 'wc_admin_stock_count_onbackorder' ); + delete_transient( 'wc_admin_stock_count_lowstock' ); + delete_transient( 'wc_admin_stock_count_instock' ); + delete_transient( 'wc_admin_product_count' ); + $request = new WP_REST_Request( 'GET', $this->endpoint ); $response = $this->server->dispatch( $request ); $reports = $response->get_data();