Mercurial > hg > isophonics-drupal-site
annotate core/tests/Drupal/TestSite/Commands/TestSiteReleaseLocksCommand.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 129ea1e6d783 |
children |
rev | line source |
---|---|
Chris@17 | 1 <?php |
Chris@17 | 2 |
Chris@17 | 3 namespace Drupal\TestSite\Commands; |
Chris@17 | 4 |
Chris@17 | 5 use Drupal\Core\Test\TestDatabase; |
Chris@17 | 6 use Symfony\Component\Console\Command\Command; |
Chris@17 | 7 use Symfony\Component\Console\Input\InputInterface; |
Chris@17 | 8 use Symfony\Component\Console\Output\OutputInterface; |
Chris@17 | 9 |
Chris@17 | 10 /** |
Chris@17 | 11 * Command to release all test site database prefix locks. |
Chris@17 | 12 * |
Chris@17 | 13 * Note that this command can't be safely tested by DrupalCI without potentially |
Chris@17 | 14 * causing random failures. |
Chris@17 | 15 * |
Chris@17 | 16 * @internal |
Chris@17 | 17 */ |
Chris@17 | 18 class TestSiteReleaseLocksCommand extends Command { |
Chris@17 | 19 |
Chris@17 | 20 /** |
Chris@17 | 21 * {@inheritdoc} |
Chris@17 | 22 */ |
Chris@17 | 23 protected function configure() { |
Chris@17 | 24 $this->setName('release-locks') |
Chris@17 | 25 ->setDescription('Releases all test site locks') |
Chris@17 | 26 ->setHelp('The locks ensure test site database prefixes are not reused.'); |
Chris@17 | 27 } |
Chris@17 | 28 |
Chris@17 | 29 /** |
Chris@17 | 30 * {@inheritdoc} |
Chris@17 | 31 */ |
Chris@17 | 32 protected function execute(InputInterface $input, OutputInterface $output) { |
Chris@17 | 33 TestDatabase::releaseAllTestLocks(); |
Chris@17 | 34 $output->writeln('<info>Successfully released all the test database locks</info>'); |
Chris@17 | 35 } |
Chris@17 | 36 |
Chris@17 | 37 } |