Phingでブートストラップファイルを使用してPHPUnitテストスイートを実行するには?
私のアプリの構造:
application/
library/
tests/
application/
library/
bootstrap.php
phpunit.xml
build.xml
phpunit.xml:
<phpunit bootstrap="./bootstrap.php" colors="true">
<testsuite name="Application Test Suite">
<directory>./</directory>
</testsuite>
<filter>
<whitelist>
<directory
suffix=".php">../library/</directory>
<directory
suffix=".php">../application/</directory>
<exclude>
<directory
suffix=".phtml">../application/</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
それから:
cd /path/to/app/tests/
phpunit
#all test passed
しかし、どうすれば/path/to/app/
dir からテストを実行できますか? 問題は、bootstrap.php
ライブラリとアプリケーションへの相対パスに依存することです。
実行するphpunit --configuration tests/phpunit.xml /tests
と、たくさんのファイルが見つからないというエラーが発生しました。
同じ方法でテストを実行するためのbuild.xml
ファイルを作成するにはどうすればよいですか?phing
phpunit.xml