You are here

function DrupalSetMessageTest::testSetRemoveMessages in Drupal 7

Tests setting messages and removing one before it is displayed.

File

modules/system/system.test, line 3048
Tests for system.module.

Class

DrupalSetMessageTest
Tests drupal_set_message() and related functions.

Code

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).');
}