From 6586b7646585d34b878bda18155a37e5eec729cb Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 5 Sep 2009 13:05:31 +0000 Subject: =?UTF-8?q?-=20Patch=20by=20#1577=20by=20chx,=20boombatower,=20B?= =?UTF-8?q?=C3=A8r=20Kessels,=20kkaefer:=20made=20SSL=20support=20a=20bit?= =?UTF-8?q?=20easier=20by=20providing=20two=20cookies=20and=20...=20hook?= =?UTF-8?q?=5Fgoto=5Falter.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/simpletest/tests/common_test.module | 64 +++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'modules/simpletest/tests/common_test.module') diff --git a/modules/simpletest/tests/common_test.module b/modules/simpletest/tests/common_test.module index c1a8b7917..e94f72811 100644 --- a/modules/simpletest/tests/common_test.module +++ b/modules/simpletest/tests/common_test.module @@ -6,6 +6,70 @@ * Helper module for the Common tests. */ +/** + * Implement hook_menu(). + */ +function common_test_menu() { + $items = array(); + $items['common-test/drupal_goto'] = array( + 'title' => 'Drupal Goto', + 'page callback' => 'common_test_drupal_goto_land', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + $items['common-test/drupal_goto/fail'] = array( + 'title' => 'Drupal Goto', + 'page callback' => 'common_test_drupal_goto_land_fail', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + $items['common-test/drupal_goto/redirect'] = array( + 'title' => 'Drupal Goto', + 'page callback' => 'common_test_drupal_goto_redirect', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + $items['common-test/drupal_goto/redirect_fail'] = array( + 'title' => 'Drupal Goto Failure', + 'page callback' => 'drupal_goto', + 'page arguments' => array('common-test/drupal_goto/fail'), + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + return $items; +} + +/** + * Check that drupal_goto() exits once called. + */ +function common_test_drupal_goto_redirect() { + drupal_goto('common-test/drupal_goto'); + print t("Drupal goto failed to stop program"); +} + +/** + * Landing page for drupal_goto(). + */ +function common_test_drupal_goto_land() { + print "drupal_goto"; +} + +/** + * Fail landing page for drupal_goto(). + */ +function common_test_drupal_goto_land_fail() { + print "drupal_goto_fail"; +} + +/** + * Implement hook_drupal_goto_alter(). + */ +function common_test_drupal_goto_alter(&$args) { + if ($args['path'] == 'common-test/drupal_goto/fail') { + $args['path'] = 'common-test/drupal_goto/redirect'; + } +} + /** * Implement hook_theme(). */ -- cgit v1.2.3