function prepTestConfiguration($test_data, $feetures = FALSE) { $this->prepTestServers($test_data['servers'], $feetures); if (!$feetures && isset($test_data['authentication'])) { $this->configureAuthentication($test_data['authentication']); } if (!$feetures && isset($test_data['authorization'])) { $this->prepConsumerConf($test_data['authorization']); } if (!$feetures && isset($test_data['variables'])) { foreach ($test_data['variables'] as $name => $value) { variable_set($name, $value); } } $consumer_conf_admin = ldap_authorization_get_consumer_admin_object('drupal_role'); $consumer_conf_admin->status = 1; $consumer_conf_admin->save(); }
/** * setup configuration and fake test data for all ldap modules * * @param string $test_ldap_id name of directory in ldap_test where data is (e.g. hogwarts) * * the following params are ids that indicate what config data in /ldap_test/<module_name>.conf.inc to use * for example if $ldap_user_conf_id = 'ad_authentication', the array /ldap_test/ldap_user.conf.inc with the key * 'ad_authentication' will be used for the user module cofiguration * * @param array $sids to setup * @param string $ldap_user_conf_id * @param string $ldap_authentication_conf_id = NULL, * @param string $ldap_authorization_conf_id = NULL, * @param string $ldap_feeds_conf_id = NULL, * @param string $ldap_query_conf_id = NULL */ function prepTestData($test_ldap_id, $sids, $ldap_user_conf_id = NULL, $ldap_authentication_conf_id = NULL, $ldap_authorization_conf_id = NULL, $ldap_feeds_conf_id = NULL, $ldap_query_conf_id = NULL) { $this->testFunctions->configureLdapServers($sids); foreach ($sids as $sid) { $this->testFunctions->populateFakeLdapServerData($test_ldap_id, $sid); } if ($ldap_user_conf_id) { $this->testFunctions->configureLdapUser($ldap_user_conf_id); } if ($ldap_authentication_conf_id) { $this->testFunctions->configureLdapAuthentication($ldap_authentication_conf_id, $sids); } if ($ldap_authorization_conf_id) { $authorization_data = ldap_test_ldap_authorization_data(); if (!empty($authorization_data[$ldap_authorization_conf_id])) { $this->testFunctions->prepConsumerConf($authorization_data[$ldap_authorization_conf_id]); foreach ($authorization_data[$ldap_authorization_conf_id] as $consumer_type => $discard) { $this->consumerAdminConf[$consumer_type] = ldap_authorization_get_consumer_admin_object($consumer_type); } } } }