You are here

class QaAccountsCommands in QA Accounts 8

Defines drush commands for QA Accounts module.

Hierarchy

  • class \Drupal\qa_accounts\Commands\QaAccountsCommands extends \Drush\Commands\DrushCommands

Expanded class hierarchy of QaAccountsCommands

1 string reference to 'QaAccountsCommands'
drush.services.yml in ./drush.services.yml
drush.services.yml
1 service uses QaAccountsCommands
qa_accounts.commands in ./drush.services.yml
\Drupal\qa_accounts\Commands\QaAccountsCommands

File

src/Commands/QaAccountsCommands.php, line 11

Namespace

Drupal\qa_accounts\Commands
View source
class QaAccountsCommands extends DrushCommands {

  /**
   * Service that creates and deletes QA accounts.
   *
   * @var \Drupal\qa_accounts\QaAccountsCreateDeleteInterface
   */
  protected $qaAccountsCreateDelete;

  /**
   * QaAccountsCommands constructor.
   *
   * @param \Drupal\qa_accounts\QaAccountsCreateDeleteInterface $qa_accounts_create_delete
   *   Service that creates and deletes QA accounts.
   */
  public function __construct(QaAccountsCreateDeleteInterface $qa_accounts_create_delete) {
    $this->qaAccountsCreateDelete = $qa_accounts_create_delete;
  }

  /**
   * Creates a test user for each custom role.
   *
   * @usage drush qa_accounts:create
   *   Create a test user for each custom user role.
   *
   * @command qa_accounts:create
   *
   * @aliases test-users-create,create-test-users,qac
   */
  public function testUsersCreate() {
    $this->qaAccountsCreateDelete
      ->createQaAccounts();
  }

  /**
   * Deletes the test users created by QA Accounts.
   *
   * @usage drush qa_accounts:delete
   *   Deletes the test users created by QA Accounts.
   *
   * @command qa_accounts:delete
   *
   * @aliases test-users-delete,delete-test-users,qad
   */
  public function testUsersDelete() {
    $this->qaAccountsCreateDelete
      ->deleteQaAccounts();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
QaAccountsCommands::$qaAccountsCreateDelete protected property Service that creates and deletes QA accounts.
QaAccountsCommands::testUsersCreate public function Creates a test user for each custom role.
QaAccountsCommands::testUsersDelete public function Deletes the test users created by QA Accounts.
QaAccountsCommands::__construct public function QaAccountsCommands constructor.