function FormErrorHandlerTest::setUp

Same name in this branch
  1. 8.9.x core/modules/inline_form_errors/tests/src/Unit/FormErrorHandlerTest.php \Drupal\Tests\inline_form_errors\Unit\FormErrorHandlerTest::setUp()
Same name and namespace in other branches
  1. 11.x core/modules/inline_form_errors/tests/src/Unit/FormErrorHandlerTest.php \Drupal\Tests\inline_form_errors\Unit\FormErrorHandlerTest::setUp()
  2. 11.x core/tests/Drupal/Tests/Core/Form/FormErrorHandlerTest.php \Drupal\Tests\Core\Form\FormErrorHandlerTest::setUp()
  3. 10 core/modules/inline_form_errors/tests/src/Unit/FormErrorHandlerTest.php \Drupal\Tests\inline_form_errors\Unit\FormErrorHandlerTest::setUp()
  4. 10 core/tests/Drupal/Tests/Core/Form/FormErrorHandlerTest.php \Drupal\Tests\Core\Form\FormErrorHandlerTest::setUp()
  5. 9 core/modules/inline_form_errors/tests/src/Unit/FormErrorHandlerTest.php \Drupal\Tests\inline_form_errors\Unit\FormErrorHandlerTest::setUp()
  6. 9 core/tests/Drupal/Tests/Core/Form/FormErrorHandlerTest.php \Drupal\Tests\Core\Form\FormErrorHandlerTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Form/FormErrorHandlerTest.php, line 32

Class

FormErrorHandlerTest
@coversDefaultClass \Drupal\Core\Form\FormErrorHandler[[api-linebreak]] @group Form

Namespace

Drupal\Tests\Core\Form

Code

protected function setUp() {
  parent::setUp();
  $this->messenger = $this->createMock(MessengerInterface::class);
  $this->formErrorHandler = $this->getMockBuilder('Drupal\\Core\\Form\\FormErrorHandler')
    ->setMethods([
    'messenger',
  ])
    ->getMock();
  $this->formErrorHandler
    ->expects($this->atLeastOnce())
    ->method('messenger')
    ->willReturn($this->messenger);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.