From 6b81f43e95bff4bd870dd6bf545118698f746027 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 30 Dec 2009 11:41:52 +0000 Subject: - Patch #669456 by boombatower: added support for more HTTP authentication settings in the tests. --- modules/simpletest/drupal_web_test_case.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'modules/simpletest/drupal_web_test_case.php') diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index 19fe544c0..186195d28 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -415,8 +415,9 @@ abstract class DrupalTestCase { // HTTP auth settings (:) for the simpletest browser // when sending requests to the test site. - $username = variable_get('simpletest_username', NULL); - $password = variable_get('simpletest_password', NULL); + $this->httpauth_method = variable_get('simpletest_httpauth_method', CURLAUTH_BASIC); + $username = variable_get('simpletest_httpauth_username', NULL); + $password = variable_get('simpletest_httpauth_password', NULL); if ($username && $password) { $this->httpauth_credentials = $username . ':' . $password; } @@ -675,6 +676,11 @@ class DrupalWebTestCase extends DrupalTestCase { */ protected $originalUser = NULL; + /** + * HTTP authentication method + */ + protected $httpauth_method = CURLAUTH_BASIC; + /** * HTTP authentication credentials (:). */ @@ -1305,6 +1311,7 @@ class DrupalWebTestCase extends DrupalTestCase { CURLOPT_HEADERFUNCTION => array(&$this, 'curlHeaderCallback'), ); if (isset($this->httpauth_credentials)) { + $curl_options[CURLOPT_HTTPAUTH] = $this->httpauth_method; $curl_options[CURLOPT_USERPWD] = $this->httpauth_credentials; } curl_setopt_array($this->curlHandle, $this->additionalCurlOptions + $curl_options); -- cgit v1.2.3