function UserImportWebTestCase::tearDown in User Import 8
Same name and namespace in other branches
- 6.4 user_import.test \UserImportWebTestCase::tearDown()
- 6.2 user_import.test \UserImportWebTestCase::tearDown()
- 7.3 user_import.test \UserImportWebTestCase::tearDown()
- 7 user_import.test \UserImportWebTestCase::tearDown()
- 7.2 user_import.test \UserImportWebTestCase::tearDown()
SimpleTest core method: code run after each and every test method.
File
- ./
user_import.test, line 109
Class
- UserImportWebTestCase
- User Import module base test class.
Code
function tearDown() {
// delete accounts of users imported
$users_email = $this
->usersList();
foreach ($users_email as $mail) {
$account = user_load_by_mail($mail);
if (!empty($account)) {
user_delete($account->uid);
}
}
// delete the import
$import_id = $this
->importID();
$this
->assertTrue(!empty($import_id), t('Import ID: !id', array(
'!id' => $import_id,
)));
_user_import_settings_deletion($import_id);
// Always call the tearDown() function from the parent class.
parent::tearDown();
}