TestSiteReleaseLocksCommand.php in Drupal 8
File
core/tests/Drupal/TestSite/Commands/TestSiteReleaseLocksCommand.php
View source
<?php
namespace Drupal\TestSite\Commands;
use Drupal\Core\Test\TestDatabase;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class TestSiteReleaseLocksCommand extends Command {
protected function configure() {
$this
->setName('release-locks')
->setDescription('Releases all test site locks')
->setHelp('The locks ensure test site database prefixes are not reused.');
}
protected function execute(InputInterface $input, OutputInterface $output) {
TestDatabase::releaseAllTestLocks();
$output
->writeln('<info>Successfully released all the test database locks</info>');
return 0;
}
}