Packages and products countries test
This commit is contained in:
@@ -15,6 +15,8 @@ class Wiaas_Unit_Test_Case extends WP_UnitTestCase {
|
||||
wiaas_db_update_setup_gravity();
|
||||
|
||||
wiaas_db_update_enable_orders_access_management();
|
||||
|
||||
Wiaas_Countries::register_product_countries_taxonomy();
|
||||
|
||||
define('WP_TEST_IN_PROGRESS',true);
|
||||
}
|
||||
@@ -22,4 +24,30 @@ class Wiaas_Unit_Test_Case extends WP_UnitTestCase {
|
||||
function tearDown() {
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
function insertNewProduct() {
|
||||
$post_id = wp_insert_post(array(
|
||||
'post_type' => 'product',
|
||||
'post_status' => 'publish',
|
||||
'post_name' => 'product',
|
||||
'post_title' => 'Product',
|
||||
'post_content' => 'Product',
|
||||
'post_excerpt' => 'Product'
|
||||
), true);
|
||||
|
||||
return new WC_Product_Simple($post_id);
|
||||
}
|
||||
|
||||
function insertNewPackage() {
|
||||
$post_id = wp_insert_post(array(
|
||||
'post_type' => 'product',
|
||||
'post_status' => 'publish',
|
||||
'post_name' => 'product',
|
||||
'post_title' => 'Package',
|
||||
'post_content' => 'Package',
|
||||
'post_excerpt' => 'Package'
|
||||
), true);
|
||||
|
||||
return new WC_Product_Bundle($post_id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user