public function DigestTest::testDeliverUnsavedMessage in Message Digest 8
Test delivery without a saved message entity.
@covers ::deliver
File
- tests/
src/ Unit/ Plugin/ Notifier/ DigestTest.php, line 103
Class
- DigestTest
- Tests the Digest plugin.
Namespace
Drupal\Tests\message_digest\Unit\Plugin\NotifierCode
public function testDeliverUnsavedMessage() {
// Setup an unsaved message.
$message = $this
->prophesize(MessageInterface::class)
->reveal();
$this
->expectException(\AssertionError::class);
$this
->expectExceptionMessage('The message entity (or $message->original_message) must be saved in order to create a digest entry.');
$notifier = $this
->getNotifier($message);
$notifier
->deliver([]);
}