Files
old-new-wiaas/backend/app/plugins/wiaas/tests/wiaas-unit-test-case.php

53 lines
1.2 KiB
PHP
Raw Normal View History

2018-08-06 17:36:57 +02:00
<?php
class Wiaas_Unit_Test_Case extends WP_UnitTestCase {
/**
* Executes any db migrations that are done to
* `wp_options` table since it is deleted on every execution
*/
function setUp() {
parent::setUp();
# Setup Gravity info since options table is deleted after each test
gf_upgrade()->install();
wiaas_db_update_setup_gravity();
2018-08-23 07:19:13 +02:00
wiaas_db_update_enable_orders_access_management();
2018-09-18 13:13:48 +02:00
Wiaas_Countries::register_product_countries_taxonomy();
2018-08-23 07:19:13 +02:00
define('WP_TEST_IN_PROGRESS',true);
2018-08-06 17:36:57 +02:00
}
2018-08-14 12:12:54 +02:00
function tearDown() {
parent::tearDown();
}
2018-09-18 13:13:48 +02:00
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);
}
2018-08-06 17:36:57 +02:00
}