function FormValidatorTest::providerTestHandleErrorsWithLimitedValidation
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php \Drupal\Tests\Core\Form\FormValidatorTest::providerTestHandleErrorsWithLimitedValidation()
- 8.9.x core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php \Drupal\Tests\Core\Form\FormValidatorTest::providerTestHandleErrorsWithLimitedValidation()
- 11.x core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php \Drupal\Tests\Core\Form\FormValidatorTest::providerTestHandleErrorsWithLimitedValidation()
File
-
core/
tests/ Drupal/ Tests/ Core/ Form/ FormValidatorTest.php, line 186
Class
- FormValidatorTest
- @coversDefaultClass \Drupal\Core\Form\FormValidator @group Form
Namespace
Drupal\Tests\Core\FormCode
public static function providerTestHandleErrorsWithLimitedValidation() {
return [
// Test with a non-existent section.
[
[
[
'test1',
],
[
'test3',
],
],
[],
[
'test1' => 'foo',
'test2' => 'bar',
],
[
'test1' => 'foo',
],
],
// Test with buttons in a non-validated section.
[
[
[
'test1',
],
],
[
'#is_button' => TRUE,
'#value' => 'baz',
'#name' => 'op',
'#parents' => [
'submit',
],
],
[
'test1' => 'foo',
'test2' => 'bar',
'op' => 'baz',
'submit' => 'baz',
],
[
'test1' => 'foo',
'submit' => 'baz',
'op' => 'baz',
],
],
// Test with a matching button #value and $form_state value.
[
[
[
'submit',
],
],
[
'#is_button' => TRUE,
'#value' => 'baz',
'#name' => 'op',
'#parents' => [
'submit',
],
],
[
'test1' => 'foo',
'test2' => 'bar',
'op' => 'baz',
'submit' => 'baz',
],
[
'submit' => 'baz',
'op' => 'baz',
],
],
// Test with a mismatched button #value and $form_state value.
[
[
[
'submit',
],
],
[
'#is_button' => TRUE,
'#value' => 'bar',
'#name' => 'op',
'#parents' => [
'submit',
],
],
[
'test1' => 'foo',
'test2' => 'bar',
'op' => 'baz',
'submit' => 'baz',
],
[
'submit' => 'baz',
],
],
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.