trait AdminUserTrait in Video Embed Field 8
Same name and namespace in other branches
- 8.2 tests/src/Functional/AdminUserTrait.php \Drupal\Tests\video_embed_field\Functional\AdminUserTrait
Create admin users.
Hierarchy
- trait \Drupal\Tests\video_embed_field\Functional\AdminUserTrait uses UserCreationTrait
3 files declare their use of AdminUserTrait
- BundleTest.php in modules/
video_embed_media/ tests/ src/ Functional/ BundleTest.php - TextFormatConfigurationTest.php in modules/
video_embed_wysiwyg/ tests/ src/ Functional/ TextFormatConfigurationTest.php - UpgradePathTest.php in modules/
video_embed_media/ tests/ src/ Functional/ UpgradePathTest.php
File
- tests/
src/ Functional/ AdminUserTrait.php, line 10
Namespace
Drupal\Tests\video_embed_field\FunctionalView source
trait AdminUserTrait {
use UserCreationTrait;
/**
* Create an admin user.
*
* @return \Drupal\user\UserInterface
* A user with all permissions.
*/
protected function createAdminUser() {
return $this
->drupalCreateUser(array_keys($this->container
->get('user.permissions')
->getPermissions()));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AdminUserTrait:: |
protected | function | Create an admin user. | |
UserCreationTrait:: |
protected | function | Checks whether a given list of permission names is valid. | |
UserCreationTrait:: |
protected | function | Creates an administrative role. | |
UserCreationTrait:: |
protected | function | Creates a role with specified permissions. | |
UserCreationTrait:: |
protected | function | Create a user with a given set of permissions. | |
UserCreationTrait:: |
protected | function | Grant permissions to a user role. | |
UserCreationTrait:: |
protected | function | Switch the current logged in user. | |
UserCreationTrait:: |
protected | function | Creates a random user account and sets it as current user. |