function JavaScriptTestCase::testAddExternal

Tests adding an external JavaScript File.

File

modules/simpletest/tests/common.test, line 1586

Class

JavaScriptTestCase
Tests for the JavaScript system.

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.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.