summaryrefslogtreecommitdiff
path: root/modules/simpletest
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2015-03-30 22:12:31 -0400
committerDavid Rothstein <drothstein@gmail.com>2015-03-30 22:12:31 -0400
commit63065623fba4087ba574b64efce054ae5a5b0683 (patch)
treea88483bfac5ebee9def28e866cce978ea6725375 /modules/simpletest
parentb1001811d95d5b4dc7ca4916fc74f773106ac9f0 (diff)
downloadbrdo-63065623fba4087ba574b64efce054ae5a5b0683.tar.gz
brdo-63065623fba4087ba574b64efce054ae5a5b0683.tar.bz2
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()
Diffstat (limited to 'modules/simpletest')
-rw-r--r--modules/simpletest/tests/system_test.module21
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/simpletest/tests/system_test.module b/modules/simpletest/tests/system_test.module
index c0eed034f..8c4432996 100644
--- a/modules/simpletest/tests/system_test.module
+++ b/modules/simpletest/tests/system_test.module
@@ -78,6 +78,13 @@ function system_test_menu() {
'type' => MENU_CALLBACK,
);
+ $items['system-test/drupal-set-message'] = array(
+ 'title' => 'Set messages with drupal_set_message()',
+ 'page callback' => 'system_test_drupal_set_message',
+ 'access callback' => TRUE,
+ 'type' => MENU_CALLBACK,
+ );
+
$items['system-test/main-content-handling'] = array(
'title' => 'Test main content handling',
'page callback' => 'system_test_main_content_fallback',
@@ -436,6 +443,20 @@ function system_test_authorize_init_page($page_title) {
}
/**
+ * Sets two messages and removes the first one before the messages are displayed.
+ */
+function system_test_drupal_set_message() {
+ // Set two messages.
+ drupal_set_message('First message (removed).');
+ drupal_set_message('Second message (not removed).');
+
+ // Remove the first.
+ unset($_SESSION['messages']['status'][0]);
+
+ return '';
+}
+
+/**
* Page callback to print out $_GET['destination'] for testing.
*/
function system_test_get_destination() {