如何使用phing运行带bootstrap文件的PHPUnit测试套件?phing和phpunit + bootstrap
我的应用程序结构:
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
相同的方式运行测试?
感谢。这或多或少是我的'bootstrap.php'。我的问题是我不知道我可以用这种方式指定引导参数:'phpunit --bootstrap tests/bootstrap.php --configuration tests/phpunit.xml' – takeshin 2010-09-10 18:10:03
这对我来说很新鲜,感谢评论! – opHASnoNAME 2010-09-11 06:10:09