SimpleCommandLineParser::getHelpText PHP Method

getHelpText() public method

Returns plain-text help message for command line runner.
public getHelpText ( ) : string
return string String help message
    public function getHelpText()
    {
        return <<<HELP
SimpleTest command line default reporter (autorun)
Usage: php <test_file> [args...]

    -c <class>      Run only the test-case <class>
    -t <method>     Run only the test method <method>
    -s              Suppress skip messages
    -x              Return test results in XML
    -j              Return test results in JUnit format
    -cc             Generate code coverage reports
    -cx             Code coverage exclude folder (may have multiple)
    -h              Display this help message

HELP;
    }

Usage Example

Example #1
0
 /**
  *  Assembles the appropriate reporter for the environment.
  */
 function __construct()
 {
     if (SimpleReporter::inCli()) {
         $parser = new SimpleCommandLineParser($_SERVER['argv']);
         $interfaces = $parser->isXml() ? array('XmlReporter') : array('TextReporter');
         if ($parser->help()) {
             // I'm not sure if we should do the echo'ing here -- ezyang
             echo $parser->getHelpText();
             exit(1);
         }
         $reporter = new SelectiveReporter(SimpleTest::preferred($interfaces), $parser->getTestCase(), $parser->getTest());
         if ($parser->noSkips()) {
             $reporter = new NoSkipsReporter($reporter);
         }
     } else {
         $reporter = new SelectiveReporter(SimpleTest::preferred('HtmlReporter'), @$_GET['c'], @$_GET['t']);
         if (@$_GET['skips'] == 'no' || @$_GET['show-skips'] == 'no') {
             $reporter = new NoSkipsReporter($reporter);
         }
     }
     parent::__construct($reporter);
 }
All Usage Examples Of SimpleCommandLineParser::getHelpText