You are here

function JavaScriptTestCase::testRenderExternal in SimpleTest 7

Test rendering an external JavaScript file.

File

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

Class

JavaScriptTestCase
Tests for the JavaScript system.

Code

function testRenderExternal() {
  $external = 'http://example.com/example.js';
  drupal_add_js($external, 'external');
  $javascript = drupal_get_js();

  // Local files have a base_path() prefix, external files should not.
  $this
    ->assertTrue(strpos($javascript, 'src="' . $external) > 0, t('Rendering an external JavaScript file.'));
}