diff options
Diffstat (limited to 'modules/system/system.test')
-rw-r--r-- | modules/system/system.test | 29 |
1 files changed, 29 insertions, 0 deletions
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 @@ -2827,6 +2827,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. */ class ConfirmFormTest extends DrupalWebTestCase { |