function JavaScriptTest::testAddExternal

Tests adding an external JavaScript File.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php, line 93
Definition of Drupal\system\Tests\Common\JavaScriptTest.

Class

JavaScriptTest
Tests the JavaScript system.

Namespace

Drupal\system\Tests\Common

Code

function testAddExternal() {
  $path = 'http://example.com/script.js';
  $javascript = drupal_add_js($path, 'external');
  $this
    ->assertTrue(array_key_exists('http://example.com/script.js', $javascript), 'Added an external JavaScript file.');
}