CakePHPのUnitテストで個別に実行する場合とAllTestsで結果が異なる問題が起きています。
他のテストの影響を受けているみたいなのですが、全部のUnitテストを手動で実行するのは骨が折れます。
なので、シェルスクリプトとまでは行きませんが、ファイルごとにUnitテストを実行するコマンドを書いてみました。
○単体でテストするコマンド
cd app/ find Test/Case/*/ -type f -name "*Test.php" -print | while read -r file; do test_class=$(echo ${file} | sed -e "s%Test/Case/\(.*\)Test\.php$%\1%") echo "test ${test_class}" Console/cake test --stderr app ${test_class} done
後は、Fixtureの作成が速く出来ればな~