function FormStateTest::testGetError
Tests the getError() method.
@covers ::getError
      
    
@dataProvider providerTestGetError
File
- 
              core/tests/ Drupal/ Tests/ Core/ Form/ FormStateTest.php, line 75 
Class
- FormStateTest
- @coversDefaultClass \Drupal\Core\Form\FormState[[api-linebreak]]
Namespace
Drupal\Tests\Core\FormCode
public function testGetError($errors, $parents, $error = NULL) : void {
  $element['#parents'] = $parents;
  $form_state = (new FormState())->setFormState([
    'errors' => $errors,
  ]);
  $this->assertSame($error, $form_state->getError($element));
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
