public function testShortOptionArgument()
 {
     $clo = new gtCommandLineOptions();
     $clo->parse(array('generate-phpt.php', '-f', 'some-function'));
     $this->assertTrue($clo->hasOption('f'));
     $this->assertEquals('some-function', $clo->getOption('f'));
 }
Beispiel #2
0
    if ($minor < 3) {
        die("Sorry, you need PHP version 5.3 or greater to run this.\n");
    }
}
if ($major < 5) {
    die("Seriously, you need to upgrade you PHP level\n");
}
$options = new gtCommandLineOptions();
$optionalSections = new gtOptionalSections();
try {
    $options->parse($argv);
} catch (exception $e) {
    echo $e->getMessage() . "\n";
    die;
}
if ($options->hasOption('h')) {
    die(gtText::get('help'));
}
try {
    $preConditions = new gtPreConditionList();
    $preConditions->check($options);
} catch (exception $e) {
    echo $e->getMessage() . "\n";
    die;
}
if ($options->hasOption('s')) {
    $optionalSections->setOptions($options);
}
if ($options->hasOption('c')) {
    $name = $options->getOption('c') . "_" . $options->getOption('m');
    $method = new gtMethod($options->getOption('c'), $options->getOption('m'));