tjtjtjのメモ

自分のためのメモです

phpunit のインストール

明日の自分へ。たぶん思い出せないだろうから書いておきます。
PHPUnitインストールしておきましたよ。
VC9にするためxampp1.7.5betaにしたのは知っていました、が、諸々アップデートを怠っていましたね。PHPUnitインストールしておきましたよ。使うんでしょう。

http://lazesoftware.com/blog/11/0213/
のようにやり、諸々updateできましたが、PHPUnitは入れられませんでした。

C:\xampp\php>pear install --alldeps phpunit/PHPUnit
No releases available for package "pear.phpunit.de/PHPUnit"
install failed

んで
http://stackoverflow.com/questions/2006626/installing-phpunit-via-pear
にあるように
pear clear-cache
としたらインストールできましたよ。よかったね。

C:\xampp\php>pear install --onlyreqdeps phpunit/PHPUnit
phpunit/PHPUnit can optionally use PHP extension "dbus"
phpunit/PHP_CodeCoverage can optionally use PHP extension "xdebug" (version >= 2
.0.5)
downloading PHPUnit-3.5.14.tgz ...
Starting to download PHPUnit-3.5.14.tgz (118,697 bytes)
..........................done: 118,697 bytes
downloading DbUnit-1.0.2.tgz ...
Starting to download DbUnit-1.0.2.tgz (39,231 bytes)
...done: 39,231 bytes
downloading File_Iterator-1.2.6.tgz ...
Starting to download File_Iterator-1.2.6.tgz (3,439 bytes)
...done: 3,439 bytes
downloading Text_Template-1.1.0.tgz ...
Starting to download Text_Template-1.1.0.tgz (2,783 bytes)
...done: 2,783 bytes
downloading PHP_CodeCoverage-1.0.4.tgz ...
Starting to download PHP_CodeCoverage-1.0.4.tgz (115,029 bytes)
...done: 115,029 bytes
downloading PHP_Timer-1.0.0.tgz ...
Starting to download PHP_Timer-1.0.0.tgz (2,536 bytes)
...done: 2,536 bytes
downloading PHPUnit_MockObject-1.0.9.tgz ...
Starting to download PHPUnit_MockObject-1.0.9.tgz (18,414 bytes)
...done: 18,414 bytes
downloading PHPUnit_Selenium-1.0.3.tgz ...
Starting to download PHPUnit_Selenium-1.0.3.tgz (16,587 bytes)
...done: 16,587 bytes
downloading PHP_TokenStream-1.0.1.tgz ...
Starting to download PHP_TokenStream-1.0.1.tgz (7,250 bytes)
...done: 7,250 bytes
install ok: channel://pear.phpunit.de/DbUnit-1.0.2
install ok: channel://pear.phpunit.de/File_Iterator-1.2.6
install ok: channel://pear.phpunit.de/Text_Template-1.1.0
install ok: channel://pear.phpunit.de/PHP_Timer-1.0.0
install ok: channel://pear.phpunit.de/PHPUnit_Selenium-1.0.3
install ok: channel://pear.phpunit.de/PHP_TokenStream-1.0.1
install ok: channel://pear.phpunit.de/PHP_CodeCoverage-1.0.4
install ok: channel://pear.phpunit.de/PHPUnit_MockObject-1.0.9
install ok: channel://pear.phpunit.de/PHPUnit-3.5.14

C:\xampp\php>phpunit
PHPUnit 3.5.14 by Sebastian Bergmann.

Usage: phpunit [switches] UnitTest [UnitTest.php]
phpunit [switches]

--log-junit Log test execution in JUnit XML format to file.
--log-tap Log test execution in TAP format to file.
--log-dbus Log test execution to DBUS.
--log-json Log test execution in JSON format.

そうそう、コマンドプロンプトは管理者で起動するべきです。ディレクトリがつくれないとか言いやがるので。しかしxamppには、何故PHPUnit1.7とかPHPUnit2とか入ってんやがんでしょうね。