function WebformTestCase::testWebformPost in Webform 6.2
Same name and namespace in other branches
- 6.3 tests/webform.test \WebformTestCase::testWebformPost()
- 7.3 tests/webform.test \WebformTestCase::testWebformPost()
1 call to WebformTestCase::testWebformPost()
- WebformSubmissionTestCase::webformSubmissionExecute in tests/
submission.test - Execute the submission test.
File
- tests/
webform.test, line 636 - Webform module tests.
Class
- WebformTestCase
- @file Webform module tests.
Code
function testWebformPost() {
$edit = array();
foreach ($this
->testWebformComponents() as $key => $component_info) {
if (is_array($component_info['sample values'])) {
foreach ($component_info['sample values'] as $subkey => $value) {
$edit["submitted[{$key}][{$subkey}]"] = $value;
}
}
elseif ($component_info['sample values'] != NULL) {
$value = $component_info['sample values'];
// Multiple selects have a funky extra empty bracket in the name.
$extra = $key == 'select_multiple' ? '[]' : '';
$edit["submitted[{$key}]{$extra}"] = $value;
}
}
return $edit;
}