1 common.test | CommonJavaScriptTestCase::testRenderExternal() |
Test rendering an external JavaScript file.
File
- core/
modules/ simpletest/ tests/ common.test, line 1477 - Tests for common.inc functionality.
Class
- CommonJavaScriptTestCase
- Tests for the JavaScript system.
Code
function testRenderExternal() {
$external = 'http://example.com/example.js';
backdrop_add_js($external, 'external');
$javascript = backdrop_get_js();
// Local files have a base_path() prefix, external files should not.
$this->assertTrue(strpos($javascript, 'src="' . $external) > 0, 'Rendering an external JavaScript file.');
}