You are here

function JavaScriptTestCase::testAttachedLibrary in SimpleTest 7

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

File

tests/common.test, line 1200
Tests for common.inc functionality.

Class

JavaScriptTestCase
Tests for the JavaScript system.

Code

function testAttachedLibrary() {
  $element['#attached']['library'][] = 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.'));
}