function EntityKernelTestBase::createUser
Same name and namespace in other branches
- 11.x core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBase.php \Drupal\KernelTests\Core\Entity\EntityKernelTestBase::createUser()
- 10 core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBase.php \Drupal\KernelTests\Core\Entity\EntityKernelTestBase::createUser()
- 8.9.x core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBase.php \Drupal\KernelTests\Core\Entity\EntityKernelTestBase::createUser()
Creates a user.
Parameters
array $values: (optional) The values used to create the entity.
array $permissions: (optional) Array of permission names to assign to user.
Return value
\Drupal\user\Entity\User The created user entity.
9 calls to EntityKernelTestBase::createUser()
- EntityAutocompleteElementFormTest::testEntityAutocompleteAccess in core/
tests/ Drupal/ KernelTests/ Core/ Entity/ Element/ EntityAutocompleteElementFormTest.php - Tests that access is properly checked by the EntityAutocomplete element.
- EntityReferenceSelectionSortTest::setUp in core/
tests/ Drupal/ KernelTests/ Core/ Entity/ EntityReferenceSelection/ EntityReferenceSelectionSortTest.php - EntityValidationTest::createTestEntity in core/
tests/ Drupal/ KernelTests/ Core/ Entity/ EntityValidationTest.php - Creates a test entity.
- NodeFieldAccessTest::testAccessToAdministrativeFields in core/
modules/ node/ tests/ src/ Kernel/ NodeFieldAccessTest.php - Tests permissions on nodes status field.
- TimezoneTest::setUp in core/
tests/ Drupal/ KernelTests/ Core/ Datetime/ Element/ TimezoneTest.php
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Entity/ EntityKernelTestBase.php, line 114
Class
- EntityKernelTestBase
- Defines an abstract test base for entity kernel tests.
Namespace
Drupal\KernelTests\Core\EntityCode
protected function createUser($values = [], $permissions = []) {
return $this->drupalCreateUser($permissions ?: [], NULL, FALSE, $values ?: []);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.