function JavaScriptTestCase::testFooterHTML
Test drupal_get_js() with a footer scope.
File
-
modules/
simpletest/ tests/ common.test, line 1661
Class
- JavaScriptTestCase
- Tests for the JavaScript system.
Code
function testFooterHTML() {
$inline = 'jQuery(function () { });';
drupal_add_js($inline, array(
'type' => 'inline',
'scope' => 'footer',
));
$javascript = drupal_get_js('footer');
$this->assertTrue(strpos($javascript, $inline) > 0, 'Rendered JavaScript footer returns the inline code.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.