Problem/Motivation

The drush test-users:create command creates users for all the available roles on the platform. It would be helpful if this command supports arguments to:

  1. Set which roles should be used to create roles for
  2. Set a password for the test users

Steps to reproduce

Run drush test-users:create command and see that all the roles are being processed.

Proposed resolution

Change the createTestUsers method so it supports a comma-separated list of user roles as well as a password option.

The password argument should be optional, the roles argument required but it should support the value "all" so all roles are being processed.

Issue fork test_users-3439953

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jaapjan created an issue. See original summary.

jaapjan’s picture

The argument for user roles is added to the command in the merge request.

Argument for password selection still to be done.

jaapjan’s picture

Status: Needs work » Needs review

Argument for password also done.

eelkeblok made their first commit to this issue’s fork.

eelkeblok’s picture

Looks good. I tried whether it is possible to have the roles as separate arguments, but it seems Drush only supports a fixed number of arguments. I did turn the password into an option and added an email domain option while at it.

  • eelkeblok committed 569bc257 on 1.0.x
    Issue #3439953 by jaapjan, eelkeblok: Use allow list for roles and add...