private function UserNotificationEmailTest::disableNotificationsForUser in Private Message 8
Disable email notifications for a user.
Parameters
\Drupal\Core\Session\AccountInterface $user: The user account.
1 call to UserNotificationEmailTest::disableNotificationsForUser()
- UserNotificationEmailTest::testAUserCanDisableEmailNotifications in tests/
src/ Kernel/ UserNotificationEmailTest.php - Test that users who have disabled notifications do not get an email.
File
- tests/
src/ Kernel/ UserNotificationEmailTest.php, line 171
Class
- UserNotificationEmailTest
- Tests notification emails when a new private message is created.
Namespace
Drupal\Tests\private_message\KernelCode
private function disableNotificationsForUser(AccountInterface $user) {
$this->userData
->set('private_message', $user
->id(), 'email_notification', FALSE);
$this
->assertFalse($this->userData
->get('private_message', $user
->id(), 'email_notification'));
}