You are here

public function LdapServerTest::__construct in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_test/LdapServerTest.class.php \LdapServerTest::__construct()
  2. 7 ldap_servers/tests/LdapServerTest.class.php \LdapServerTest::__construct()

Constructor Method.

Can take array of form property_name => property_value or $sid, where sid is used to derive the include file.

Overrides LdapServer::__construct

File

ldap_test/LdapServerTest.class.php, line 41
Simpletest ldapServer class for testing without an actual ldap server.

Class

LdapServerTest

Code

public function __construct($sid) {
  if (!is_scalar($sid)) {
    $test_data = $sid;
    $sid = $test_data['sid'];
  }
  else {
    $test_data = variable_get('ldap_test_server__' . $sid, []);
  }
  $bindpw = isset($test_data['bindpw']) ? $test_data['bindpw'] : 'goodpwd';
  $this->sid = $sid;
  $this
    ->refreshFakeData();
  $this
    ->initDerivedProperties($bindpw);
}