You are here

private function MergeTermsConfirmTest::assertSingleErrorMessage in Term Merge 8

Tests a status message is available.

Parameters

string $expectedMessage: The status message text.

1 call to MergeTermsConfirmTest::assertSingleErrorMessage()
MergeTermsConfirmTest::buildForm in tests/src/Kernel/Form/MergeTermsConfirmTest.php
Tests the form build for the confirm form.

File

tests/src/Kernel/Form/MergeTermsConfirmTest.php, line 184

Class

MergeTermsConfirmTest
Tests the Merge terms confirm form.

Namespace

Drupal\Tests\term_merge\Kernel\Form

Code

private function assertSingleErrorMessage($expectedMessage) {
  $messages = \Drupal::messenger()
    ->all();
  $errorMessages = \Drupal::messenger()
    ->messagesByType('error');
  self::assertCount(1, $messages);
  self::assertEquals($expectedMessage, array_pop($errorMessages));
}