summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-02-28 07:36:06 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-02-28 07:36:06 +0000
commitec0dbd35c8dd7ad646ea3880f52ad81a54188f51 (patch)
treee6550fb3b3ba9c87013502f0dba575828a757fa9 /modules
parent665c9fdc2ca50f7960c16b375685485b3eb8b1cc (diff)
downloadbrdo-ec0dbd35c8dd7ad646ea3880f52ad81a54188f51.tar.gz
brdo-ec0dbd35c8dd7ad646ea3880f52ad81a54188f51.tar.bz2
#91250 by ontwerpwerk, hass, profix898, Rob Loach, and mfer: Allow drupal_add_js() to reference external JavaScript files.
Diffstat (limited to 'modules')
-rw-r--r--modules/simpletest/tests/common.test11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test
index 1bd40c27e..0f3fd2cbb 100644
--- a/modules/simpletest/tests/common.test
+++ b/modules/simpletest/tests/common.test
@@ -453,6 +453,17 @@ class JavaScriptTestCase extends DrupalWebTestCase {
}
/**
+ * Test rendering an external JavaScript file.
+ */
+ function testRenderExternal() {
+ $external = 'http://example.com/example.js';
+ drupal_add_js($external, 'external');
+ $javascript = drupal_get_js();
+ // Local files have a base_path() prefix, external files should not.
+ $this->assertTrue(strpos($javascript, 'src="' . $external) > 0, t('Rendering an external JavaScript file.'));
+ }
+
+ /**
* Test drupal_get_js() with a footer scope.
*/
function testFooterHTML() {