class TestSiteReleaseLocksCommand

Same name in other branches
  1. 9 core/tests/Drupal/TestSite/Commands/TestSiteReleaseLocksCommand.php \Drupal\TestSite\Commands\TestSiteReleaseLocksCommand
  2. 8.9.x core/tests/Drupal/TestSite/Commands/TestSiteReleaseLocksCommand.php \Drupal\TestSite\Commands\TestSiteReleaseLocksCommand
  3. 10 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 20

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) : int {
        $root = dirname(__DIR__, 5);
        chdir($root);
        TestDatabase::releaseAllTestLocks();
        $output->writeln('<info>Successfully released all the test database locks</info>');
        return 0;
    }

}

Members

Title Sort descending Modifiers Object type Summary
TestSiteReleaseLocksCommand::configure protected function
TestSiteReleaseLocksCommand::execute protected function

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.