You are here

function UserImportWebTestCase::checkAccountsExist in User Import 7.2

Same name and namespace in other branches
  1. 8 user_import.test \UserImportWebTestCase::checkAccountsExist()
  2. 6.4 user_import.test \UserImportWebTestCase::checkAccountsExist()
  3. 6.2 user_import.test \UserImportWebTestCase::checkAccountsExist()
  4. 7.3 user_import.test \UserImportWebTestCase::checkAccountsExist()
  5. 7 user_import.test \UserImportWebTestCase::checkAccountsExist()
1 call to UserImportWebTestCase::checkAccountsExist()
UserImportBasicsTestCase::testCreateImport in ./user_import.test
User with right permissions creates import (with new settings)

File

./user_import.test, line 29

Class

UserImportWebTestCase
User Import module base test class.

Code

function checkAccountsExist($list_failures = FALSE) {
  $failures_list = '';
  $users_email = $this
    ->usersList();
  $failed = array();
  foreach ($users_email as $mail) {
    $user = user_load_by_mail($mail);
    if (empty($user)) {
      $failed[] = $mail;
    }
  }
  if (!empty($failed) && $list_failures) {
    $failures_list = t('. Failed accounts: %failures', array(
      '%failures' => implode(', ', $failed),
    ));
  }
  $this
    ->assertTrue(empty($failed), t('Accounts created for users imported') . $failures_list);
}