trait UserCreationTrait

Same name in this branch
  1. 8.9.x core/modules/user/tests/src/Traits/UserCreationTrait.php \Drupal\Tests\user\Traits\UserCreationTrait
Same name in other branches
  1. 9 core/modules/user/tests/src/Traits/UserCreationTrait.php \Drupal\Tests\user\Traits\UserCreationTrait
  2. 10 core/modules/user/tests/src/Traits/UserCreationTrait.php \Drupal\Tests\user\Traits\UserCreationTrait
  3. 11.x core/modules/user/tests/src/Traits/UserCreationTrait.php \Drupal\Tests\user\Traits\UserCreationTrait

Provides methods to create additional test users and switch the currently logged in one.

This trait is meant to be used only by test classes extending \Drupal\simpletest\TestBase.

Hierarchy

Deprecated

in drupal:8.4.0 and is removed from drupal:9.0.0. Use Drupal\Tests\user\Traits\UserCreationTrait instead.

See also

https://www.drupal.org/node/2884454

File

core/modules/simpletest/src/UserCreationTrait.php, line 21

Namespace

Drupal\simpletest
View source
trait UserCreationTrait {
    use BaseUserCreationTrait;

}

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