$commandTester =
new CommandTester($command);
$commandTester->
execute(['command_name' => 'li'
],
['decorated' => false
]);
$this->
assertStringContainsString('list [options] [--] [<namespace>]',
$commandTester->
getDisplay(), '->execute() returns a text help for the given command alias'
);
$this->
assertStringContainsString('format=FORMAT',
$commandTester->
getDisplay(), '->execute() returns a text help for the given command alias'
);
$this->
assertStringContainsString('raw',
$commandTester->
getDisplay(), '->execute() returns a text help for the given command alias'
);
} public function testExecuteForCommand() { $command =
new HelpCommand();
$commandTester =
new CommandTester($command);
$command->
setCommand(new ListCommand());
$commandTester->
execute([],
['decorated' => false
]);
$this->
assertStringContainsString('list [options] [--] [<namespace>]',
$commandTester->
getDisplay(), '->execute() returns a text help for the given command'
);
$this->
assertStringContainsString('format=FORMAT',
$commandTester->
getDisplay(), '->execute() returns a text help for the given command'
);
$this->
assertStringContainsString('raw',
$commandTester->
getDisplay(), '->execute() returns a text help for the given command'
);
} public function testExecuteForCommandWithXmlOption() { $command =
new HelpCommand();
$commandTester =
new CommandTester($command);
$command->
setCommand(new ListCommand());