You are here

function JavaScriptTestCase::testAddSetting in SimpleTest 7

Test adding settings.

File

tests/common.test, line 996
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'][1]['dries'], t('JavaScript setting is set correctly.'));
  $this
    ->assertEqual('rocks', $javascript['settings']['data'][1]['drupal'], t('The other JavaScript setting is set correctly.'));
}