function JavaScriptTestCase::testAddSetting

Test adding settings.

File

modules/simpletest/tests/common.test, line 1577

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'][3]['dries'], 'JavaScript setting is set correctly.');
    $this->assertEqual('rocks', $javascript['settings']['data'][3]['drupal'], 'The other JavaScript setting is set correctly.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.