1 common.test CommonJavaScriptTestCase::testLibraryRender()

Adds a library to the page and tests for both its JavaScript and its CSS.

File

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

Class

CommonJavaScriptTestCase
Tests for the JavaScript system.

Code

function testLibraryRender() {
  $result = backdrop_add_library('system', 'farbtastic');
  $this->assertTrue($result !== FALSE, t('Library was added without errors.'));
  $scripts = backdrop_get_js();
  $styles = backdrop_get_css();
  $this->assertTrue(strpos($scripts, 'core/misc/farbtastic/farbtastic.js'), 'JavaScript for library was added to the page.');
  $this->assertTrue(strpos($styles, 'core/misc/farbtastic/farbtastic.css'), 'Stylesheet for library was added to the page.');
}