You are here

public function LdapServerTest::refreshFakeData in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 7.2 ldap_test/LdapServerTest.class.php \LdapServerTest::refreshFakeData()
5 calls to LdapServerTest::refreshFakeData()
LdapServerTest::createLdapEntry in ldap_test/LdapServerTest.class.php
create ldap entry.
LdapServerTest::delete in ldap_test/LdapServerTest.class.php
Perform an LDAP delete.
LdapServerTest::dnExists in ldap_test/LdapServerTest.class.php
does dn exist for this server?
LdapServerTest::modifyLdapEntry in ldap_test/LdapServerTest.class.php
modify attributes of ldap entry
LdapServerTest::__construct in ldap_test/LdapServerTest.class.php
Constructor Method

File

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

Class

LdapServerTest

Code

public function refreshFakeData() {

  // debug("refreshFakeData sid=". $this->sid);
  $test_data = variable_get('ldap_test_server__' . $this->sid, array());
  $this->methodResponses = is_array($test_data) && isset($test_data['methodResponses']) ? $test_data['methodResponses'] : array();
  $this->entries = is_array($test_data) && isset($test_data['ldap']) ? $test_data['ldap'] : array();

  //  debug('this->entries');debug($this->entries);
  $this->searchResults = isset($test_data['search_results']) ? $test_data['search_results'] : array();
  $this->detailedWatchdogLog = config('ldap_help.settings')
    ->get('watchdog_detail');
  foreach ($test_data['properties'] as $property_name => $property_value) {
    $this->{$property_name} = $property_value;
  }

  //  $this->basedn = unserialize($this->basedn);
  if (isset($test_data['bindpw']) && $test_data['bindpw'] != '') {
    $this->bindpw = ldap_servers_decrypt($this->bindpw);
  }
}