function UserLegacyTest::testUserDeleteMultiple

Tests that user_delete_multiple throws a deprecation error.

@expectedDeprecation user_delete_multiple() is deprecated in drupal:8.8.0. Use the entity storage system to delete the users. See https://www.drupal.org/node/3051463

File

core/modules/user/tests/src/Kernel/UserLegacyTest.php, line 79

Class

UserLegacyTest
Tests legacy user functionality.

Namespace

Drupal\Tests\user\Kernel

Code

public function testUserDeleteMultiple() {
    User::create([
        'name' => 'foo',
        'uid' => 10,
    ])->save();
    User::create([
        'name' => 'bar',
        'uid' => 11,
    ])->save();
    user_delete_multiple([
        10,
        11,
    ]);
    $this->assert(NULL === User::load(10), "User 10 has been deleted");
    $this->assert(NULL === User::load(11), "User 11 has been deleted");
}

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