You are here

protected function FormErrorHandlerTest::setUp in Drupal 8

Same name in this branch
  1. 8 core/tests/Drupal/Tests/Core/Form/FormErrorHandlerTest.php \Drupal\Tests\Core\Form\FormErrorHandlerTest::setUp()
  2. 8 core/modules/inline_form_errors/tests/src/Unit/FormErrorHandlerTest.php \Drupal\Tests\inline_form_errors\Unit\FormErrorHandlerTest::setUp()

Overrides UnitTestCase::setUp

File

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

Class

FormErrorHandlerTest
@coversDefaultClass \Drupal\Core\Form\FormErrorHandler @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);
}