function DrupalSetMessageTest::testSetRemoveMessages

Tests setting messages and removing one before it is displayed.

File

modules/system/system.test, line 3138

Class

DrupalSetMessageTest
Tests <a href="/api/drupal/includes%21bootstrap.inc/function/drupal_set_message/7.x" title="Sets a message to display to the user." class="local">drupal_set_message</a>() 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).');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.