PHPUnitのインストール

GrowthPush SDK for PHPのために久しぶりにPHPを書きまして、PHPUnitをインストールしようとしたら失敗したのでインストールメモを書いておきます。

スクリーンショット 2013-08-19 19.45.36

以前書いた「watchrでファイル更新時にPHPUnitを走らせる。」のメモにしたがってやろうとしたらいきなり失敗しました。

$ sudo pear install phpunit/phpunit
Attempting to discover channel "phpunit"...
Attempting fallback to https instead of http on channel "phpunit"...
unknown channel "phpunit" in "phpunit/phpunit"
invalid package name/package file "phpunit/phpunit"
install failed

GitHubのsebastianbergmann/phpunitのインストールガイドを見て再挑戦しますが、玉砕。

$ pear config-set auto_discover 1
config-set succeeded
$ pear install pear.phpunit.de/PHPUnit
Attempting to discover channel "pear.phpunit.de"...
downloading channel.xml ...
Starting to download channel.xml (804 bytes)
....done: 804 bytes
Auto-discovered channel "pear.phpunit.de", alias "pear.phpunit.de", adding to registry
unknown channel "pear.phpunit.de" in "pear.phpunit.de/PHPUnit"
invalid package name/package file "pear.phpunit.de/PHPUnit"
install failed

最終的に、unknown channel “pear.phpunit.de”を見て、sudoしたらいけました。

$ sudo pear install pear.phpunit.de/PHPUnit
Attempting to discover channel "pear.phpunit.de"...
downloading channel.xml ...
Starting to download channel.xml (804 bytes)
....done: 804 bytes
Auto-discovered channel "pear.phpunit.de", alias "phpunit", adding to registry
Attempting to discover channel "pear.symfony.com"...
downloading channel.xml ...
Starting to download channel.xml (811 bytes)
...done: 811 bytes
Auto-discovered channel "pear.symfony.com", alias "symfony2", adding to registry
Did not download optional dependencies: phpunit/PHP_Invoker, use --alldeps to download automatically
phpunit/PHPUnit can optionally use package "phpunit/PHP_Invoker" (version >= 1.1.0, version <= 1.1.99)
phpunit/PHP_CodeCoverage can optionally use PHP extension "xdebug" (version >= 2.0.5)
downloading PHPUnit-3.7.24.tgz ...
// ...()...
install ok: channel://pear.phpunit.de/PHPUnit-3.7.24

終わりです。

About katty0324

Comments are closed.

Scroll To Top