diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-12-30 11:41:52 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-12-30 11:41:52 +0000 |
commit | 6b81f43e95bff4bd870dd6bf545118698f746027 (patch) | |
tree | 6ad66a9011f77876eb245b2cb2fdbcc90bd3404c /modules/simpletest/drupal_web_test_case.php | |
parent | 949ccddb91397c263a79e8dc144c172baa41452f (diff) | |
download | brdo-6b81f43e95bff4bd870dd6bf545118698f746027.tar.gz brdo-6b81f43e95bff4bd870dd6bf545118698f746027.tar.bz2 |
- Patch #669456 by boombatower: added support for more HTTP authentication settings in the tests.
Diffstat (limited to 'modules/simpletest/drupal_web_test_case.php')
-rw-r--r-- | modules/simpletest/drupal_web_test_case.php | 11 |
1 files changed, 9 insertions, 2 deletions
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 (<username>:<password>) 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; } @@ -676,6 +677,11 @@ class DrupalWebTestCase extends DrupalTestCase { protected $originalUser = NULL; /** + * HTTP authentication method + */ + protected $httpauth_method = CURLAUTH_BASIC; + + /** * HTTP authentication credentials (<username>:<password>). */ protected $httpauth_credentials = NULL; @@ -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); |