From 63065623fba4087ba574b64efce054ae5a5b0683 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 30 Mar 2015 22:12:31 -0400 Subject: Issue #1946240 by hampercm, eiriksm, David_Rothstein, rpayanm, rszrama, Yaron Tal, dgtlife, madhusudanmca, er.pushpinderrana, Cottser: Remove the hardcoded 0 index in theme_status_messages() --- modules/system/system.test | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'modules/system') diff --git a/modules/system/system.test b/modules/system/system.test index dcc86e539..3e26bae8c 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -2826,6 +2826,35 @@ class SystemValidTokenTest extends DrupalUnitTestCase { } } +/** + * Tests drupal_set_message() and related functions. + */ +class DrupalSetMessageTest extends DrupalWebTestCase { + + public static function getInfo() { + return array( + 'name' => 'Messages', + 'description' => 'Tests that messages can be displayed using drupal_set_message().', + 'group' => 'System', + ); + } + + function setUp() { + parent::setUp('system_test'); + } + + /** + * Tests setting messages and removing one before it is displayed. + */ + function testSetRemoveMessages() { + // The page at system-test/drupal-set-message sets two messages and then + // removes the first before it is displayed. + $this->drupalGet('system-test/drupal-set-message'); + $this->assertNoText('First message (removed).'); + $this->assertText('Second message (not removed).'); + } +} + /** * Tests confirm form destinations. */ -- cgit v1.2.3