$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'
);
} public function testGetSynopsis() { $command =
new \
TestCommand();
$command->
addOption('foo'
);
$command->
addArgument('bar'
);
$command->
addArgument('info'
);
$this->
assertEquals('namespace:name [--foo] [--] [<bar> [<info>]]',
$command->
getSynopsis(), '->getSynopsis() returns the synopsis'
);
}