function ContactFormValidationTest::testMessageValidation

Same name in other branches
  1. 10 core/modules/contact/tests/src/Kernel/ContactFormValidationTest.php \Drupal\Tests\contact\Kernel\ContactFormValidationTest::testMessageValidation()

Tests validation of message.

File

core/modules/contact/tests/src/Kernel/ContactFormValidationTest.php, line 40

Class

ContactFormValidationTest
Tests validation of contact_form entities.

Namespace

Drupal\Tests\contact\Kernel

Code

public function testMessageValidation() : void {
    assert($this->entity instanceof ContactFormInterface);
    // Messages should be able to span multiple lines.
    $this->entity
        ->setMessage("Multi\nLine");
    $this->assertValidationErrors([]);
}

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