From:http://www.cnblogs.com/heiing/archive/2012/09/07/2674807.html
Steps:
- Install pear, see http://www.cnblogs.com/heiing/archive/2011/12/07/2279405.html
- Install PHPUnit, see http://www.phpunit.de/manual/3.7/en/installation.html
Pear config-set auto_discover 1pear Install Pear.phpunit.de/phpunit
Output
Attempting to discover channel "pear.phpunit.de" ... downloading channel.xml ... Starting to download Channel.xml (804 bytes) .... done:804 bytesauto-discovered channel "Pear.phpunit.de", alias "PHPUnit" , adding to Registryattempting to discover channel "pear.symfony-project.com" ... downloading channel.xml ... Starting to download Channel.xml (865 bytes) ... done:865 bytesauto-discovered channel "Pear.symfony-project.com", alias " Symfony ", adding to Registrydid not download optional dependencies:phpunit/php_invoker, use--alldeps to download Automat Icallyphpunit/phpunit can optionally use package "Phpunit/php_invoker" (version >= 1.1.0) phpunit/php_codecoverage Can optionally use PHP extension "Xdebug" (version >= 2.0.5) downloading phpunit-3.6.12.tgz ... Starting to download phpunit-3.6.12.tgz (119,220 bytes) ... done:119,220 bytesdownloading file_iterator-1.3.1.tgz ... Starting to download file_iterator-1.3.1.tgz (5,157 bytes) ... done:5,157 bytesdownloading text_template-1.1.1.tgz ... StarTing to download text_template-1.1.1.tgz (3,622 bytes) ... done:3,622 bytesdownloading php_codecoverage-1.1.3.tgz ... Starting to download php_codecoverage-1.1.3.tgz (132,726 bytes) ... done:132,726 bytesdownloading php_timer-1.0.2.tgz ... Starting to download php_timer-1.0.2.tgz (3,686 bytes) ... done:3,686 bytesdownloading phpunit_mockobject-1.1.1.tgz ... Starting to download phpunit_mockobject-1.1.1.tgz (19,897 bytes) ... done:19,897 bytesdownloading yaml-1.0.6.tgz ... Starting to download yaml-1.0.6.tgz (10,010 bytes) ... done:10,010 bytesdownloading php_tokenstream-1.1.3.tgz ... Starting to download php_tokenstream-1.1.3.tgz (9,860 bytes) ... done:9,860 bytesinstall ok:channel://pear.phpunit.de/ File_iterator-1.3.1install Ok:channel://pear.phpunit.de/text_template-1.1.1install ok:channel://pear.phpunit.de/ Php_timer-1.0.2install Ok:channel://pear.symfony-project.com/yaml-1.0.6install Ok:channel://pear.phpunit.de/php_ Tokenstream-1.1.3install ok:channel://pear.phpunit.de/php_codecoverage-1.1.3install Ok:channel://pear.phpunit.de/phpunit_mockobject-1.1.1install ok:channel://pear.phpunit.de/ PHPUnit-3.6.12
At this time should find PHP directory, there are phpunit,phpunit.bat two files, pear directory has phpunit directory.
Use PHPUnit--version with PHPUnit 3.6.12 by Sebastian Bergmann. Output, indicating successful installation.
[Go] install phpunit in Windows