Windows下PHPUnit安装

来源:互联网 发布:淘宝深夜食堂视频全集 编辑:程序博客网 时间:2024/05/01 10:58
1.首先必须知道php 中的php.ini,及include_path的位置,可以通过显示函数phpinfo()来获得
2.下载phpunit,http://pear.phpunit.de/get/,我下载的是PHPUnit-3.3.5.tgz;
3.解压PHPUnit文件,放到php中include_path中,我的是在D:/xampp/php/PEAR,你应该能看到 D:/xampp/php/PEAR/PHPUnit/Framework.php。
4.将D:/xampp/php/PEAR/pear-phpunit.bat重命名为 phpunit.将内容更改为php.exe的目录,如
set PHPBIN="D:/xampp/php"
"D:/xampp/php/php.exe" -d safe_mode=Off "D:/xampp/php/PEAR/PHPUnit/TextUI/Command.php" %*
5.将上面更改后的phpunit.bat放到c:/windows/system32下面。
6.打开dos窗口,转到你的代码目录下,然后运行phpunit 命令即可。
cd codedir
phpunit Array.php

参考:
1.http://www.phpunit.de/manual/3.3/en/installation.html
原创粉丝点击