Mac os x lion MAMP中安装phpunit

1.检测本机是否安装了pear以及php的执行路径

1
2
3
4
$ pear
- bash : pear: command not found
$ which php
/usr/bin/php

2.将NAMP的php执行目录指向到系统执行目录

1
$ echo "export PATH=/Applications/MAMP/bin/php/php5.3.6/bin:$PATH" >> ~/.profile

3.验证MAMP中php的执行路径是否指向成功

1
2
3
4
$ which php
/Applications/MAMP/bin/php/php5 .3.6 /bin/php
$ which pear
/Applications/MAMP/bin/php/php5 .3.6 /bin/pear

4.添加下载镜像路径

1
2
3
4
5
6
7
8
$ pear channel-discover pear.drush.org
Adding Channel "pear.drush.org" succeeded
Discovery of channel "pear.drush.org" succeeded
$ pear install drush /drush
downloading drush-4.5.0.tgz ...
Starting to download drush-4.5.0.tgz (281,392 bytes)
......................................................... done : 281,392 bytes
install ok: channel: //pear .drush.org /drush-4 .5.0

5.安装并更新phpunit

1
2
3
4
5
6
7
8
9
10
cd /Applications/MAMP/bin
ln -s php5.3 php5
php5 /bin/pear channel-discover pear.phpunit.de
php5 /bin/pear channel-discover components.ez.no
php5 /bin/pear channel-discover pear.symfony-project.com
php5 /bin/pear channel-update pear.php.net
php5 /bin/pear upgrade pear
php5 /bin/pear install phpunit /PHPUnit
ln -s /Applications/MAMP/bin/php5/bin/phpunit /usr/local/bin/phpunit
phpunit --version

你可能感兴趣的:(Mac os x lion MAMP中安装phpunit)