function JavaScriptTest::testDifferentGroup

Tests adding a JavaScript file with a different group.

File

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

Class

JavaScriptTest
Tests the JavaScript system.

Namespace

Drupal\system\Tests\Common

Code

function testDifferentGroup() {
  drupal_add_library('system', 'drupal');
  $javascript = drupal_add_js('core/misc/collapse.js', array(
    'group' => JS_THEME,
  ));
  $this
    ->assertEqual($javascript['core/misc/collapse.js']['group'], JS_THEME, 'Adding a JavaScript file with a different group caches the given group.');
}