function FormTextareaTestCase::testValueCallback

Tests that textarea value is properly set.

File

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

Class

FormTextareaTestCase
Tests for form textarea.

Code

public function testValueCallback() {
    $element = array();
    $form_state = array();
    $test_cases = array(
        array(
            NULL,
            FALSE,
        ),
        array(
            NULL,
            NULL,
        ),
        array(
            '',
            array(
                'test',
            ),
        ),
        array(
            'test',
            'test',
        ),
        array(
            '123',
            123,
        ),
    );
    foreach ($test_cases as $test_case) {
        list($expected, $input) = $test_case;
        $this->assertIdentical($expected, form_type_textarea_value($element, $input, $form_state));
    }
}

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