在Mac OS X上的XAMPP上安裝PHPUnit
cd /Applications/XAMPP/xamppfiles/bin
sudo ./pear config-set auto_discover 1
sudo ./pear install pear.phpunit.de/PHP_CodeCoverage
會提示 xdebug 版本過低 ,
所以須要首先升級Mac OS中的XAMPP的XDebug。能夠到:
http://code.activestate.com/komodo/remotedebugging/
上面下載 PHP Remote Debugging Client 的 Mac OS X (universal) 版本便可。下載完成後是一個壓縮包,打開5.3的文件夾,找到xdebug.so。
複製到
/Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626 目錄下面替換原來的。
而後
sudo ./pear config-set auto_discover 1
sudo ./pear install pear.phpunit.de/PHPUnit
又冒出新問題,出現錯誤信息:
phpunit/phpunit requires package "phpunit/PHP_Invoker" (version >= 1.1.0, version <= 1.1.1), downloaded version is 1.1.2
用 sudo ./pear install phpunit/PHP_Invoker-1.1.1 安裝解決。
./phpunit --version
PHPUnit 3.6.12 by Sebastian Bergmann.
歡迎關注本站公眾號,獲取更多信息