### Eclipse Workspace Patch 1.0
#P drupal7
Index: modules/simpletest/tests/custom_rewrite_url_inbound.inc
===================================================================
RCS file: modules/simpletest/tests/custom_rewrite_url_inbound.inc
diff -N modules/simpletest/tests/custom_rewrite_url_inbound.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/simpletest/tests/custom_rewrite_url_inbound.inc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,9 @@
+<?php
+function custom_url_rewrite_inbound(&$result, $path, $path_language) {
+  global $user;
+  if (preg_match('|^foobar(/.*)|', $path, $matches)) {
+      $result = 'node'. $matches[1];
+  }
+
+}
+?>
Index: modules/simpletest/tests/custom_rewrite_url_inbound.test
===================================================================
RCS file: modules/simpletest/tests/custom_rewrite_url_inbound.test
diff -N modules/simpletest/tests/custom_rewrite_url_inbound.test
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/simpletest/tests/custom_rewrite_url_inbound.test	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,41 @@
+<?php
+
+class pathTest extends DrupalWebTestCase {
+
+  function getInfo() {
+    return array(
+      'name' => t('custom_url_rewrite_inbound test'),
+      'description' => t('Test custom_url_rewrite_inbound.'),
+      'group' => t('Path'),
+    );
+  }
+
+  function testCustomUrlRewriteInboundWithoutFunction() {
+    $inbound_path = 'foobar/666';
+    $real_path    = 'node/666';
+
+    $found_path = drupal_get_normal_path($inbound_path);
+    $this->assertNotEqual($found_path, $real_path, t('Inbound path:'. $inbound_path .' does not get rewritten to '. $real_path .' because the function is not yet included.') );
+  }
+
+  function testNoPath() {
+    include ( drupal_get_path('module', 'simpletest') .'/tests/custom_rewrite_url_inbound.inc');
+  }
+
+  function testCustomUrlRewriteInbound() {
+    $inbound_path = 'foobar/666';
+    $real_path    = 'node/666';
+
+    $found_path = drupal_get_normal_path($inbound_path);
+    $this->assertEqual($found_path, $real_path, t('Inbound path:'. $inbound_path .' gets rewritten to '. $real_path) );
+  }
+
+  function testCustomUrlRewriteInboundNoMatch() {
+    $inbound_path = 'foopage/666';
+    $real_path    = 'node/666';
+
+    $found_path = drupal_get_normal_path($inbound_path);
+    $this->assertNotEqual($found_path, $real_path, t('Inbound path:'. $inbound_path .' does not match any of the patterns defined in the custom_url_rewrite_inbound function') );
+  }
+}
+?>
