You are here

protected function SimpleLdapUserTestCase::tearDown in Simple LDAP 7.2

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

Inherited parent::tearDown().

Overrides DrupalWebTestCase::tearDown

1 call to SimpleLdapUserTestCase::tearDown()
SimpleLdapRoleTestCase::tearDown in simple_ldap_role/simple_ldap_role.test
Inherited parent::tearDown().
1 method overrides SimpleLdapUserTestCase::tearDown()
SimpleLdapRoleTestCase::tearDown in simple_ldap_role/simple_ldap_role.test
Inherited parent::tearDown().

File

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

Class

SimpleLdapUserTestCase
@file Tests for Simple LDAP User module.

Code

protected function tearDown() {

  // Get module configuration.
  $attribute_name = simple_ldap_user_variable_get('simple_ldap_user_attribute_name');

  // Clean up variables written to the database in setUp().
  variable_del('simple_ldap_user_attribute_map');

  // Clean up the LDAP entries that were added for testing.
  foreach ($this->ldapUser as $lu) {

    // Create a new SimpleLdapUser object, which performs a new search based
    // on the name attribute. This accounts for the possibility that the LDAP
    // entry has changed since it was created.
    $ldap_user = new SimpleLdapUser($lu->{$attribute_name}[0]);
    $ldap_user
      ->delete();
    $this
      ->assertFalse($ldap_user->exists, t(':dn was removed from LDAP', array(
      ':dn' => $ldap_user->dn,
    )));
  }
  parent::tearDown();
}