summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/url_alter_test.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/simpletest/tests/url_alter_test.module')
-rw-r--r--modules/simpletest/tests/url_alter_test.module25
1 files changed, 25 insertions, 0 deletions
diff --git a/modules/simpletest/tests/url_alter_test.module b/modules/simpletest/tests/url_alter_test.module
index 2734d8caa..da6cd635b 100644
--- a/modules/simpletest/tests/url_alter_test.module
+++ b/modules/simpletest/tests/url_alter_test.module
@@ -7,6 +7,27 @@
*/
/**
+ * Implements hook_menu().
+ */
+function url_alter_test_menu() {
+ $items['url-alter-test/foo'] = array(
+ 'title' => 'Foo',
+ 'page callback' => 'url_alter_test_foo',
+ 'access arguments' => array('access content'),
+ 'type' => MENU_CALLBACK,
+ );
+ return $items;
+}
+
+/**
+ * Menu callback.
+ */
+function url_alter_test_foo() {
+ print 'current_path=' . current_path() . ' request_path=' . request_path();
+ exit;
+}
+
+/**
* Implements hook_url_inbound_alter().
*/
function url_alter_test_url_inbound_alter(&$path, $original_path, $path_language) {
@@ -22,6 +43,10 @@ function url_alter_test_url_inbound_alter(&$path, $original_path, $path_language
if ($path == 'community' || strpos($path, 'community/') === 0) {
$path = 'forum' . substr($path, 9);
}
+
+ if ($path == 'url-alter-test/bar') {
+ $path = 'url-alter-test/foo';
+ }
}
/**