diff options
Diffstat (limited to 'modules/simpletest/tests/common_test.module')
-rw-r--r-- | modules/simpletest/tests/common_test.module | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/modules/simpletest/tests/common_test.module b/modules/simpletest/tests/common_test.module index a80f00f74..1b5dbc351 100644 --- a/modules/simpletest/tests/common_test.module +++ b/modules/simpletest/tests/common_test.module @@ -28,6 +28,12 @@ function common_test_menu() { 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ); + $items['common-test/drupal_goto/redirect_advanced'] = array( + 'title' => 'Drupal Goto', + 'page callback' => 'common_test_drupal_goto_redirect_advanced', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); $items['common-test/drupal_goto/redirect_fail'] = array( 'title' => 'Drupal Goto Failure', 'page callback' => 'drupal_goto', @@ -35,6 +41,12 @@ function common_test_menu() { 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ); + $items['common-test/destination'] = array( + 'title' => 'Drupal Get Destination', + 'page callback' => 'common_test_destination', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); $items['common-test/query-string'] = array( 'title' => 'Test querystring', 'page callback' => 'common_test_js_and_css_querystring', @@ -45,11 +57,17 @@ function common_test_menu() { } /** - * Check that drupal_goto() exits once called. + * Redirect using drupal_goto(). */ function common_test_drupal_goto_redirect() { drupal_goto('common-test/drupal_goto'); - print t("Drupal goto failed to stop program"); +} + +/** + * Redirect using drupal_goto(). + */ +function common_test_drupal_goto_redirect_advanced() { + drupal_goto('common-test/drupal_goto', array('query' => array('foo' => '123')), 301); } /** @@ -76,6 +94,14 @@ function common_test_drupal_goto_alter(&$path, &$options, &$http_response_code) } /** + * Print destination query parameter. + */ +function common_test_destination() { + $destination = drupal_get_destination(); + print "The destination: " . check_plain($destination['destination']); +} + +/** * Implements hook_TYPE_alter(). */ function common_test_drupal_alter_alter(&$data, &$arg2 = NULL, &$arg3 = NULL) { |