You are here

class TestSiteReleaseLocksCommand in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/TestSite/Commands/TestSiteReleaseLocksCommand.php \Drupal\TestSite\Commands\TestSiteReleaseLocksCommand

Command to release all test site database prefix locks.

Note that this command can't be safely tested by DrupalCI without potentially causing random failures.

@internal

Hierarchy

Expanded class hierarchy of TestSiteReleaseLocksCommand

1 file declares its use of TestSiteReleaseLocksCommand
TestSiteApplication.php in core/tests/Drupal/TestSite/TestSiteApplication.php

File

core/tests/Drupal/TestSite/Commands/TestSiteReleaseLocksCommand.php, line 18

Namespace

Drupal\TestSite\Commands
View source
class TestSiteReleaseLocksCommand extends Command {

  /**
   * {@inheritdoc}
   */
  protected function configure() {
    $this
      ->setName('release-locks')
      ->setDescription('Releases all test site locks')
      ->setHelp('The locks ensure test site database prefixes are not reused.');
  }

  /**
   * {@inheritdoc}
   */
  protected function execute(InputInterface $input, OutputInterface $output) {
    TestDatabase::releaseAllTestLocks();
    $output
      ->writeln('<info>Successfully released all the test database locks</info>');
    return 0;
  }

}

Members