function UserImportWebTestCase::checkAccountsExist in User Import 6.2
Same name and namespace in other branches
- 8 user_import.test \UserImportWebTestCase::checkAccountsExist()
- 6.4 user_import.test \UserImportWebTestCase::checkAccountsExist()
- 7.3 user_import.test \UserImportWebTestCase::checkAccountsExist()
- 7 user_import.test \UserImportWebTestCase::checkAccountsExist()
- 7.2 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 33
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(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);
}