From 99afbc53a736ba30b294ed62611767345fe8c3dd Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 2 Dec 2008 20:03:57 +0000 Subject: - Patch #330582 by Darren Oh, c960657 et al: better API for retrieving HTTP headers and working with HTTP headers in tests. --- modules/simpletest/tests/session.test | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'modules/simpletest/tests/session.test') 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'), @@ -21,18 +19,6 @@ class SessionTestCase extends DrupalWebTestCase { parent::setUp('session_test'); } - /** - * 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(). */ @@ -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(). -- cgit v1.2.3