You are here

function JavaScriptTestCase::testAddSetting in Drupal 7

Test adding settings.

File

modules/simpletest/tests/common.test, line 1485
Tests for common.inc functionality.

Class

JavaScriptTestCase
Tests for the JavaScript system.

Code

function testAddSetting() {
  $javascript = drupal_add_js(array(
    'drupal' => 'rocks',
    'dries' => 280342800,
  ), 'setting');
  $this
    ->assertEqual(280342800, $javascript['settings']['data'][2]['dries'], 'JavaScript setting is set correctly.');
  $this
    ->assertEqual('rocks', $javascript['settings']['data'][2]['drupal'], 'The other JavaScript setting is set correctly.');
}