private function UserNotificationEmailTest::createMessage in Private Message 8
Create a new private message with some default values.
Parameters
array $values: An array of values to set on the message.
Return value
\Drupal\Core\Entity\EntityInterface The new private message.
4 calls to UserNotificationEmailTest::createMessage()
- UserNotificationEmailTest::testANotificationEmailIsSent in tests/
src/ Kernel/ UserNotificationEmailTest.php - Test that notification emails are sent when a private message is created.
- UserNotificationEmailTest::testAUserCanDisableEmailNotifications in tests/
src/ Kernel/ UserNotificationEmailTest.php - Test that users who have disabled notifications do not get an email.
- UserNotificationEmailTest::testNoEmailToUserWithNoEmailAddress in tests/
src/ Kernel/ UserNotificationEmailTest.php - Test that no email is attempted if a user has no email address.
- UserNotificationEmailTest::testNotificationEmailsCanBeDisabled in tests/
src/ Kernel/ UserNotificationEmailTest.php - Test that notification emails can be disabled globally.
File
- tests/
src/ Kernel/ UserNotificationEmailTest.php, line 155
Class
- UserNotificationEmailTest
- Tests notification emails when a new private message is created.
Namespace
Drupal\Tests\private_message\KernelCode
private function createMessage(array $values = []) {
$message = PrivateMessage::create(array_merge([
'message' => $this
->randomString(),
], $values));
$message
->save();
return $message;
}