You are here

function _form_test_tableselect_get_data in Drupal 7

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/form_test/form_test.module \_form_test_tableselect_get_data()
  2. 9 core/modules/system/tests/modules/form_test/form_test.module \_form_test_tableselect_get_data()

Create a header and options array. Helper function for callbacks.

3 calls to _form_test_tableselect_get_data()
FormsElementsTableSelectFunctionalTest::testMultipleFalseOptionchecker in modules/simpletest/tests/form.test
Test the whether the option checker gives an error on invalid tableselect values for radios.
FormsElementsTableSelectFunctionalTest::testMultipleTrueOptionchecker in modules/simpletest/tests/form.test
Test the whether the option checker gives an error on invalid tableselect values for checkboxes.
_form_test_tableselect_form_builder in modules/simpletest/tests/form_test.module
Build a form to test the tableselect element.

File

modules/simpletest/tests/form_test.module, line 571
Helper module for the form API tests.

Code

function _form_test_tableselect_get_data() {
  $header = array(
    'one' => t('One'),
    'two' => t('Two'),
    'three' => t('Three'),
    'four' => t('Four'),
  );
  $options['row1'] = array(
    'one' => 'row1col1',
    'two' => t('row1col2'),
    'three' => t('row1col3'),
    'four' => t('row1col4'),
  );
  $options['row2'] = array(
    'one' => 'row2col1',
    'two' => t('row2col2'),
    'three' => t('row2col3'),
    'four' => t('row2col4'),
  );
  $options['row3'] = array(
    'one' => 'row3col1',
    'two' => t('row3col2'),
    'three' => t('row3col3'),
    'four' => t('row3col4'),
  );
  return array(
    $header,
    $options,
  );
}