|
15 | 15 | use Symfony\Component\Console\Application; |
16 | 16 | use Symfony\Component\Console\Command\Command; |
17 | 17 | use Symfony\Component\Console\Command\HelpCommand; |
| 18 | +use Symfony\Component\Console\Command\LazyCommand; |
18 | 19 | use Symfony\Component\Console\Command\SignalableCommandInterface; |
19 | 20 | use Symfony\Component\Console\CommandLoader\FactoryCommandLoader; |
20 | 21 | use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass; |
@@ -1672,7 +1673,7 @@ public function testRunLazyCommandService() |
1672 | 1673 | $container = new ContainerBuilder(); |
1673 | 1674 | $container->addCompilerPass(new AddConsoleCommandPass()); |
1674 | 1675 | $container |
1675 | | - ->register('lazy-command', LazyCommand::class) |
| 1676 | + ->register('lazy-command', LazyTestCommand::class) |
1676 | 1677 | ->addTag('console.command', ['command' => 'lazy:command']) |
1677 | 1678 | ->addTag('console.command', ['command' => 'lazy:alias']) |
1678 | 1679 | ->addTag('console.command', ['command' => 'lazy:alias2']); |
@@ -1847,7 +1848,7 @@ public function testSignal() |
1847 | 1848 | $application->setAutoExit(false); |
1848 | 1849 | $application->setDispatcher($dispatcher); |
1849 | 1850 | $application->setSignalsToDispatchEvent(\SIGALRM); |
1850 | | - $application->add($command); |
| 1851 | + $application->add(new LazyCommand('signal', [], '', false, function () use ($command) { return $command; }, true)); |
1851 | 1852 |
|
1852 | 1853 | $this->assertFalse($command->signaled); |
1853 | 1854 | $this->assertFalse($dispatcherCalled); |
@@ -1902,7 +1903,7 @@ public function __construct() |
1902 | 1903 | } |
1903 | 1904 | } |
1904 | 1905 |
|
1905 | | -class LazyCommand extends Command |
| 1906 | +class LazyTestCommand extends Command |
1906 | 1907 | { |
1907 | 1908 | public function execute(InputInterface $input, OutputInterface $output): int |
1908 | 1909 | { |
|
0 commit comments