$ret =
$command->
setHelp('help1'
);
$this->
assertEquals($command,
$ret, '->setHelp() implements a fluent interface'
);
$this->
assertEquals('help1',
$command->
getHelp(), '->setHelp() sets the help'
);
$command->
setHelp(''
);
$this->
assertEquals('',
$command->
getHelp(), '->getHelp() does not fall back to the description'
);
} public function testGetProcessedHelp() { $command =
new \
TestCommand();
$command->
setHelp('The %command.name% command does... Example: %command.full_name%.'
);
$this->
assertStringContainsString('The namespace:name command does...',
$command->
getProcessedHelp(), '->getProcessedHelp() replaces %command.name% correctly'
);
$this->
assertStringNotContainsString('%command.full_name%',
$command->
getProcessedHelp(), '->getProcessedHelp() replaces %command.full_name%'
);
$command =
new \
TestCommand();
$command->
setHelp(''
);
$this->
assertStringContainsString('description',
$command->
getProcessedHelp(), '->getProcessedHelp() falls back to the description'
);
$command =
new \
TestCommand();
$command->
setHelp('The %command.name% command does... Example: %command.full_name%.'
);
$application =
new Application();
$application->
add($command);
$application->
setDefaultCommand('namespace:name', true
);