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