프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$arguments | array | ||
$longOptions | array | ||
$options | array |
메소드 | 설명 | |
---|---|---|
main ( boolean $exit = true ) | ||
run ( array $argv, boolean $exit = true ) : integer |
메소드 | 설명 | |
---|---|---|
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. |
메소드 | 설명 | |
---|---|---|
handleExtensions ( string $directory ) | ||
printVersionString ( ) | ||
showError ( $message ) |
protected createRunner ( ) : PHPUnit_TextUI_TestRunner | ||
리턴 | 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 | |
리턴 | PHPUnit_Runner_TestSuiteLoader |
protected handlePrinter ( string $printerClass, string $printerFile = '' ) : PHPUnit_Util_Printer | ||
$printerClass | string | |
$printerFile | string | |
리턴 | PHPUnit_Util_Printer |