You are here

public function MessageTest::testMissingTemplate in Message 8

Tests attempting to create a message without a template.

@expectedException \Drupal\message\MessageException

File

tests/src/Kernel/MessageTest.php, line 60

Class

MessageTest
Kernel tests for the Message entity.

Namespace

Drupal\Tests\message\Kernel

Code

public function testMissingTemplate() {
  $message = Message::create([
    'template' => 'missing',
  ]);
  $message
    ->save();
}