diff --git a/tests/Command/AbstractCommandTest.php b/tests/Command/AbstractCommandTest.php index 62862cec91..34dce7cddb 100644 --- a/tests/Command/AbstractCommandTest.php +++ b/tests/Command/AbstractCommandTest.php @@ -15,6 +15,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Tester\CommandTester; +use Symfony\Component\HttpKernel\KernelInterface; abstract class AbstractCommandTest extends KernelTestCase { @@ -33,7 +34,9 @@ protected function executeCommand(array $arguments, array $inputs = []): Command // this uses a special testing container that allows you to fetch private services /** @var Command $command */ $command = static::getContainer()->get($this->getCommandFqcn()); - $command->setApplication(new Application(self::$kernel)); + /** @var KernelInterface $kernel */ + $kernel = self::$kernel; + $command->setApplication(new Application($kernel)); $commandTester = new CommandTester($command); $commandTester->setInputs($inputs);