You are here

public function LdapTestCase::checkConsumerConfSetup in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 7.2 ldap_test/LdapTestCase.class.php \LdapTestCase::checkConsumerConfSetup()
3 calls to LdapTestCase::checkConsumerConfSetup()
LdapAuthorizationOg1Tests::testFlags in ldap_authorization/tests/Og1Tests.test
authorization configuration flags tests clumped together
LdapAuthorizationOg1Tests::testLogons in ldap_authorization/tests/Og1Tests.test
authorization configuration flags tests clumped together
LdapAuthorizationOg2Tests::testFlags in ldap_authorization/tests/Og2Tests.test
authorization configuration flags tests clumped together

File

ldap_test/LdapTestCase.class.php, line 333

Class

LdapTestCase

Code

public function checkConsumerConfSetup($conf_id) {
  $authorization_data = ldap_test_ldap_authorization_data();
  $props_set_correctly = TRUE;
  foreach ($authorization_data[$conf_id] as $consumer_type => $conf) {
    $props_set_display = array();
    foreach ($conf as $prop => $values) {
      if (!property_exists($this->consumerAdminConf[$consumer_type], $prop)) {
        $props_set_correctly = FALSE;
        $props_set_display[] = $prop . " {$consumer_type} property does not exist in consumer conf object";
      }
      elseif (is_scalar($this->consumerAdminConf[$consumer_type]->{$prop})) {
        if ($this->consumerAdminConf[$consumer_type]->{$prop} == $values) {
          $props_set_display[] = $prop . " {$consumer_type} set to {$values} correctly";
        }
        else {
          $props_set_correctly = FALSE;
          $props_set_display[] = $prop . " {$consumer_type} not set to {$values} correctly";
        }
      }
    }
  }
  return array(
    $props_set_display,
    $props_set_correctly,
  );
}