phpunit --help PHPUnit 2.3.0 by Sebastian Bergmann.
Usage:
phpunit [switches] UnitTest [UnitTest.php] --coverage-data <file> Write
code-coverage data in raw format to file. --coverage-html <file> Write
code-coverage data in HTML format to file. --coverage-text <file> Write
code-coverage data in text format to file. --testdox-html <file> Write
agile documentation in HTML format to file. --testdox-text <file> Write
agile documentation in Text format to file. --log-xml <file> Log test
progress in XML format to file. --loader <loader> TestSuiteLoader
implementation to use. --skeleton Generate skeleton UnitTest class for
Unit in Unit.php. --wait Waits for a keystroke after each
test. --help Prints this usage information. --version Prints the
version and exits. phpunit
UnitTest
phpunit --skeleton Sample PHPUnit 2.3.0 by Sebastian
Bergmann. Wrote test class skeleton for Sample to
SampleTest.php. phpunit SampleTest PHPUnit 2.3.0 by Sebastian
Bergmann. I Time: 0.007268 There was 1 incomplete test
case: 1) testSampleMethod(SampleTest) OK, but incomplete test
cases!!! Tests run: 1, incomplete test cases:
1. 当你为现有代码书写测试时,你不得不重复很多相同的代码片断,如:
public function testSampleMethod( )
{} PHPUnit能帮助你分析现有代码,生成测试用例类的框架。