You are here

protected function TestBase::assertErrorMessage in Double Field 4.x

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/TestBase.php \Drupal\Tests\double_field\Functional\TestBase::assertErrorMessage()

Passes if a given error message was found on the page.

1 call to TestBase::assertErrorMessage()
FieldTypeTest::testAllowedValuesValidation in tests/src/Functional/FieldTypeTest.php
Test allowed values validation.

File

tests/src/Functional/TestBase.php, line 292

Class

TestBase
Tests the creation of text fields.

Namespace

Drupal\Tests\double_field\Functional

Code

protected function assertErrorMessage(string $message) : void {
  $messages = $this
    ->getMessages('error');
  self::assertTrue(in_array($message, $messages), 'Error message was found.');
}