You are here

public function SimpleLdapUserModifyProfileWebTestCase::testUserChangesProfile in Simple LDAP 7.2

Same name and namespace in other branches
  1. 7 simple_ldap_user/simple_ldap_user.test \SimpleLdapUserModifyProfileWebTestCase::testUserChangesProfile()

User edits profile information.

File

simple_ldap_user/simple_ldap_user.test, line 584
Tests for Simple LDAP User module.

Class

SimpleLdapUserModifyProfileWebTestCase

Code

public function testUserChangesProfile() {

  // Load configuration variables.
  $attribute_name = simple_ldap_user_variable_get('simple_ldap_user_attribute_name');

  // Generate a random suffix for testing.
  $suffix = $this
    ->randomName();

  // Initialize a user account object.
  $account = new stdClass();
  $account->name = $this->ldapUser[0]->{$attribute_name}[0];
  $account->pass_raw = $this->userPassword[0];

  // Log in user. This should create/sync an LDAP user (tested elsewhere).
  $this
    ->drupalLogin($account);

  // Submit the profile edit form, and verify synchronization.
  $this
    ->postProfileForm($suffix);
  $this
    ->verifySync($suffix);

  // Reset the values, and verify again.
  $this
    ->postProfileForm();
  $this
    ->verifySync('', NULL, TRUE);
}