function UserCacheTagsTest::createEntity

Same name and namespace in other branches
  1. 8.9.x core/modules/user/tests/src/Functional/UserCacheTagsTest.php \Drupal\Tests\user\Functional\UserCacheTagsTest::createEntity()
  2. 10 core/modules/user/tests/src/Functional/UserCacheTagsTest.php \Drupal\Tests\user\Functional\UserCacheTagsTest::createEntity()
  3. 11.x core/modules/user/tests/src/Functional/UserCacheTagsTest.php \Drupal\Tests\user\Functional\UserCacheTagsTest::createEntity()

Overrides EntityCacheTagsTestBase::createEntity

File

core/modules/user/tests/src/Functional/UserCacheTagsTest.php, line 43

Class

UserCacheTagsTest
Tests the User entity's cache tags.

Namespace

Drupal\Tests\user\Functional

Code

protected function createEntity() {
    // Create a "Llama" user.
    $user = User::create([
        'name' => 'Llama',
        'status' => TRUE,
    ]);
    $user->save();
    return $user;
}

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