public function testMessage()
 {
     $clo = new gtCommandLineOptions();
     $clo->parse(array('generate-phpt.php', '-c', 'blah'));
     $ch = new gtIsSpecifiedFunctionOrMethod();
     $this->assertEquals($ch->getMessage(), gtText::get('functionOrMethodNotSpecified'));
 }
Пример #2
0
 public function testMessage()
 {
     $clo = new gtCommandLineOptions();
     $clo->parse(array('generate-phpt.php', '-c', 'blah'));
     $ch = new gtIsvalidMethod();
     $this->assertEquals($ch->getMessage(), gtText::get('unknownMethod'));
 }
Пример #3
0
 /**
  * Create an instance of each pre-condition and run their check methods
  *
  */
 public function check($clo)
 {
     foreach ($this->preConditions as $preCon) {
         $checkThis = new $preCon();
         if (!$checkThis->check($clo)) {
             echo $checkThis->getMessage();
             die(gtText::get('help'));
         }
     }
 }
Пример #4
0
 public function getMessage()
 {
     return gtText::get('unknownFunction');
 }
Пример #5
0
        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'));
    $method->setArgumentNames();
Пример #6
0
 public function getMessage()
 {
     return gtText::get('methodNotSpecified');
 }
Пример #7
0
 public function getMessage()
 {
     return gtText::get('testTypeNotSpecified');
 }