public function FormStateTest::testGetError in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Form/FormStateTest.php \Drupal\Tests\Core\Form\FormStateTest::testGetError()
- 10 core/tests/Drupal/Tests/Core/Form/FormStateTest.php \Drupal\Tests\Core\Form\FormStateTest::testGetError()
Tests the getError() method.
@covers ::getError
@dataProvider providerTestGetError
File
- core/
tests/ Drupal/ Tests/ Core/ Form/ FormStateTest.php, line 78 - Contains \Drupal\Tests\Core\Form\FormStateTest.
Class
- FormStateTest
- @coversDefaultClass \Drupal\Core\Form\FormState
Namespace
Drupal\Tests\Core\FormCode
public function testGetError($errors, $parents, $error = NULL) {
$element['#parents'] = $parents;
$form_state = (new FormState())
->setFormState([
'errors' => $errors,
]);
$this
->assertSame($error, $form_state
->getError($element));
}