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 | |
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')
-rw-r--r-- | modules/simpletest/tests/common.test | 12 | ||||
-rw-r--r-- | modules/simpletest/tests/database_test.test | 2 | ||||
-rw-r--r-- | modules/simpletest/tests/session.test | 6 |
3 files changed, 9 insertions, 11 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() { diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test index 88b5f36d2..1319f7c19 100644 --- a/modules/simpletest/tests/database_test.test +++ b/modules/simpletest/tests/database_test.test @@ -2026,7 +2026,7 @@ class DatabaseTemporaryQueryTestCase extends DrupalWebTestCase { */ function testTemporaryQuery() { $this->drupalGet('database_test_db_query_temporary'); - $this->assertEqual(db_query('SELECT COUNT(*) FROM {system}')->fetchField(), $this->_content, t('The temporary table exists and contains the correct amount of rows.')); + $this->assertEqual(db_query('SELECT COUNT(*) FROM {system}')->fetchField(), $this->drupalGetContent(), t('The temporary table exists and contains the correct amount of rows.')); $this->assertFalse(db_table_exists('temporary'), t('The temporary table is, indeed, temporary.')); } } diff --git a/modules/simpletest/tests/session.test b/modules/simpletest/tests/session.test index 4512d9cd4..082345e64 100644 --- a/modules/simpletest/tests/session.test +++ b/modules/simpletest/tests/session.test @@ -169,9 +169,9 @@ class SessionTestCase extends DrupalWebTestCase { $this->curlClose(); // Change cookie file for user. - $this->cookie_file = file_directory_temp() . '/cookie.' . $uid . '.txt'; - $this->curl_options[CURLOPT_COOKIEFILE] = $this->cookie_file; - $this->curl_options[CURLOPT_COOKIESESSION] = TRUE; + $this->cookieFile = file_directory_temp() . '/cookie.' . $uid . '.txt'; + $this->additionalCurlOptions[CURLOPT_COOKIEFILE] = $this->cookieFile; + $this->additionalCurlOptions[CURLOPT_COOKIESESSION] = TRUE; $this->drupalGet('session-test/get'); $this->assertResponse(200, t('Session test module is correctly enabled.'), t('Session')); } |