我在尝试在Travis CI上运行PHP单元测试时遇到一个奇怪的问题。PHPUnit“无法读取phpunit.xml”在Travis CI上
.travis.yml
sudo: false
language: php
php:
- 5.4
env:
- VUFIND_HOME=$PWD VUFIND_LOCAL_DIR=$PWD/local
before_script:
- pear install pear/PHP_CodeSniffer
- pear channel-discover pear.phing.info
- pear install phing/phing
- composer global require fabpot/php-cs-fixer
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- phpenv rehash
script:
- phpunit --stderr --configuration module/VuFind/tests/phpunit.xml
- phpunit --stderr --configuration module/Swissbib/tests/phpunit.xml
- phpcs --standard=PEAR --ignore=*/config/*,*/tests/* --extensions=php $PWD/module
- phing php-cs-fixer-dryrun
模块/ VuFind /测试/ phpunit.xml是第三方框架
模块/ Swissbib /测试/ phpunit.xml是我们自己的代码
模块/ Swissbib /测试/ phpunit.xml
<phpunit bootstrap="Bootstrap.php">
<testsuites>
<testsuite name="sbvfrd">
<directory>.</directory>
</testsuite>
</testsuites>
</phpunit>
来自第三方框架的测试无误地运行。我们自己的测试不起作用,我们收到错误信息:
$ phpunit --stderr --configuration module/Swissbib/tests/phpunit.xml
Could not read "module/Swissbib/tests/phpunit.xml".
本地(Mac OS X)所有测试都运行完毕。奇怪的是,模块/ Swissbib/tests/phpunit.xml中定义的Bootstrap.php完全通过Travis CI运行,我使用echo语句验证了这一点。尽管如此,phpunit告诉我们它无法读取phpunit.xml。
特拉维斯:https://travis-ci.org/swissbib/vufind
回购:https://github.com/swissbib/vufind(开发分支)
任何想法可能是想错了?