From 2c7e1f2a41ce1af8e582b540a3b580955c26c0d0 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Tue, 25 Aug 2009 21:16:31 +0000 Subject: #505084 by Rob Loach: Added an #attached_library() FAPI property for drupal_add_library(), for consistency with #attached_css and #attached_js. --- modules/simpletest/tests/common.test | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'modules/simpletest') 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.')); + } } /** -- cgit v1.2.3