} /**
* Tests handling of disabled elements.
*
* @see _form_test_disabled_elements()
*/
public function testDisabledElements() { // Get the raw form in its original state.
$form_state =
new FormState();
$form =
(new FormTestDisabledElementsForm())->
buildForm([],
$form_state);
// Build a submission that tries to hijack the form by submitting input for
// elements that are disabled.
$edit =
[];
foreach (Element::
children($form) as $key) { if (isset($form[$key]['#test_hijack_value'
])) { if (is_array($form[$key]['#test_hijack_value'
])) { foreach ($form[$key]['#test_hijack_value'
] as $subkey =>
$value) { $edit[$key . '[' .
$subkey . ']'
] =
$value;
} }