From 5962cc5ab22bc07995b5886305255f93cab2a165 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 1 Jul 2009 12:47:30 +0000 Subject: - Patch #477944 by DamZ: more streamlining and clean-up of session handling code. --- modules/simpletest/tests/session.test | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'modules/simpletest/tests/session.test') diff --git a/modules/simpletest/tests/session.test b/modules/simpletest/tests/session.test index d53c14c20..fb82f179d 100644 --- a/modules/simpletest/tests/session.test +++ b/modules/simpletest/tests/session.test @@ -195,6 +195,17 @@ class SessionTestCase extends DrupalWebTestCase { $this->assertNoText(t('This is a dummy message.'), t('Message was not cached.')); $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', t('Page was cached.')); $this->assertFalse($this->drupalGetHeader('Set-Cookie'), t('New session was not started.')); + + // Verify that no session is created if drupal_save_session(FALSE) is called. + $this->drupalGet('session-test/set-message-but-dont-save'); + $this->assertSessionCookie(FALSE); + $this->assertSessionEmpty(TRUE); + + // Verify that no message is displayed. + $this->drupalGet(''); + $this->assertSessionCookie(FALSE); + $this->assertSessionEmpty(TRUE); + $this->assertNoText(t('This is a dummy message.'), t('The message was not saved.')); } /** @@ -205,6 +216,7 @@ class SessionTestCase extends DrupalWebTestCase { function sessionReset($uid = 0) { // Close the internal browser. $this->curlClose(); + $this->loggedInUser = FALSE; // Change cookie file for user. $this->cookieFile = file_directory_temp() . '/cookie.' . $uid . '.txt'; -- cgit v1.2.3