2018-09-20 14:20:04 +00:00
|
|
|
<?php
|
2018-12-12 18:58:26 +00:00
|
|
|
/**
|
|
|
|
* Helper code for wc-admin unit tests.
|
|
|
|
*
|
|
|
|
* @package WooCommerce\Tests\Framework\Helpers
|
|
|
|
*/
|
2018-09-20 14:20:04 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class WC_Helper_Reports.
|
|
|
|
*
|
|
|
|
* This helper class should ONLY be used for unit tests!.
|
|
|
|
*/
|
|
|
|
class WC_Helper_Reports {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Delete everything in the lookup tables.
|
|
|
|
*/
|
|
|
|
public static function reset_stats_dbs() {
|
|
|
|
global $wpdb;
|
2019-01-15 01:53:02 +00:00
|
|
|
$wpdb->query( "DELETE FROM $wpdb->prefix" . WC_Admin_Reports_Orders_Stats_Data_Store::TABLE_NAME ); // @codingStandardsIgnoreLine.
|
2018-09-20 14:20:04 +00:00
|
|
|
$wpdb->query( "DELETE FROM $wpdb->prefix" . WC_Admin_Reports_Products_Data_Store::TABLE_NAME ); // @codingStandardsIgnoreLine.
|
2018-12-10 18:34:55 +00:00
|
|
|
$wpdb->query( "DELETE FROM $wpdb->prefix" . WC_Admin_Reports_Coupons_Data_Store::TABLE_NAME ); // @codingStandardsIgnoreLine.
|
2018-12-20 22:35:30 +00:00
|
|
|
$wpdb->query( "DELETE FROM $wpdb->prefix" . WC_Admin_Reports_Customers_Data_Store::TABLE_NAME ); // @codingStandardsIgnoreLine.
|
2018-09-20 14:20:04 +00:00
|
|
|
}
|
|
|
|
}
|