function UserImportTest::checkAccountsExist in User Import 5
Same name and namespace in other branches
- 8 tests/user_import.test \UserImportTest::checkAccountsExist()
1 call to UserImportTest::checkAccountsExist()
- UserImportBasics::testCreateImport in tests/
user_import_basics.test - * User with right permissions creates import (with new settings) * - test core functions
File
- tests/
user_import.test, line 53
Class
- UserImportTest
- Create Invoice node test for Invoices module.
Code
function checkAccountsExist($list_failures = FALSE) {
$users_email = $this
->usersList();
$failed = array();
foreach ($users_email as $mail) {
$user = user_load(array(
'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);
}