function FormErrorHandlerTest::setUp
Same name in this branch
- 10 core/tests/Drupal/Tests/Core/Form/FormErrorHandlerTest.php \Drupal\Tests\Core\Form\FormErrorHandlerTest::setUp()
Same name in other branches
- 9 core/modules/inline_form_errors/tests/src/Unit/FormErrorHandlerTest.php \Drupal\Tests\inline_form_errors\Unit\FormErrorHandlerTest::setUp()
- 9 core/tests/Drupal/Tests/Core/Form/FormErrorHandlerTest.php \Drupal\Tests\Core\Form\FormErrorHandlerTest::setUp()
- 8.9.x core/modules/inline_form_errors/tests/src/Unit/FormErrorHandlerTest.php \Drupal\Tests\inline_form_errors\Unit\FormErrorHandlerTest::setUp()
- 8.9.x core/tests/Drupal/Tests/Core/Form/FormErrorHandlerTest.php \Drupal\Tests\Core\Form\FormErrorHandlerTest::setUp()
- 11.x core/modules/inline_form_errors/tests/src/Unit/FormErrorHandlerTest.php \Drupal\Tests\inline_form_errors\Unit\FormErrorHandlerTest::setUp()
- 11.x core/tests/Drupal/Tests/Core/Form/FormErrorHandlerTest.php \Drupal\Tests\Core\Form\FormErrorHandlerTest::setUp()
Overrides UnitTestCase::setUp
File
-
core/
modules/ inline_form_errors/ tests/ src/ Unit/ FormErrorHandlerTest.php, line 57
Class
- FormErrorHandlerTest
- @coversDefaultClass \Drupal\inline_form_errors\FormErrorHandler @group InlineFormErrors
Namespace
Drupal\Tests\inline_form_errors\UnitCode
protected function setUp() : void {
parent::setUp();
$this->renderer = $this->createMock(RendererInterface::class);
$this->messenger = $this->createMock(MessengerInterface::class);
$this->formErrorHandler = new FormErrorHandler($this->getStringTranslationStub(), $this->renderer, $this->messenger);
$this->testForm = [
'#parents' => [],
'#form_id' => 'test_form',
'#array_parents' => [],
];
$this->testForm['test1'] = [
'#type' => 'textfield',
'#title' => 'Test 1',
'#parents' => [
'test1',
],
'#array_parents' => [
'test1',
],
'#id' => 'edit-test1',
];
$this->testForm['test2'] = [
'#type' => 'textfield',
'#title' => 'Test 2 & a half',
'#parents' => [
'test2',
],
'#array_parents' => [
'test2',
],
'#id' => 'edit-test2',
];
$this->testForm['fieldset'] = [
'#parents' => [
'fieldset',
],
'#array_parents' => [
'fieldset',
],
'test3' => [
'#type' => 'textfield',
'#title' => 'Test 3',
'#parents' => [
'fieldset',
'test3',
],
'#array_parents' => [
'fieldset',
'test3',
],
'#id' => 'edit-test3',
],
];
$this->testForm['test4'] = [
'#type' => 'textfield',
'#title' => 'Test 4',
'#parents' => [
'test4',
],
'#array_parents' => [
'test4',
],
'#id' => 'edit-test4',
'#error_no_message' => TRUE,
];
$this->testForm['test5'] = [
'#type' => 'textfield',
'#parents' => [
'test5',
],
'#array_parents' => [
'test5',
],
'#id' => 'edit-test5',
];
$this->testForm['test6'] = [
'#type' => 'value',
'#title' => 'Test 6',
'#parents' => [
'test6',
],
'#array_parents' => [
'test6',
],
'#id' => 'edit-test6',
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.