summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/simpletest/tests/common.test22
-rw-r--r--modules/simpletest/tests/common_test.module15
2 files changed, 36 insertions, 1 deletions
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test
index 9a93d75c8..aa8f9d422 100644
--- a/modules/simpletest/tests/common.test
+++ b/modules/simpletest/tests/common.test
@@ -503,7 +503,7 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase {
}
function setUp() {
- parent::setUp('php', 'locale');
+ parent::setUp('php', 'locale', 'common_test');
// Reset drupal_add_css() before each test.
drupal_static_reset('drupal_add_css');
}
@@ -682,6 +682,16 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase {
// Change the language back to left to right.
$language->direction = LANGUAGE_LTR;
}
+
+ /**
+ * Tests that the query string remains intact when adding CSS files that have
+ * query string parameters.
+ */
+ function testAddCssFileWithQueryString() {
+ $this->drupalGet('common-test/query-string');
+ $query_string = substr(variable_get('css_js_query_string', '0'), 0, 1);
+ $this->assertRaw(drupal_get_path('module', 'node') . '/node.css?arg1=value1&arg2=value2&' . $query_string, t('Query string was appended correctly to css.'));
+ }
}
/**
@@ -1255,6 +1265,16 @@ class JavaScriptTestCase extends DrupalWebTestCase {
$scripts = drupal_get_js();
$this->assertTrue(strpos($scripts, 'misc/farbtastic/farbtastic.js'), t('The attached_library property adds the additional libraries.'));
}
+
+ /**
+ * Tests that the query string remains intact when adding JavaScript files
+ * that have query string parameters.
+ */
+ function testAddJsFileWithQueryString() {
+ $this->drupalGet('common-test/query-string');
+ $query_string = substr(variable_get('css_js_query_string', '0'), 0, 1);
+ $this->assertRaw(drupal_get_path('module', 'node') . '/node.js?arg1=value1&arg2=value2&' . $query_string, t('Query string was appended correctly to js.'));
+ }
}
/**
diff --git a/modules/simpletest/tests/common_test.module b/modules/simpletest/tests/common_test.module
index 36697b5af..a80f00f74 100644
--- a/modules/simpletest/tests/common_test.module
+++ b/modules/simpletest/tests/common_test.module
@@ -35,6 +35,12 @@ function common_test_menu() {
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
+ $items['common-test/query-string'] = array(
+ 'title' => 'Test querystring',
+ 'page callback' => 'common_test_js_and_css_querystring',
+ 'access arguments' => array('access content'),
+ 'type' => MENU_CALLBACK,
+ );
return $items;
}
@@ -183,3 +189,12 @@ function common_test_library() {
);
return $libraries;
}
+
+/**
+ * Adds a JavaScript file and a CSS file with a query string appended.
+ */
+function common_test_js_and_css_querystring() {
+ drupal_add_js(drupal_get_path('module', 'node') . '/node.js?arg1=value1&arg2=value2');
+ drupal_add_css(drupal_get_path('module', 'node') . '/node.css?arg1=value1&arg2=value2');
+ return '';
+}