function JavaScriptTest::testFooterHTML

Tests drupal_get_js() with a footer scope.

File

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

Class

JavaScriptTest
Tests the JavaScript system.

Namespace

Drupal\system\Tests\Common

Code

function testFooterHTML() {
  drupal_add_library('system', 'drupal');
  $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.');
}