function FormElementTestCase::testWeightDefaultValue

Tests Weight form element #default_value behavior.

File

modules/simpletest/tests/form.test, line 598

Class

FormElementTestCase
Tests building and processing of core form elements.

Code

public function testWeightDefaultValue() {
    $element = array(
        '#type' => 'weight',
        '#delta' => 10,
        '#default_value' => 15,
    );
    $element = form_process_weight($element);
    $this->assertTrue(isset($element['#options'][$element['#default_value']]), 'Default value exists in #options list');
}

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