mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-23 21:27:44 +03:00
Added --no-interaction to commands run internally from shlink DB commands
This commit is contained in:
parent
d32112fe7e
commit
6ddd70d21d
3 changed files with 7 additions and 5 deletions
|
@ -11,8 +11,6 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Symfony\Component\Lock\LockFactory;
|
use Symfony\Component\Lock\LockFactory;
|
||||||
use Symfony\Component\Process\PhpExecutableFinder;
|
use Symfony\Component\Process\PhpExecutableFinder;
|
||||||
|
|
||||||
use function array_unshift;
|
|
||||||
|
|
||||||
abstract class AbstractDatabaseCommand extends AbstractLockedCommand
|
abstract class AbstractDatabaseCommand extends AbstractLockedCommand
|
||||||
{
|
{
|
||||||
private ProcessHelper $processHelper;
|
private ProcessHelper $processHelper;
|
||||||
|
@ -27,7 +25,7 @@ abstract class AbstractDatabaseCommand extends AbstractLockedCommand
|
||||||
|
|
||||||
protected function runPhpCommand(OutputInterface $output, array $command): void
|
protected function runPhpCommand(OutputInterface $output, array $command): void
|
||||||
{
|
{
|
||||||
array_unshift($command, $this->phpBinary);
|
$command = [$this->phpBinary, ...$command, '--no-interaction'];
|
||||||
$this->processHelper->mustRun($output, $command);
|
$this->processHelper->mustRun($output, $command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ use Symfony\Component\Console\Tester\CommandTester;
|
||||||
use Symfony\Component\Lock\LockFactory;
|
use Symfony\Component\Lock\LockFactory;
|
||||||
use Symfony\Component\Lock\LockInterface;
|
use Symfony\Component\Lock\LockInterface;
|
||||||
use Symfony\Component\Process\PhpExecutableFinder;
|
use Symfony\Component\Process\PhpExecutableFinder;
|
||||||
|
use Symfony\Component\Process\Process;
|
||||||
|
|
||||||
class CreateDatabaseCommandTest extends TestCase
|
class CreateDatabaseCommandTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@ -114,7 +115,8 @@ class CreateDatabaseCommandTest extends TestCase
|
||||||
'/usr/local/bin/php',
|
'/usr/local/bin/php',
|
||||||
CreateDatabaseCommand::DOCTRINE_SCRIPT,
|
CreateDatabaseCommand::DOCTRINE_SCRIPT,
|
||||||
CreateDatabaseCommand::DOCTRINE_CREATE_SCHEMA_COMMAND,
|
CreateDatabaseCommand::DOCTRINE_CREATE_SCHEMA_COMMAND,
|
||||||
], Argument::cetera());
|
'--no-interaction',
|
||||||
|
], Argument::cetera())->willReturn(new Process([]));
|
||||||
|
|
||||||
$this->commandTester->execute([]);
|
$this->commandTester->execute([]);
|
||||||
$output = $this->commandTester->getDisplay();
|
$output = $this->commandTester->getDisplay();
|
||||||
|
|
|
@ -15,6 +15,7 @@ use Symfony\Component\Console\Tester\CommandTester;
|
||||||
use Symfony\Component\Lock\LockFactory;
|
use Symfony\Component\Lock\LockFactory;
|
||||||
use Symfony\Component\Lock\LockInterface;
|
use Symfony\Component\Lock\LockInterface;
|
||||||
use Symfony\Component\Process\PhpExecutableFinder;
|
use Symfony\Component\Process\PhpExecutableFinder;
|
||||||
|
use Symfony\Component\Process\Process;
|
||||||
|
|
||||||
class MigrateDatabaseCommandTest extends TestCase
|
class MigrateDatabaseCommandTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@ -53,7 +54,8 @@ class MigrateDatabaseCommandTest extends TestCase
|
||||||
'/usr/local/bin/php',
|
'/usr/local/bin/php',
|
||||||
MigrateDatabaseCommand::DOCTRINE_MIGRATIONS_SCRIPT,
|
MigrateDatabaseCommand::DOCTRINE_MIGRATIONS_SCRIPT,
|
||||||
MigrateDatabaseCommand::DOCTRINE_MIGRATE_COMMAND,
|
MigrateDatabaseCommand::DOCTRINE_MIGRATE_COMMAND,
|
||||||
], Argument::cetera());
|
'--no-interaction',
|
||||||
|
], Argument::cetera())->willReturn(new Process([]));
|
||||||
|
|
||||||
$this->commandTester->execute([]);
|
$this->commandTester->execute([]);
|
||||||
$output = $this->commandTester->getDisplay();
|
$output = $this->commandTester->getDisplay();
|
||||||
|
|
Loading…
Reference in a new issue