Skip to main content

Users

DrevOps\BehatSteps\Steps\Drupal\UserTrait - Source, Steps

Manage Drupal users with role and permission assignments.

public function userAssignRoles(UserCapabilityInterface $backend, EntityStubInterface $stub, string $roles): void

Assign the roles named in a comma-separated list to a saved account

public function userBuildStub(array $extra_fields = []): EntityStubInterface

Build a user stub with a random name, password and email

public function userCreate(array $values): EntityStubInterface

Create a user

public function userCreateAndLogin(string $roles, array $extra_fields = []): void

Create a user carrying the roles and extra fields, and log in as them

public function userCreateRoleWithPermissions(string $role, array $permissions): EntityStubInterface

Create a role with permissions, replacing a role with the same ID

public function userCreateWithPermissions(array $permissions): EntityStubInterface

Create a user with a new role carrying permissions

public function userDelete(array $values): void

Delete the users with an email address or, without one, a name

public function userExistsByMail(string $mail): bool

Check whether a user with the given email address exists

public function userGetByName(string $name): EntityStubInterface

Return the user with a name

public function userLoadMultiple(array $conditions = []): array

Load multiple users with specified conditions

public function userVisitActionPage(string $name, string $rel = 'canonical'): void

Visit a page of a user

public function userVisitPasswordResetLinkForUser(EntityStubInterface $user): void

Visit the password reset link for a user