use Symfony\Component\Console\Question\Question;
use Symfony\Component\Console\Tester\ApplicationTester;
class ApplicationTesterTest extends TestCase
{ protected Application
$application;
protected ApplicationTester
$tester;
protected function setUp(): void
{ $this->application =
new Application();
$this->application->
setAutoExit(false
);
$this->application->
register('foo'
) ->
addArgument('foo'
) ->
setCode(function D
$input,
$output) { $output->
writeln('foo'
);
}) ;
$this->tester =
new ApplicationTester($this->application
);
$this->tester->
run(['command' => 'foo', 'foo' => 'bar'
],
['interactive' => false, 'decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE
]);
}