class LdapUserIntegrationTests in Lightweight Directory Access Protocol (LDAP) 7.2
Same name and namespace in other branches
- 8.2 ldap_user/tests/ldap_user.test \LdapUserIntegrationTests
Hierarchy
- class \DrupalTestCase
- class \DrupalWebTestCase
- class \LdapTestCase
- class \LdapUserIntegrationTests
- class \LdapTestCase
- class \DrupalWebTestCase
Expanded class hierarchy of LdapUserIntegrationTests
File
- ldap_user/
tests/ ldap_user.test, line 681
View source
class LdapUserIntegrationTests extends LdapTestCase {
/**
*
*/
public static function getInfo() {
return [
'name' => 'LDAP User Integration Tests',
'description' => 'Test provisioning and synching in real contexts such as account creation on logon, synching on user edit, etc.',
'group' => 'LDAP User',
];
}
/**
*
*/
public function __construct($test_id = NULL) {
parent::__construct($test_id);
}
public $module_name = 'ldap_user';
protected $ldap_test_data;
/**
* Create one or more server configurations in such as way
* that this setUp can be a prerequisite for ldap_authentication and ldap_authorization.
*/
public function setUp() {
parent::setUp([
'ldap_user',
'ldap_test',
]);
variable_set('ldap_simpletest', 2);
}
/**
*
*/
public function tearDown() {
parent::tearDown();
variable_del('ldap_help_watchdog_detail');
variable_del('ldap_simpletest');
}
/**
* Integration tests for provisioning to ldap.
*/
public function testProvisionToLdap() {
// Just to give warning if setup doesn't succeed. may want to take these out at some point.
$setup_success = module_exists('ldap_user') && module_exists('ldap_servers') && variable_get('ldap_simpletest', 2) > 0;
$this
->assertTrue($setup_success, ' ldap_user setup successful', $this
->testId("setup"));
foreach ([
'activedirectory1',
'openldap1',
] as $test_sid) {
$sids = [
$test_sid,
];
// This will create the proper ldap_user configuration from ldap_test/ldap_user.conf.inc.
$this
->prepTestData('hogwarts', $sids, 'provisionToLdap_' . $test_sid);
$ldap_user_conf = ldap_user_conf('default', TRUE);
// 9.B. Create and approve new user, populating first and last name.
$username = 'bhautdeser';
if ($user = user_load_by_name($username)) {
user_delete($user->uid);
}
$user_edit = [
'name' => $username,
'mail' => $username . '@hogwarts.org',
'pass' => user_password(),
'status' => 1,
];
$user_acct = new stdClass();
$user_acct->is_new = TRUE;
$user_acct->field_fname[LANGUAGE_NONE][0]['value'] = 'Bercilak';
$user_acct->field_lname[LANGUAGE_NONE][0]['value'] = 'Hautdesert';
$servers = ldap_servers_get_servers(NULL, NULL, FALSE, TRUE);
$desired_dn = "cn=bhautdeser,ou=people,dc=hogwarts,dc=edu";
$pre_entry = $servers[$test_sid]
->dnExists($desired_dn, 'ldap_entry');
$drupal_account = user_save($user_acct, $user_edit);
$ldap_entry_post = $servers[$test_sid]
->dnExists($desired_dn, 'ldap_entry');
$ldap_entry_success = $ldap_entry_post && $ldap_entry_post['cn'][0] == 'bhautdeser' && $ldap_entry_post['displayname'][0] == 'Bercilak Hautdesert' && $ldap_entry_post['sn'][0] == 'Hautdesert' && $ldap_entry_post['guid'][0] == '151' && $ldap_entry_post['provisionsource'][0] == 'drupal.hogwarts.edu';
$this
->assertTrue($ldap_entry_success, t("provision of ldap entry on user create succeeded for " . $username), $this
->testId("test for provision to ldap on drupal acct create"));
if (!$ldap_entry_success) {
debug('drupal_account');
debug($drupal_account);
debug("desired_dn={$desired_dn}, ldap_entry_post=");
debug($ldap_entry_post);
debug('ldap_user_conf');
debug($ldap_user_conf);
}
// Need to reset for simpletests.
ldap_user_ldap_provision_semaphore(NULL, NULL, NULL, TRUE);
// Change lastname and first name (in drupal) and save user to test ldapSynch event handler
// confirm that appropriate attributes were changed in ldap entry.
$ldap_entry_pre = $servers[$test_sid]
->dnExists($desired_dn, 'ldap_entry');
$user_acct_pre = user_load_by_name('bhautdeser');
$edit = [];
$edit['field_fname'][LANGUAGE_NONE][0]['value'] = 'Bredbeddle';
$edit['field_lname'][LANGUAGE_NONE][0]['value'] = 'Hautdesert';
$user_acct = user_save($user_acct, $edit);
$user_acct_post = user_load_by_name('bhautdeser');
// Clear cache.
$servers = ldap_servers_get_servers(NULL, NULL, FALSE, TRUE);
$ldap_entry_post = $servers[$test_sid]
->dnExists($desired_dn, 'ldap_entry');
$ldap_entry_success = $ldap_entry_post['givenname'][0] == 'Bredbeddle' && $ldap_entry_post['displayname'][0] == 'Bredbeddle Hautdesert' && $ldap_entry_post['sn'][0] == 'Hautdesert';
$this
->assertTrue($ldap_entry_success, t("synch to ldap entry on user save succeeded for " . $username), $this
->testId());
if (!$ldap_entry_success) {
debug("dn={$desired_dn}");
debug('drupal_account pre');
debug($user_acct_pre);
debug('drupal_account post');
debug($user_acct_post);
debug('ldap_entry_pre');
debug($ldap_entry_pre);
debug('ldap_entry_post');
debug($ldap_entry_post);
debug('ldap_user_conf');
debug($ldap_user_conf);
}
// Change username and first name (in drupal) and save user to test ldapSynch event handler
// confirm that appropriate attributes were changed in ldap entry.
$ldap_entry_pre = $servers[$test_sid]
->dnExists($desired_dn, 'ldap_entry');
$user_acct_pre = user_load_by_name('bhautdeser');
$edit = [];
$edit['field_fname'][LANGUAGE_NONE][0]['value'] = 'Bredbeddle';
$edit['field_lname'][LANGUAGE_NONE][0]['value'] = 'Hautdesert';
$user_acct = user_save($user_acct, $edit);
$user_acct_post = user_load_by_name('bhautdeser');
// Clear cache.
$servers = ldap_servers_get_servers(NULL, NULL, FALSE, TRUE);
$ldap_entry_post = $servers[$test_sid]
->dnExists($desired_dn, 'ldap_entry');
$ldap_entry_success = $ldap_entry_post['givenname'][0] == 'Bredbeddle' && $ldap_entry_post['displayname'][0] == 'Bredbeddle Hautdesert' && $ldap_entry_post['sn'][0] == 'Hautdesert';
$this
->assertTrue($ldap_entry_success, t("synch to ldap entry on user save succeeded for " . $username), $this
->testId());
if (!$ldap_entry_success) {
debug("dn={$desired_dn}");
debug('drupal_account pre');
debug($user_acct_pre);
debug('drupal_account post');
debug($user_acct_post);
debug('ldap_entry_pre');
debug($ldap_entry_pre);
debug('ldap_entry_post');
debug($ldap_entry_post);
debug('ldap_user_conf');
debug($ldap_user_conf);
}
}
/**
* provisionToLdapEmailVerification
* use case where a user self creates and confirms a drupal account and
* a corresponding ldap entry with password is created
*/
$password_tests = [
'[password.user-random]' => 'goodpwd',
'[password.random]' => 'random',
];
foreach ($password_tests as $password_token => $password_result) {
$test_id = "provisionToLdapEmailVerification {$password_token}, {$test_sid}";
// Need to reset for simpletests.
ldap_user_ldap_provision_semaphore(NULL, NULL, NULL, TRUE);
/**
* provisionToLdapEmailVerification setup
*/
// This will create the proper ldap_user configuration from ldap_test/ldap_user.conf.inc.
$this
->prepTestData('hogwarts', $sids, 'provisionToLdap_' . $test_sid);
$ldap_user_conf = ldap_user_conf('admin', TRUE);
// Turn off provisioning to drupal.
$ldap_user_conf->drupalAcctProvisionServer = 0;
$ldap_user_conf->ldapEntryProvisionServer = $test_sid;
$ldap_user_conf->ldapEntryProvisionTriggers = [
LDAP_USER_LDAP_ENTRY_PROV_ON_USER_UPDATE_CREATE,
LDAP_USER_LDAP_ENTRY_PROV_ON_AUTHENTICATE,
];
$ldap_user_conf->ldapUserSynchMappings[LDAP_USER_PROV_DIRECTION_TO_LDAP_ENTRY]['[password]'] = [
'sid' => $test_sid,
'ldap_attr' => '[password]',
'user_attr' => 'user_tokens',
'convert' => 0,
'user_tokens' => $password_token,
'config_module' => 'ldap_user',
'synch_module' => 'ldap_user',
'enabled' => 1,
'prov_events' => [
LDAP_USER_EVENT_CREATE_LDAP_ENTRY,
LDAP_USER_EVENT_SYNCH_TO_LDAP_ENTRY,
],
];
$ldap_user_conf
->save();
$ldap_user_conf = ldap_user_conf('default', TRUE);
variable_set('user_email_verification', TRUE);
// Or USER_REGISTER_ADMINISTRATORS_ONLY, USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL.
variable_set('user_register', USER_REGISTER_VISITORS);
// user_cancel_block_unpublish, user_cancel_reassign, user_cancel_delete.
variable_set('user_cancel_method', 'user_cancel_block');
$username = 'sstephens';
$this
->drupalLogout();
if ($sstephens = user_load_by_name($username)) {
user_delete($sstephens->uid);
}
/**
* provisionToLdapEmailVerification test
*/
// User register form.
$this
->drupalGet('user/register');
$edit = [
'name' => $username,
'mail' => $username . '@hogwarts.edu',
];
// This will create last and first name fields.
$this
->createTestUserFields();
$this
->drupalPost('user/register', $edit, t('Create new account'));
$sstephens = user_load_by_name($username);
// can't derive login url, must get it from outgoing email because timestamp in hash is not stored in user_mail_tokens()
$emails = $this
->drupalGetMails();
// Most recent email is the one of interest.
$email_body = $emails[count($emails) - 1]['body'];
$result = [];
preg_match_all('/(user\\/reset\\/.*)This link can only be/s', $email_body, $result, PREG_PATTERN_ORDER);
if (is_array($result) && count($result) === 2) {
$login_path = trim($result[1][0]);
// User login form.
$this
->drupalGet($login_path);
$sstephens = user_load_by_name($username);
$this
->drupalPost($login_path, [], t('Log in'));
$sstephens = user_load_by_name($username);
$edit = [
'mail' => $username . '@hogwarts.edu',
'pass[pass1]' => 'goodpwd',
'pass[pass2]' => 'goodpwd',
'field_fname[und][0][value]' => 'Samantha',
'field_lname[und][0][value]' => 'Stephens',
];
$this
->drupalPost(NULL, $edit, t('Save'));
$sstephens = user_load_by_name($username);
// Clear cache.
$servers = ldap_servers_get_servers(NULL, NULL, FALSE, TRUE);
$desired_dn = "cn={$username},ou=people,dc=hogwarts,dc=edu";
$ldap_entry_post = $servers[$test_sid]
->dnExists($desired_dn, 'ldap_entry');
$password_success = is_array($ldap_entry_post) && ($password_token == '[password.random]' && $ldap_entry_post['password'][0] && $ldap_entry_post['password'][0] != 'goodpwd' || $password_token == '[password.user-random]' && $ldap_entry_post['password'][0] == $password_result);
$ldap_entry_success = $password_success && $ldap_entry_post['cn'][0] == $username && $ldap_entry_post['displayname'][0] == 'Samantha Stephens' && $ldap_entry_post['provisionsource'][0] == 'drupal.hogwarts.edu' && $ldap_entry_post['sn'][0] == 'Stephens' && $ldap_entry_post['givenname'][0] == 'Samantha';
}
else {
$ldap_entry_success = FALSE;
}
$this
->assertTrue($ldap_entry_success, t("correct ldap entry created for " . $username), $this
->testId($test_id));
if (!$ldap_entry_success) {
debug("password_success={$password_success},password_token,password_result: {$password_token}, {$password_result}");
debug('ldap_user_conf');
debug($ldap_user_conf);
debug('ldap_entry_post');
debug($ldap_entry_post);
debug('user');
debug($sstephens);
}
/**
* @todo functional tests
*
* do a password reset of some sort
* try to add a drupal user that conflicts with an ldap user
* try a binary fields such as a user profile image
*/
}
// Test deletion of drupal entry on deletion of drupal user.
foreach ([
'activedirectory1',
'openldap1',
] as $test_sid) {
$test_id = $test_sid;
// 1. setup.
$sids = [
$test_sid,
];
// This will create the proper ldap_user configuration from ldap_test/ldap_user.conf.inc.
$this
->prepTestData('hogwarts', $sids, 'provisionToLdap_' . $test_sid);
$ldap_user_conf = ldap_user_conf('admin', TRUE);
if (!in_array(LDAP_USER_LDAP_ENTRY_DELETE_ON_USER_DELETE, $ldap_user_conf->ldapEntryProvisionTriggers)) {
$ldap_user_conf->ldapEntryProvisionTriggers[] = LDAP_USER_LDAP_ENTRY_DELETE_ON_USER_DELETE;
}
$ldap_user_conf->provisionsLdapEntriesFromDrupalUsers = TRUE;
$ldap_user_conf
->save();
$username = 'bhautdeser';
if ($user = user_load_by_name($username)) {
user_delete($user->uid);
}
$user_edit = [
'name' => $username,
'mail' => $username . '@hogwarts.org',
'pass' => user_password(),
'status' => 1,
];
$user_acct = new stdClass();
$user_acct->is_new = TRUE;
$user_acct->field_fname[LANGUAGE_NONE][0]['value'] = 'Bercilak';
$user_acct->field_lname[LANGUAGE_NONE][0]['value'] = 'Hautdesert';
$servers = ldap_servers_get_servers(NULL, NULL, FALSE, TRUE);
$desired_dn = "cn=bhautdeser,ou=people,dc=hogwarts,dc=edu";
$pre_entry = $servers[$test_sid]
->dnExists($desired_dn, 'ldap_entry');
$drupal_account = user_save($user_acct, $user_edit);
$ldap_entry_pre_delete = $servers[$test_sid]
->dnExists($desired_dn, 'ldap_entry');
$ldap_entry = $ldap_user_conf
->getProvisionRelatedLdapEntry($drupal_account);
// 2. test.
user_delete($drupal_account->uid);
$ldap_server = ldap_servers_get_servers($test_sid, 'all', TRUE, TRUE);
$ldap_entry_post_delete = $ldap_server
->dnExists($desired_dn, 'ldap_entry');
$success = !$ldap_entry_post_delete;
$this
->assertTrue($success, t("ldap entry removed for {$username} on drupal user delete with deletion enabled."), $this
->testId($test_id));
if (!$success) {
debug(" desired_dn={$desired_dn} test_sid={$test_sid}, ldap entry post:");
debug($ldap_entry_post_delete);
}
}
}
/**
* Test cron function for dealing with ldap associated users who no longer have
* ldap entries
* - fix search in fake server to deal with general or queries.
*
* Simpletest approach:
* - loop through all options for user_cancel
* ldap_user_orphan_email
* user_cancel_block, user_cancel_block_unpublish,
* user_cancel_reassign, user_cancel_delete
* - automatically generate 70 ldap users with cns hpotter1-hpotter300
* - create 75 corresponding drupal uses that are ldap identified
* - delete 10 of the ldap entries
* - run cron
* - test for drupal accounts being dealt with correctly and or email sent.
*/
public function testDrupalAccountsOrphaned() {
// TODO: Fix failing tests, excluding to make branch pass.
return;
// Just to give warning if setup doesn't succeed. may want to take these out at some point.
$setup_success = module_exists('ldap_user') && module_exists('ldap_servers') && variable_get('ldap_simpletest', 2) > 0;
$this
->assertTrue($setup_success, ' ldap_user setup successful', $this
->testId('orphaned entries tests'));
$sids = [
'activedirectory1',
];
$this
->prepTestData('hogwarts', $sids, 'provisionToDrupal', 'default');
$ldap_user_conf = ldap_user_conf('admin');
$drupal_form = $ldap_user_conf
->drupalForm();
$account_options = $drupal_form['basic_to_drupal']['orphanedDrupalAcctBehavior']['#options'];
$cn_to_account = [];
$ldap_server = ldap_servers_get_servers('activedirectory1', NULL, TRUE, TRUE);
foreach ($account_options as $account_option => $account_option_text) {
$sids = [
'activedirectory1',
];
$this
->prepTestData('hogwarts', $sids, 'provisionToDrupal', 'default');
$ldap_user_conf->orphanedDrupalAcctBehavior = $account_option;
$ldap_user_conf
->save();
$test_id = "ldap_user.orphans.{$account_option}";
$test_text = "Test of orphaned Drupal account option: {$account_option_text}";
$success = FALSE;
// Create 70 drupal accounts (clone0 to clone69) based on corresponding ldap entries.
$first_clone_username = 'clone0';
$last_clone_username = 'clone' . (LDAP_TEST_USER_ORPHAN_CLONE_COUNT - 1);
// 70.
for ($i = 0; $i < LDAP_TEST_USER_ORPHAN_CLONE_COUNT; $i++) {
$name = "clone" . $i;
$account = $this
->createLdapIdentifiedDrupalAccount($ldap_user_conf, $name, 'activedirectory1');
$cn_to_account[$name] = $account;
}
// Delete 10 ldap entries.
// @FIXME: Wrapper for broken test.
if (is_object($cn_to_account[$first_clone_username])) {
$clone_first_uid = $cn_to_account[$first_clone_username]->uid;
$clone_last_uid = $cn_to_account[$last_clone_username]->uid;
$clone_first = user_load($clone_first_uid, TRUE);
$clone_last = user_load($clone_last_uid, TRUE);
}
$delete = LDAP_TEST_USER_ORPHAN_CLONE_COUNT - LDAP_TEST_USER_ORPHAN_CLONE_REMOVE_COUNT;
for ($i = 0; $i < $delete; $i++) {
$name = "clone" . $i;
$account = $cn_to_account[$name];
// ?? is it possible the ldap delete hook is causing the drupal user to get populated with empty values?
$ldap_server
->delete($account->ldap_user_current_dn[LANGUAGE_NONE][0]['value']);
}
$clone_first = user_load($clone_first_uid, TRUE);
$clone_last = user_load($clone_last_uid, TRUE);
drupal_cron_run();
$clone_first = user_load($clone_first_uid, TRUE);
$clone_last = user_load($clone_last_uid, TRUE);
switch ($account_option) {
case 'ldap_user_orphan_do_not_check':
$test_uids = [];
// 70.
for ($i = 0; $i < LDAP_TEST_USER_ORPHAN_CLONE_COUNT; $i++) {
$name = "clone" . $i;
$test_uids[] = @$cn_to_account[$name]->uid;
}
$success = TRUE;
$accounts = user_load_multiple($test_uids);
foreach ($accounts as $uid => $account) {
if ($account->status != 1) {
$success = FALSE;
break;
}
}
if ($success) {
$success = $clone_last && $clone_last->status == 1;
}
break;
case 'ldap_user_orphan_email':
// Test is if email has 10 users and was sent.
$emails = $this
->drupalGetMails();
if (count($emails)) {
// Most recent email is the one of interest.
$email_body = $emails[count($emails) - 1]['body'];
$success = strpos($email_body, "The following {$delete} Drupal users") !== FALSE;
}
else {
$success = FALSE;
}
break;
case 'user_cancel_block':
case 'user_cancel_block_unpublish':
// Test is if clone0-clone9 have a status of 0
// and clone12,11... have a status of 1.
$test_uids = [];
// 70.
for ($i = 0; $i < $delete; $i++) {
$name = "clone" . $i;
$test_uids[] = @$cn_to_account[$name]->uid;
}
$success = TRUE;
$accounts = user_load_multiple($test_uids);
foreach ($accounts as $uid => $account) {
if ($account->status != 0) {
$success = FALSE;
break;
}
}
if ($success) {
$clone_last = user_load($clone_last_uid, TRUE);
$success = $clone_last && $clone_last->status == 1;
}
break;
case 'user_cancel_reassign':
case 'user_cancel_delete':
// Test is if clone0-clone9 are deleted
// and clone12,11... have a status of 1.
$test_uids = [];
// 70.
for ($i = 0; $i < $delete; $i++) {
$name = "clone" . $i;
$test_uids[] = @$cn_to_account[$name]->uid;
}
$success = TRUE;
$accounts = user_load_multiple($test_uids);
$success = count($accounts) == LDAP_TEST_USER_ORPHAN_CLONE_COUNT;
if ($success) {
$clone_last = user_load($clone_last_uid, TRUE);
$success = $clone_last && $clone_last->status == 1;
}
break;
}
$this
->assertTrue($success, $test_id, $test_text);
// Remove all drupal users except 1 for next test.
foreach ($cn_to_account as $cn => $account) {
@user_delete($account->uid);
}
}
}
/**
*
*/
public function createLdapIdentifiedDrupalAccount($ldap_user_conf, $name, $sid) {
$account = NULL;
$user_edit = [
'name' => $name,
];
$user = $ldap_user_conf
->provisionDrupalAccount($account, $user_edit, NULL, TRUE);
return user_load($user->uid, TRUE);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DrupalTestCase:: |
protected | property | Assertions thrown in that test case. | |
DrupalTestCase:: |
protected | property | The database prefix of this test run. | |
DrupalTestCase:: |
protected | property | The original file directory, before it was changed for testing purposes. | |
DrupalTestCase:: |
public | property | Current results of this test case. | |
DrupalTestCase:: |
protected | property | Flag to indicate whether the test has been set up. | |
DrupalTestCase:: |
protected | property | ||
DrupalTestCase:: |
protected | property | ||
DrupalTestCase:: |
protected | property | This class is skipped when looking for the source of an assertion. | |
DrupalTestCase:: |
protected | property | The test run ID. | |
DrupalTestCase:: |
protected | property | Time limit for the test. | |
DrupalTestCase:: |
public | property | Whether to cache the installation part of the setUp() method. | |
DrupalTestCase:: |
public | property | Whether to cache the modules installation part of the setUp() method. | |
DrupalTestCase:: |
protected | property | URL to the verbose output file directory. | |
DrupalTestCase:: |
protected | function | Internal helper: stores the assert. | |
DrupalTestCase:: |
protected | function | Check to see if two values are equal. | |
DrupalTestCase:: |
protected | function | Check to see if a value is false (an empty string, 0, NULL, or FALSE). | |
DrupalTestCase:: |
protected | function | Check to see if two values are identical. | |
DrupalTestCase:: |
protected | function | Check to see if two values are not equal. | |
DrupalTestCase:: |
protected | function | Check to see if two values are not identical. | |
DrupalTestCase:: |
protected | function | Check to see if a value is not NULL. | |
DrupalTestCase:: |
protected | function | Check to see if a value is NULL. | |
DrupalTestCase:: |
protected | function | Check to see if a value is not false (not an empty string, 0, NULL, or FALSE). | |
DrupalTestCase:: |
public static | function | Delete an assertion record by message ID. | |
DrupalTestCase:: |
protected | function | Fire an error assertion. | 1 |
DrupalTestCase:: |
public | function | Handle errors during test runs. | 1 |
DrupalTestCase:: |
protected | function | Handle exceptions. | |
DrupalTestCase:: |
protected | function | Fire an assertion that is always negative. | |
DrupalTestCase:: |
public static | function | Converts a list of possible parameters into a stack of permutations. | |
DrupalTestCase:: |
protected | function | Cycles through backtrace until the first non-assertion method is found. | |
DrupalTestCase:: |
public static | function | Returns the database connection to the site running Simpletest. | |
DrupalTestCase:: |
public static | function | Store an assertion from outside the testing context. | |
DrupalTestCase:: |
protected | function | Fire an assertion that is always positive. | |
DrupalTestCase:: |
public static | function | Generates a random string containing letters and numbers. | |
DrupalTestCase:: |
public static | function | Generates a random string of ASCII characters of codes 32 to 126. | |
DrupalTestCase:: |
public | function | Run all tests in this class. | |
DrupalTestCase:: |
protected | function | Logs a verbose message in a text file. | |
DrupalWebTestCase:: |
protected | property | Additional cURL options. | |
DrupalWebTestCase:: |
protected | property | The content of the page currently loaded in the internal browser. | |
DrupalWebTestCase:: |
protected | property | The current cookie file used by cURL. | |
DrupalWebTestCase:: |
protected | property | The cookies of the page currently loaded in the internal browser. | |
DrupalWebTestCase:: |
protected | property | The handle of the current cURL connection. | |
DrupalWebTestCase:: |
protected | property | The value of the Drupal.settings JavaScript variable for the page currently loaded in the internal browser. | |
DrupalWebTestCase:: |
protected | property | The parsed version of the page. | |
DrupalWebTestCase:: |
protected | property | Whether the files were copied to the test files directory. | |
DrupalWebTestCase:: |
protected | property | The headers of the page currently loaded in the internal browser. | |
DrupalWebTestCase:: |
protected | property | HTTP authentication credentials (<username>:<password>). | |
DrupalWebTestCase:: |
protected | property | HTTP authentication method | |
DrupalWebTestCase:: |
protected | property | The current user logged in using the internal browser. | |
DrupalWebTestCase:: |
protected | property | The original shutdown handlers array, before it was cleaned for testing purposes. | |
DrupalWebTestCase:: |
protected | property | The original user, before it was changed to a clean uid = 1 for testing purposes. | |
DrupalWebTestCase:: |
protected | property | The content of the page currently loaded in the internal browser (plain text version). | |
DrupalWebTestCase:: |
protected | property | The profile to install as a basis for testing. | 20 |
DrupalWebTestCase:: |
protected | property | The number of redirects followed during the handling of a request. | |
DrupalWebTestCase:: |
protected | property | The current session ID, if available. | |
DrupalWebTestCase:: |
protected | property | The current session name, if available. | |
DrupalWebTestCase:: |
protected | property | The URL currently loaded in the internal browser. | |
DrupalWebTestCase:: |
protected | function | Asserts that a field exists with the given name or ID. | |
DrupalWebTestCase:: |
protected | function | Asserts that a field exists in the current page with the given ID and value. | |
DrupalWebTestCase:: |
protected | function | Asserts that a field exists in the current page with the given name and value. | |
DrupalWebTestCase:: |
protected | function | Asserts that a field exists in the current page by the given XPath. | |
DrupalWebTestCase:: |
protected | function | Asserts that a checkbox field in the current page is checked. | |
DrupalWebTestCase:: |
protected | function | Pass if a link with the specified label is found, and optional with the specified index. | |
DrupalWebTestCase:: |
protected | function | Pass if a link containing a given href (part) is found. | |
DrupalWebTestCase:: |
protected | function | Asserts that the most recently sent e-mail message has the given value. | |
DrupalWebTestCase:: |
protected | function | Asserts that the most recently sent e-mail message has the pattern in it. | |
DrupalWebTestCase:: |
protected | function | Asserts that the most recently sent e-mail message has the string in it. | |
DrupalWebTestCase:: |
protected | function | Asserts that each HTML ID is used for just a single element. | |
DrupalWebTestCase:: |
protected | function | Asserts that a field does not exist with the given name or ID. | |
DrupalWebTestCase:: |
protected | function | Asserts that a field does not exist with the given ID and value. | |
DrupalWebTestCase:: |
protected | function | Asserts that a field does not exist with the given name and value. | |
DrupalWebTestCase:: |
protected | function | Asserts that a field doesn't exist or its value doesn't match, by XPath. | |
DrupalWebTestCase:: |
protected | function | Asserts that a checkbox field in the current page is not checked. | |
DrupalWebTestCase:: |
protected | function | Pass if a link with the specified label is not found. | |
DrupalWebTestCase:: |
protected | function | Pass if a link containing a given href (part) is not found. | |
DrupalWebTestCase:: |
protected | function | Asserts that a select option in the current page is not checked. | |
DrupalWebTestCase:: |
protected | function | Will trigger a pass if the perl regex pattern is not present in raw content. | |
DrupalWebTestCase:: |
protected | function | Pass if the raw text is NOT found on the loaded page, fail otherwise. Raw text refers to the raw HTML that the page generated. | |
DrupalWebTestCase:: |
protected | function | Asserts the page did not return the specified response code. | |
DrupalWebTestCase:: |
protected | function | Pass if the text is NOT found on the text version of the page. The text version is the equivalent of what a user would see when viewing through a web browser. In other words the HTML has been filtered out of the contents. | |
DrupalWebTestCase:: |
protected | function | Pass if the page title is not the given string. | |
DrupalWebTestCase:: |
protected | function | Pass if the text is found MORE THAN ONCE on the text version of the page. | |
DrupalWebTestCase:: |
protected | function | Asserts that a select option in the current page is checked. | |
DrupalWebTestCase:: |
protected | function | Will trigger a pass if the Perl regex pattern is found in the raw content. | |
DrupalWebTestCase:: |
protected | function | Pass if the raw text IS found on the loaded page, fail otherwise. Raw text refers to the raw HTML that the page generated. | |
DrupalWebTestCase:: |
protected | function | Asserts the page responds with the specified response code. | |
DrupalWebTestCase:: |
protected | function | Pass if the text IS found on the text version of the page. The text version is the equivalent of what a user would see when viewing through a web browser. In other words the HTML has been filtered out of the contents. | |
DrupalWebTestCase:: |
protected | function | Helper for assertText and assertNoText. | |
DrupalWebTestCase:: |
protected | function | Asserts themed output. | |
DrupalWebTestCase:: |
protected | function | Pass if the page title is the given string. | |
DrupalWebTestCase:: |
protected | function | Pass if the text is found ONLY ONCE on the text version of the page. | |
DrupalWebTestCase:: |
protected | function | Helper for assertUniqueText and assertNoUniqueText. | |
DrupalWebTestCase:: |
protected | function | Pass if the internal browser's URL matches the given path. | |
DrupalWebTestCase:: |
protected | function | Builds an XPath query. | |
DrupalWebTestCase:: |
protected | function | Changes the database connection to the prefixed one. | |
DrupalWebTestCase:: |
protected | function | Check for meta refresh tag and if found call drupalGet() recursively. This function looks for the http-equiv attribute to be set to "Refresh" and is case-sensitive. | |
DrupalWebTestCase:: |
protected | function | Check to make sure that the array of permissions are valid. | |
DrupalWebTestCase:: |
protected | function | Follows a link by name. | |
DrupalWebTestCase:: |
protected | function | Helper function: construct an XPath for the given set of attributes and value. | |
DrupalWebTestCase:: |
protected | function | Copy the setup cache from/to another table and files directory. | |
DrupalWebTestCase:: |
protected | function | Runs cron in the Drupal installed by Simpletest. | |
DrupalWebTestCase:: |
protected | function | Close the cURL handler and unset the handler. | |
DrupalWebTestCase:: |
protected | function | Initializes and executes a cURL request. | |
DrupalWebTestCase:: |
protected | function | Reads headers and registers errors received from the tested site. | |
DrupalWebTestCase:: |
protected | function | Initializes the cURL connection. | |
DrupalWebTestCase:: |
protected | function | Compare two files based on size and file name. | |
DrupalWebTestCase:: |
protected | function | Creates a custom content type based on default settings. | |
DrupalWebTestCase:: |
protected | function | Creates a node based on default settings. | |
DrupalWebTestCase:: |
protected | function | Creates a role with specified permissions. | |
DrupalWebTestCase:: |
protected | function | Create a user with a given set of permissions. | |
DrupalWebTestCase:: |
protected | function | Retrieves a Drupal path or an absolute path. | |
DrupalWebTestCase:: |
protected | function | Retrieve a Drupal path or an absolute path and JSON decode the result. | |
DrupalWebTestCase:: |
protected | function | Gets the current raw HTML of requested page. | |
DrupalWebTestCase:: |
protected | function | Gets the value of an HTTP response header. If multiple requests were required to retrieve the page, only the headers from the last request will be checked by default. However, if TRUE is passed as the second argument, all requests will be processed… | |
DrupalWebTestCase:: |
protected | function | Gets the HTTP response headers of the requested page. Normally we are only interested in the headers returned by the last request. However, if a page is redirected or HTTP authentication is in use, multiple requests will be required to retrieve the… | |
DrupalWebTestCase:: |
protected | function | Gets an array containing all e-mails sent during this test case. | |
DrupalWebTestCase:: |
function | Get a node from the database based on its title. | ||
DrupalWebTestCase:: |
protected | function | Gets the value of the Drupal.settings JavaScript variable for the currently loaded page. | |
DrupalWebTestCase:: |
protected | function | Get a list files that can be used in tests. | |
DrupalWebTestCase:: |
protected | function | Generate a token for the currently logged in user. | |
DrupalWebTestCase:: |
protected | function | Retrieves only the headers for a Drupal path or an absolute path. | |
DrupalWebTestCase:: |
protected | function | Log in a user with the internal browser. | |
DrupalWebTestCase:: |
protected | function | ||
DrupalWebTestCase:: |
protected | function | Execute a POST request on a Drupal page. It will be done as usual POST request with SimpleBrowser. | |
DrupalWebTestCase:: |
protected | function | Execute an Ajax submission. | |
DrupalWebTestCase:: |
protected | function | Sets the raw HTML content. This can be useful when a page has been fetched outside of the internal browser and assertions need to be made on the returned page. | |
DrupalWebTestCase:: |
protected | function | Sets the value of the Drupal.settings JavaScript variable for the currently loaded page. | |
DrupalWebTestCase:: |
protected | function | Takes a path and returns an absolute path. | |
DrupalWebTestCase:: |
protected | function | Get all option elements, including nested options, in a select. | |
DrupalWebTestCase:: |
protected | function | Get the selected value from a select field. | |
DrupalWebTestCase:: |
protected | function | Returns the cache key used for the setup caching. | |
DrupalWebTestCase:: |
protected | function | Get the current URL from the cURL handler. | |
DrupalWebTestCase:: |
protected | function | Handle form input related to drupalPost(). Ensure that the specified fields exist and attempt to create POST data in the correct manner for the particular field type. | |
DrupalWebTestCase:: |
protected | function | Copies the cached tables and files for a cached installation setup. | |
DrupalWebTestCase:: |
protected | function | Parse content returned from curlExec using DOM and SimpleXML. | |
DrupalWebTestCase:: |
protected | function | Preload the registry from the testing site. | |
DrupalWebTestCase:: |
protected | function | Generates a database prefix for running tests. | |
DrupalWebTestCase:: |
protected | function | Prepares the current environment for running the test. | |
DrupalWebTestCase:: |
protected | function | Recursively copy one directory to another. | |
DrupalWebTestCase:: |
protected | function | Refresh the in-memory set of variables. Useful after a page request is made that changes a variable in a different thread. | 1 |
DrupalWebTestCase:: |
protected | function | Reset all data structures after having enabled new modules. | |
DrupalWebTestCase:: |
protected | function | Store the installation setup to a cache. | |
DrupalWebTestCase:: |
protected | function | Outputs to verbose the most recent $count emails sent. | |
DrupalWebTestCase:: |
protected | function | Perform an xpath search on the contents of the internal browser. The search is relative to the root element (HTML tag normally) of the page. | |
LdapTestCase:: |
public | property | ||
LdapTestCase:: |
public | property | ||
LdapTestCase:: |
public | property | ||
LdapTestCase:: |
public | property | ||
LdapTestCase:: |
public | property | ||
LdapTestCase:: |
public | property | ||
LdapTestCase:: |
public | property | Current, or only, sid. | |
LdapTestCase:: |
public | property | ||
LdapTestCase:: |
public | property | ||
LdapTestCase:: |
public | property | Storage for test data. | |
LdapTestCase:: |
public | function | ||
LdapTestCase:: |
public | function | ||
LdapTestCase:: |
public | function | 1 | |
LdapTestCase:: |
public | function | Keep user entity fields function for ldap_user in base class instead of user test class in case module integration testing is needed. | |
LdapTestCase:: |
public | function | ||
LdapTestCase:: |
public | function | Setup configuration and fake test data for all ldap modules. | |
LdapTestCase:: |
public | function | ||
LdapTestCase:: |
public | function | Attempt to derive a testid from backtrace. | |
LdapUserIntegrationTests:: |
protected | property | ||
LdapUserIntegrationTests:: |
public | property |
Overrides LdapTestCase:: |
|
LdapUserIntegrationTests:: |
public | function | ||
LdapUserIntegrationTests:: |
public static | function | ||
LdapUserIntegrationTests:: |
public | function |
Create one or more server configurations in such as way
that this setUp can be a prerequisite for ldap_authentication and ldap_authorization. Overrides LdapTestCase:: |
|
LdapUserIntegrationTests:: |
public | function |
Delete created files and temporary files directory, delete the tables created by setUp(),
and reset the database prefix. Overrides LdapTestCase:: |
|
LdapUserIntegrationTests:: |
public | function | Test cron function for dealing with ldap associated users who no longer have ldap entries | |
LdapUserIntegrationTests:: |
public | function | Integration tests for provisioning to ldap. | |
LdapUserIntegrationTests:: |
public | function |
Constructor for DrupalWebTestCase. Overrides LdapTestCase:: |