summaryrefslogtreecommitdiff
path: root/modules/simpletest
diff options
context:
space:
mode:
Diffstat (limited to 'modules/simpletest')
-rw-r--r--modules/simpletest/tests/path.test8
-rw-r--r--modules/simpletest/tests/url_alter_test.module4
2 files changed, 12 insertions, 0 deletions
diff --git a/modules/simpletest/tests/path.test b/modules/simpletest/tests/path.test
index 4998ffa38..8b3e6dc48 100644
--- a/modules/simpletest/tests/path.test
+++ b/modules/simpletest/tests/path.test
@@ -201,6 +201,14 @@ class UrlAlterFunctionalTest extends DrupalWebTestCase {
}
/**
+ * Tests that $_GET['q'] is initialized when the request path is empty.
+ */
+ function testGetQInitialized() {
+ $this->drupalGet('');
+ $this->assertText("\$_GET['q'] is non-empty with an empty request path.", "\$_GET['q'] is initialized with an empty request path.");
+ }
+
+ /**
* Assert that an outbound path is altered to an expected value.
*
* @param $original
diff --git a/modules/simpletest/tests/url_alter_test.module b/modules/simpletest/tests/url_alter_test.module
index e229ab986..9287ff523 100644
--- a/modules/simpletest/tests/url_alter_test.module
+++ b/modules/simpletest/tests/url_alter_test.module
@@ -30,6 +30,10 @@ function url_alter_test_foo() {
* Implements hook_url_inbound_alter().
*/
function url_alter_test_url_inbound_alter(&$path, $original_path, $path_language) {
+ if (!request_path() && !empty($_GET['q'])) {
+ drupal_set_message("\$_GET['q'] is non-empty with an empty request path.");
+ }
+
// Rewrite user/username to user/uid.
if (preg_match('!^user/([^/]+)(/.*)?!', $path, $matches)) {
if ($account = user_load_by_name($matches[1])) {