summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-11-24 13:41:11 -0800
committerwebchick <webchick@24967.no-reply.drupal.org>2011-11-24 13:41:11 -0800
commitc1b5616cc236c7a65569e1fad039e62e64bfab6a (patch)
treeb4591465d71b5c160d189bc2fb3df29d6667593d /modules
parente1616f4d135f1bccc0de98bcb11bbb88a6e6932d (diff)
downloadbrdo-c1b5616cc236c7a65569e1fad039e62e64bfab6a.tar.gz
brdo-c1b5616cc236c7a65569e1fad039e62e64bfab6a.tar.bz2
Issue #1329914 by xjm, msonnabaum: Fixed Ensure ['q'] is set before calling drupal_normal_path().
Diffstat (limited to 'modules')
-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])) {