You are here

function JavaScriptTestCase::testLibraryUnknown in SimpleTest 7

Tests non-existing libraries.

File

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

Class

JavaScriptTestCase
Tests for the JavaScript system.

Code

function testLibraryUnknown() {
  $result = drupal_get_library('unknown', 'unknown');
  $this
    ->assertFalse($result, t('Unknown library returned FALSE.'));
  drupal_static_reset('drupal_get_library');
  $result = drupal_add_library('unknown', 'unknown');
  $this
    ->assertFalse($result, t('Unknown library returned FALSE.'));
  $scripts = drupal_get_js();
  $this
    ->assertTrue(strpos($scripts, 'unknown') === FALSE, t('Unknown library was not added to the page.'));
}