class CommandTesterTest extends TestCase
{ protected Command
$command;
protected CommandTester
$tester;
protected function setUp(): void
{ $this->command =
new Command('foo'
);
$this->command->
addArgument('command'
);
$this->command->
addArgument('foo'
);
$this->command->
setCode(function D
$input,
$output) { $output->
writeln('foo'
);
});
$this->tester =
new CommandTester($this->command
);
$this->tester->
execute(['foo' => 'bar'
],
['interactive' => false, 'decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE
]);
} public function testExecute() { $this->
assertFalse($this->tester->
getInput()->
isInteractive(), '->execute() takes an interactive option'
);
$this->
assertFalse($this->tester->
getOutput()->
isDecorated(), '->execute() takes a decorated option'
);
$this->
assertEquals(Output::VERBOSITY_VERBOSE,
$this->tester->
getOutput()->
getVerbosity(), '->execute() takes a verbosity option'
);
}