PHPUnit インストール(Mac OS X 編)
環境
PHP5.3、PEAR1.9
xdeubg のインストール
sudo pecl install xdebug
php.ini
zend_extension=/opt/local/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so zend_debugger.allow_hosts = 127.0.0.1 zend_debugger.expose_remotely = always
OKな手順
sudo pear install -a phpunit/PHPUnit
余談:つまずきその1
pear install -a phpunit/PHPUnit
PHP Fatal error: Call to undefined method PEAR::raiseErro() in /usr/share/php/PEAR/REST.php on line 165
このエラーは、単純に、書き込み権限が無いときに出るエラー。sudo つければ出ないので気にしない。
つまずきその2
Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 38
となってなぜだろうと思って、よーーく見たら、
php-cli.ini の、include_path 指定をタイプミスしていたからNGになっていただけだった。。。
参考にしたURL
http://stackoverflow.com/questions/1528717/phpunit-require-once-error
http://pear.php.net/manual/en/installation.checking.php
php -c /path/to/php.ini -r 'echo get_include_path()."\n";'
は便利かも。