You are here

function UserImportTest::tearDown in User Import 8

Same name and namespace in other branches
  1. 5 tests/user_import.test \UserImportTest::tearDown()

SimpleTest core method: code run after each and every test method.

1 call to UserImportTest::tearDown()
UserImportNodeprofile::tearDown in tests/user_import_nodeprofile.test
SimpleTest core method: code run after each and every test method.
1 method overrides UserImportTest::tearDown()
UserImportNodeprofile::tearDown in tests/user_import_nodeprofile.test
SimpleTest core method: code run after each and every test method.

File

tests/user_import.test, line 133

Class

UserImportTest
Create Invoice node test for Invoices module.

Code

function tearDown() {

  // delete accounts of users imported
  $users_email = $this
    ->usersList();
  foreach ($users_email as $mail) {
    $account = user_load(array(
      'mail' => $mail,
    ));
    if (!empty($account)) {
      user_delete(array(), $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();
}