備忘録程度に
FuelPHPでは、PHPUnitによるユニットテストを標準で用意していて、
oil test –group=Core~
って叩けばすぐにテストができるような環境が整っているんだけど、PHPUnitへのパスが引数で指定できないため、この部分を設定していないとこんな感じになる。
$ oil test --group=Core Tests Running...This may take a few moments. sh: phpunit: command not found
で、oilコマンド調べてみたんだけど、どうもoilパッケージを弄らないとダメっぽい。
こんな感じに
// -fuel/packages/oil/classes/command.phpの176行目あたり // $command = 'cd '.DOCROOT.'; phpunit -c "'.$phpunit_config.'"'; $command = 'cd '.DOCROOT. '; /path/to/phpunit -c "'.$phpunit_config. '"';
調整後再度トライ。
$ oil test --group=Core Tests Running...This may take a few moments. PHPUnit 3.7.12 by Sebastian Bergmann. Configuration read from /export/home/watanabe-naoto/www/tokyo-shoseki/fuel/core/phpunit.xml ............................................................... 63 / 306 ( 20%) ............................................................... 126 / 306 ( 41%) ............................................................... 189 / 306 ( 61%) ............................................................... 252 / 306 ( 82%) ...................................................... Time: 5 seconds, Memory: 25.25Mb OK (306 tests, 274 assertions)
PHPUnitへのエイリアスを貼ればいいだけの話なんだろうけど、参考程度に