You are here

function JavaScriptTestCase::testRenderDifferentWeight in SimpleTest 7

Test rendering the JavaScript with a file's weight above jQuery's.

File

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

Class

JavaScriptTestCase
Tests for the JavaScript system.

Code

function testRenderDifferentWeight() {
  drupal_add_js('misc/collapse.js', array(
    'weight' => JS_LIBRARY - 21,
  ));
  $javascript = drupal_get_js();
  $this
    ->assertTrue(strpos($javascript, 'misc/collapse.js') < strpos($javascript, 'misc/jquery.js'), t('Rendering a JavaScript file above jQuery.'));
}