1 common.test CommonJavaScriptTestCase::testLibraryUnknown()

Tests non-existing libraries.

File

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

Class

CommonJavaScriptTestCase
Tests for the JavaScript system.

Code

function testLibraryUnknown() {
  $result = backdrop_get_library('unknown', 'unknown');
  $this->assertFalse($result, 'Unknown library returned FALSE.');
  backdrop_static_reset('backdrop_get_library');

  $result = backdrop_add_library('unknown', 'unknown');
  $this->assertFalse($result, 'Unknown library returned FALSE.');
  $scripts = backdrop_get_js();
  $this->assertTrue(strpos($scripts, 'unknown') === FALSE, 'Unknown library was not added to the page.');
}