Property | Type | Description | |
---|---|---|---|
$arguments | array | ||
$longOptions | array | ||
$options | array |
Method | Description | |
---|---|---|
main ( boolean $exit = true ) | ||
run ( array $argv, boolean $exit = true ) : integer |
Method | Description | |
---|---|---|
createRunner ( ) : PHPUnit_TextUI_TestRunner | Create a TestRunner, override in subclasses. | |
handleArguments ( array $argv ) | Handles the command-line arguments. | |
handleBootstrap ( string $filename ) | Loads a bootstrap file. | |
handleCustomTestSuite ( ) | Custom callback for test suite discovery. | |
handleLoader ( string $loaderClass, string $loaderFile = '' ) : PHPUnit_Runner_TestSuiteLoader | Handles the loading of the PHPUnit_Runner_TestSuiteLoader implementation. | |
handlePrinter ( string $printerClass, string $printerFile = '' ) : PHPUnit_Util_Printer | Handles the loading of the PHPUnit_Util_Printer implementation. | |
handleVersionCheck ( ) | ||
showHelp ( ) | Show the help message. |
Method | Description | |
---|---|---|
handleExtensions ( string $directory ) | ||
printVersionString ( ) | ||
showError ( $message ) |
protected createRunner ( ) : PHPUnit_TextUI_TestRunner | ||
return | PHPUnit_TextUI_TestRunner |
longOptions['my-switch'] = 'myHandler';
my-secondswitch will accept a value - note the equals sign
$this->longOptions['my-secondswitch='] = 'myOtherHandler';
}
--my-switch -> myHandler()
protected function myHandler()
{
}
--my-secondswitch foo -> myOtherHandler('foo')
protected function myOtherHandler ($value)
{
}
You will also need this - the static keyword in the
PHPUnit_TextUI_Command will mean that it'll be
PHPUnit_TextUI_Command that gets instantiated,
not MyCommand
public static function main($exit = true)
{
$command = new static;
return $command->run($_SERVER['argv'], $exit);
}
}
protected handleArguments ( array $argv ) | ||
$argv | array |
protected handleBootstrap ( string $filename ) | ||
$filename | string |
protected handleCustomTestSuite ( ) |
protected handleLoader ( string $loaderClass, string $loaderFile = '' ) : PHPUnit_Runner_TestSuiteLoader | ||
$loaderClass | string | |
$loaderFile | string | |
return | PHPUnit_Runner_TestSuiteLoader |
protected handlePrinter ( string $printerClass, string $printerFile = '' ) : PHPUnit_Util_Printer | ||
$printerClass | string | |
$printerFile | string | |
return | PHPUnit_Util_Printer |