function FormTestInputForgeryForm::postRender
Alters the rendered form to simulate input forgery.
It's necessary to alter the rendered form here because Mink does not support manipulating the DOM tree.
Parameters
string $rendered_form: The rendered form.
Return value
string The modified rendered form.
See also
\Drupal\Tests\system\Functional\Form\FormTest::testInputForgery()
File
-
core/
modules/ system/ tests/ modules/ form_test/ src/ Form/ FormTestInputForgeryForm.php, line 61
Class
- FormTestInputForgeryForm
- Form to test input forgery.
Namespace
Drupal\form_test\FormCode
public static function postRender($rendered_form) {
return str_replace('value="two"', 'value="FORGERY"', (string) $rendered_form);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.