- 刪除 MAMP 2.0.x 錯誤的設定檔:
sudo rm /Applications/MAMP/bin/php/php5.3.6/conf/pear.conf
- 前往MAMP的PEAR腳本檔案夾:
MAMP 1.9.x:
cd /Applications/MAMP/bin/php5.3/bin/
MAMP 2.0.x:
cd /Applications/MAMP/bin/php/php5.3.6/bin/
- 更新MAMP的PEAR:
sudo ./pear channel-update pear.php.net sudo ./pear upgrade pear
- 檢查PEAR版本:
./pear -V PEAR Version: 1.9.4 PHP Version: 5.3.6
- 安裝PHPUnit:
sudo ./pear channel-discover pear.phpunit.de sudo ./pear channel-discover components.ez.no sudo ./pear channel-discover pear.symfony-project.com sudo ./pear install --alldeps phpunit/PHPUnit
- 檢查PEAR套件:
./pear list Installed packages, channel pear.php.net: ========================================= Package Version State Archive_Tar 1.3.7 stable Cache_Lite 1.7.12 stable Console_Getopt 1.3.1 stable PEAR 1.9.4 stable Structures_Graph 1.0.4 stable XML_Util 1.2.1 stable
- 製作終端機可執行的 phpunit 捷徑:
MAMP 1.9.x
sudo ln -s /Applications/MAMP/bin/php5.3/bin/phpunit /usr/bin/phpunit
MAMP 2.0.x
sudo ln -s /Applications/MAMP/bin/php/php5.3.6/bin/phpunit /usr/bin/phpunit
- 安裝 vfStream :
sudo ./pear channel-discover pear.php-tools.net sudo ./pear install pat/vfsStream-alpha
- 測試 phpunit 捷徑:
phpunit PHPUnit 3.5.15 by Sebastian Bergmann. Usage: phpunit [switches] UnitTest [UnitTest.php] phpunit [switches] ....
2011年8月22日 星期一
MAMP 2.0 透過 pear 安裝 PHPUnit
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言