window下安装phpunit简单方法
根据文档你可以直接
pear config-set auto_discover 1
pear install pear.phpunit.de/PHPUnit
执行这两行命令即可(需要先安装pear)
但是我本人测试,安装失败
以下介绍一种通用的方法:
下载 phpunit-3.5.rar
phpunit-3.5 需要php的版本最低是php 5.2.7,推荐安装至版本为5.3.8的php下
将PHPUnit解压出来,放至php安装目录下,
修改php.ini,确保include_path包含PHPUnit
如:
phpunit 的路径:D:/webServer/PHP/PHPUnit
则:
include_path=".;D:/webServer/PHP"
提取phpunit.bat文件放入php安装要目录与php.exe在同一个目录下
修改phpunit.bat
将 %PHPBIN% 修改为 php.exe的路径,如:D:/webServer/PHP/php.exe
将 @bin_dir@ 修改为php根目录路径
提取 phpunit.php文件
修改替换内容类似于phpunit.bat
这样就算是安装完成了
说明一下:%PHPBIN% windows下环境变量,如果你正确设置了这个环境变量,可以不用替换
但是 phpunit.php 文件中的这个 @php_bin@ 必须要替换