Ejemplo n.º 1
0
$t->comment('nbCommandTest - Test options');
$t->is($command1->getOptions()->count(), 0, '->getOptions() returns 0 options');
$t->is($command2->getOptions()->count(), 0, '->getOptions() returns 0 options');
$t->is($command3->getOptions()->count(), 1, '->getOptions() returns 1 option');
$command = new DummyCommand();
$command->addOption(new nbOption('foo'));
$t->is($command->getOptions()->count(), 1, '->addOption() added 1 option');
//$t->comment('nbCommandTest - Test synopsys');
//$t->is($command1->getSynopsys(), 'bee foo', '->getSynopsys() is "bee foo"');
//$t->is($command2->getSynopsys(), 'bee ns:bar [foo]', '->getSynopsys() is "bee ns:bar [foo]"');
$t->comment('nbCommandTest - Test shortcut');
$t->is($command1->hasShortcut('f'), true, '->hasShortcut() is true with "f"');
$t->is($command1->hasShortcut(':f'), true, '->hasShortcut() is true with ":f"');
$t->is($command1->hasShortcut('b'), false, '->hasShortcut() is true with "b"');
$t->is($command1->hasShortcut(':b'), false, '->hasShortcut() is true with ":b"');
$t->is($command2->hasShortcut('n:b'), true, '->hasShortcut() is true with "n:b"');
$t->is($command2->hasShortcut('ns:b'), true, '->hasShortcut() is true with "ns:b"');
$t->is($command2->hasShortcut('b'), true, '->hasShortcut() is true with "b"');
$t->is($command2->hasShortcut(':b'), true, '->hasShortcut() is true with ":b"');
$t->is($command2->hasShortcut('ns:d'), false, '->hasShortcut() is true with "ns:d"');
$t->comment('nbCommandTest - Test brief description');
$command = new DummyCommand('foo');
$t->is($command->getBriefDescription(), '', '->getBriefDescrition() is ""');
$command->setBriefDescription('command brief description');
$t->is($command->getBriefDescription(), 'command brief description', '->getBriefDescrition() is "command brief description"');
$t->comment('nbCommandTest - Test detailed description');
$command = new DummyCommand('foo');
$t->is($command->getDescription(), '', '->getDescription() is ""');
$command->setDescription('command description');
$t->is($command->getDescription(), 'command description', '->getDescription() is "command description"');
$t->comment('nbCommandTest - Test aliases');