$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
);
$this->
assertStringContainsString('The namespace:name command does...',
$command->
getProcessedHelp(), '->getProcessedHelp() replaces %command.name% correctly in single command applications'
);
$this->
assertStringNotContainsString('%command.full_name%',
$command->
getProcessedHelp(), '->getProcessedHelp() replaces %command.full_name% in single command applications'
);
} public function testGetSetAliases() { $command =
new \
TestCommand();
$this->
assertEquals(['name'
],
$command->
getAliases(), '->getAliases() returns the aliases'
);
$ret =
$command->
setAliases(['name1'
]);
$this->
assertEquals($command,
$ret, '->setAliases() implements a fluent interface'
);
$this->
assertEquals(['name1'
],
$command->
getAliases(), '->setAliases() sets the aliases'
);
}