public function FormBuilderExamplesTest::testOptionsConfiguration in Form Builder 7
File
- examples/
tests/ FormBuilderExamplesTest.php, line 13
Class
Code
public function testOptionsConfiguration() {
module_load_include('inc', 'form_builder', 'includes/form_builder.admin');
$loader = FormBuilderLoader::instance();
$form = $loader
->getForm('example', 'test', 'testsid');
$form
->save();
$data = _form_builder_add_element('example', 'test', 'select', NULL, 'testsid', TRUE);
$options_id = $data['elementId'];
$form = $loader
->fromCache('example', 'test', 'testsid');
$e = $form
->getElement($options_id);
$form_state = array();
$form = $e
->configurationForm(array(), $form_state);
$this
->assertEqual(array(
1 => 'one',
2 => 'two',
3 => 'three',
), $form['options']['#options']);
}