diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-11-26 13:48:50 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-11-26 13:48:50 +0000 |
commit | 63e195eb3024e9aa79c1c4bc7285b329329c91af (patch) | |
tree | 1c8c68ca5e842357a0103cf9f721cb668aa33c6f /modules/simpletest/tests/common.test | |
parent | 6e5851b3a932340a282b2cfc3187935fe52b1faf (diff) | |
download | brdo-63e195eb3024e9aa79c1c4bc7285b329329c91af.tar.gz brdo-63e195eb3024e9aa79c1c4bc7285b329329c91af.tar.bz2 |
- Patch #338239 by Damien Tournoud: clean-up DrupalWebTestCase.
Diffstat (limited to 'modules/simpletest/tests/common.test')
-rw-r--r-- | modules/simpletest/tests/common.test | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test index 60b397ebf..437f5dbd6 100644 --- a/modules/simpletest/tests/common.test +++ b/modules/simpletest/tests/common.test @@ -146,11 +146,11 @@ class DrupalTagsHandlingTestCase extends DrupalWebTestCase { $original = $this->validTags; foreach ($tags as $tag) { $key = array_search($tag, $original); - $this->_assert($key !== FALSE, t('Make sure tag %tag shows up in the final tags array (originally %original)', array('%tag' => $tag, '%original' => $key))); + $this->assertTrue($key, t('Make sure tag %tag shows up in the final tags array (originally %original)', array('%tag' => $tag, '%original' => $key))); unset($original[$key]); } foreach ($original as $leftover) { - $this->_assert(FALSE, t('Leftover tag %leftover was left over.', array('%leftover' => $leftover))); + $this->fail(t('Leftover tag %leftover was left over.', array('%leftover' => $leftover))); } } } @@ -238,11 +238,9 @@ class DrupalHTTPRequestTestCase extends DrupalWebTestCase { $auth = str_replace('http://', 'http://' . $username . ':' . $password .'@', $url); $result = drupal_http_request($auth); - // We use strpos directly. - // assertRaw() cannot be used because we are getting the data - // in a variable instead of $this->_content. - $this->assertTrue(strpos($result->data, $username) !== FALSE, t('$_SERVER[\'PHP_AUTH_USER\'] is passed correctly.')); - $this->assertTrue(strpos($result->data, $password) !== FALSE, t('$_SERVER[\'PHP_AUTH_PW\'] is passed correctly.')); + $this->drupalSetContent($result->data); + $this->assertRaw($username, t('$_SERVER["PHP_AUTH_USER"] is passed correctly.')); + $this->assertRaw($password, t('$_SERVER["PHP_AUTH_PW"] is passed correctly.')); } function testDrupalHTTPRequestRedirect() { |