You are here

public function SimpleLdapServerTestCase::setUp in Simple LDAP 7

Same name and namespace in other branches
  1. 7.2 simple_ldap.test \SimpleLdapServerTestCase::setUp()

Inherited from DrupalWebTestCase::setUp().

Overrides DrupalWebTestCase::setUp

1 call to SimpleLdapServerTestCase::setUp()
SimpleLdapUserTestCase::setUp in simple_ldap_user/simple_ldap_user.test
Inherited parent::setUp().
1 method overrides SimpleLdapServerTestCase::setUp()
SimpleLdapUserTestCase::setUp in simple_ldap_user/simple_ldap_user.test
Inherited parent::setUp().

File

./simple_ldap.test, line 12
Tests for Simple LDAP module.

Class

SimpleLdapServerTestCase
@file Tests for Simple LDAP module.

Code

public function setUp() {

  // Get the live simple_ldap config.
  $host = variable_get('simple_ldap_host');
  $port = variable_get('simple_ldap_port');
  $starttls = variable_get('simple_ldap_starttls');
  $binddn = variable_get('simple_ldap_binddn');
  $bindpw = variable_get('simple_ldap_bindpw');
  $readonly = variable_get('simple_ldap_readonly');
  $pagesize = variable_get('simple_ldap_pagesize');
  $debug = variable_get('simple_ldap_debug');

  // Create the sandbox environment.
  $modules = func_get_args();
  if (isset($modules[0]) && is_array($modules[0])) {
    $modules = $modules[0];
  }
  parent::setUp($modules);

  // Enable the simple_ldap module.
  $modules = array(
    'simple_ldap',
  );
  $success = module_enable($modules);
  $this
    ->assertTrue($success, t('Enabled modules: %modules', array(
    '%modules' => implode(', ', $modules),
  )));

  // Configure the sandbox environment.
  variable_set('simple_ldap_host', $host);
  variable_set('simple_ldap_port', $port);
  variable_set('simple_ldap_starttls', $starttls);
  variable_set('simple_ldap_binddn', $binddn);
  variable_set('simple_ldap_bindpw', $bindpw);
  variable_set('simple_ldap_readonly', $readonly);
  variable_set('simple_ldap_pagesize', $pagesize);
  variable_set('simple_ldap_debug', $debug);
}