Added unit tests for templates

This commit is contained in:
Nedim Uka
2018-10-01 17:03:24 +02:00
parent f1c99c28ae
commit 4c760b12c3
3 changed files with 77 additions and 1 deletions

View File

@@ -88,6 +88,21 @@ class Wiaas_Unit_Test_Case extends WP_UnitTestCase {
$package->sync(true);
}
function create_new_wiaas_template() {
$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_Template($post_id);
}
function create_new_customer($login = 'customer_test', $organization_name = 'test-customer-organization') {
$customer_id = wp_insert_user(array(
'user_login' => $login,