Handle tear down for unit tests
This commit is contained in:
@@ -20,7 +20,7 @@ class Wiaas_User_Organization_Test extends Wiaas_Unit_Test_Case {
|
||||
$this->user_id = wp_create_user('test', 'test', 'test@mail.com');
|
||||
$this->user_organization_name = 'test_organization';
|
||||
|
||||
$this->user_department_name = 'test-department';
|
||||
$this->user_department_name = 'test_department';
|
||||
|
||||
# create organization
|
||||
$this->user_organization_id = wp_insert_term(
|
||||
@@ -44,6 +44,21 @@ class Wiaas_User_Organization_Test extends Wiaas_Unit_Test_Case {
|
||||
[$this->user_organization_name]);
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
parent::tearDown();
|
||||
|
||||
wp_set_current_user(1);
|
||||
|
||||
wp_delete_user($this->user_id);
|
||||
|
||||
wp_delete_term(
|
||||
$this->user_organization_id,
|
||||
Wiaas_User_Organization::TAXONOMY_NAME);
|
||||
wp_delete_term(
|
||||
$this->user_department_id,
|
||||
Wiaas_User_Organization::TAXONOMY_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Wiaas_User_Organization::get_user_organization()
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user