summaryrefslogtreecommitdiff
path: root/modules/simpletest
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-08-25 21:16:31 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-08-25 21:16:31 +0000
commit2c7e1f2a41ce1af8e582b540a3b580955c26c0d0 (patch)
treee98fac38ae876a9b2ba9f13845ce313165651ddc /modules/simpletest
parentb1cf3f1d26f9fd177548f5305f104c2d8d8df90e (diff)
downloadbrdo-2c7e1f2a41ce1af8e582b540a3b580955c26c0d0.tar.gz
brdo-2c7e1f2a41ce1af8e582b540a3b580955c26c0d0.tar.bz2
#505084 by Rob Loach: Added an #attached_library() FAPI property for drupal_add_library(), for consistency with #attached_css and #attached_js.
Diffstat (limited to 'modules/simpletest')
-rw-r--r--modules/simpletest/tests/common.test14
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test
index 13aad21e0..ad565b1ab 100644
--- a/modules/simpletest/tests/common.test
+++ b/modules/simpletest/tests/common.test
@@ -857,6 +857,20 @@ class JavaScriptTestCase extends DrupalWebTestCase {
$scripts = drupal_get_js();
$this->assertTrue(strpos($scripts, 'unknown') === FALSE, t('Unknown library was not added to the page.'));
}
+
+ /**
+ * Tests the addition of libraries through the #attached_library property.
+ */
+ function testAttachedLibrary() {
+ $element = array(
+ '#attached_library' => array(
+ array('system', 'farbtastic'),
+ )
+ );
+ drupal_render($element);
+ $scripts = drupal_get_js();
+ $this->assertTrue(strpos($scripts, 'misc/farbtastic/farbtastic.js'), t('The attached_library property adds the additional libraries.'));
+ }
}
/**