comparison core/tests/Drupal/TestSite/Commands/TestSiteReleaseLocksCommand.php @ 4:a9cd425dd02b

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