diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-12-02 20:03:57 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-12-02 20:03:57 +0000 |
commit | 99afbc53a736ba30b294ed62611767345fe8c3dd (patch) | |
tree | fb6bb1133728048682b4dcc3d05f570e7c486367 /modules/simpletest/tests/session.test | |
parent | 71a22f1c1f4da46a370dd11b9e31537f255c7375 (diff) | |
download | brdo-99afbc53a736ba30b294ed62611767345fe8c3dd.tar.gz brdo-99afbc53a736ba30b294ed62611767345fe8c3dd.tar.bz2 |
- Patch #330582 by Darren Oh, c960657 et al: better API for retrieving HTTP headers and working with HTTP headers in tests.
Diffstat (limited to 'modules/simpletest/tests/session.test')
-rw-r--r-- | modules/simpletest/tests/session.test | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/modules/simpletest/tests/session.test b/modules/simpletest/tests/session.test index 082345e64..85a1bb80d 100644 --- a/modules/simpletest/tests/session.test +++ b/modules/simpletest/tests/session.test @@ -7,8 +7,6 @@ */ class SessionTestCase extends DrupalWebTestCase { - protected $saved_cookie; - function getInfo() { return array( 'name' => t('Session tests'), @@ -22,18 +20,6 @@ class SessionTestCase extends DrupalWebTestCase { } /** - * Implementation of curlHeaderCallback(). - */ - protected function curlHeaderCallback($ch, $header) { - // Look for a Set-Cookie header. - if (preg_match('/^Set-Cookie.+$/i', $header, $matches)) { - $this->saved_cookie = $header; - } - - return parent::curlHeaderCallback($ch, $header); - } - - /** * Tests for drupal_save_session() and drupal_session_regenerate(). */ function testSessionSaveRegenerate() { @@ -49,7 +35,7 @@ class SessionTestCase extends DrupalWebTestCase { $this->sessionReset($user->uid); // Make sure the session cookie is set as HttpOnly. $this->drupalLogin($user); - $this->assertTrue(preg_match('/HttpOnly/i', $this->saved_cookie), t('Session cookie is set as HttpOnly.')); + $this->assertTrue(preg_match('/HttpOnly/i', $this->drupalGetHeader('Set-Cookie', TRUE)), t('Session cookie is set as HttpOnly.')); $this->drupalLogout(); // Verify that the session is regenerated if a module calls exit // in hook_user_login(). |