function UserMailNotifyTest::testUserMailNotifyLangcodeDeprecation

Tests the deprecated $langcode argument to _user_mail_notify().

@group legacy

File

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

Class

UserMailNotifyTest
Tests <a href="/api/drupal/core%21modules%21user%21user.module/function/_user_mail_notify/9" title="Creates and sends a notification email following a change to a user account." class="local">_user_mail_notify</a>() use of user.settings.notify.*.

Namespace

Drupal\Tests\user\Kernel

Code

public function testUserMailNotifyLangcodeDeprecation() {
    $account = $this->createUser();
    $this->expectDeprecation('Specifying the notification language using the $langcode parameter is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. Omit the parameter. See https://www.drupal.org/node/3187082');
    _user_mail_notify('password_reset', $account, $account->getPreferredLangcode());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.