1 common.test CommonJavaScriptTestCase::testAttachedLibrary()

Tests the addition of libraries through the #attached['library'] property.

File

core/modules/simpletest/tests/common.test, line 1867
Tests for common.inc functionality.

Class

CommonJavaScriptTestCase
Tests for the JavaScript system.

Code

function testAttachedLibrary() {
  $element['#attached']['library'][] = array('system', 'farbtastic');
  backdrop_render($element);
  $scripts = backdrop_get_js();
  $this->assertTrue(strpos($scripts, 'core/misc/farbtastic/farbtastic.js'), 'The attached_library property adds the additional libraries.');
}