You are here

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

Same name and namespace in other branches
  1. 8.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 59
Simpletest ldapServer class for testing without an actual ldap server.

Class

LdapServerTest

Code

public function refreshFakeData() {
  $test_data = variable_get('ldap_test_server__' . $this->sid, []);
  $this->methodResponses = is_array($test_data) && isset($test_data['methodResponses']) ? $test_data['methodResponses'] : [];
  $this->entries = is_array($test_data) && isset($test_data['ldap']) ? $test_data['ldap'] : [];
  $this->searchResults = isset($test_data['search_results']) ? $test_data['search_results'] : [];
  $this->detailedWatchdogLog = variable_get('ldap_help_watchdog_detail', 0);
  foreach ($test_data['properties'] as $property_name => $property_value) {
    $this->{$property_name} = $property_value;
  }
  if (isset($test_data['bindpw']) && $test_data['bindpw'] != '') {
    $this->bindpw = ldap_servers_decrypt($this->bindpw);
  }
}