You are here

public function UserMailNotifyTest::testUserMailsNotSent in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/user/tests/src/Kernel/UserMailNotifyTest.php \Drupal\Tests\user\Kernel\UserMailNotifyTest::testUserMailsNotSent()
  2. 9 core/modules/user/tests/src/Kernel/UserMailNotifyTest.php \Drupal\Tests\user\Kernel\UserMailNotifyTest::testUserMailsNotSent()

Tests mails are not sent when notify.$op is FALSE.

@dataProvider userMailsProvider

Parameters

string $op: The operation being performed on the account.

File

core/modules/user/tests/src/Kernel/UserMailNotifyTest.php, line 103

Class

UserMailNotifyTest
Tests _user_mail_notify() use of user.settings.notify.*.

Namespace

Drupal\Tests\user\Kernel

Code

public function testUserMailsNotSent($op) {
  $this
    ->config('user.settings')
    ->set('notify.' . $op, FALSE)
    ->save();
  $return = _user_mail_notify($op, $this
    ->createUser());
  $this
    ->assertNull($return);
  $this
    ->assertEmpty($this
    ->getMails());
}