PHPunit在Travis CI上不执行测试
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了PHPunit在Travis CI上不执行测试,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1805字,纯文字阅读大概需要3分钟。
内容图文
![PHPunit在Travis CI上不执行测试](/upload/InfoBanner/zyjiaocheng/662/e0cede9788c0455eab5c82ced3f957a8.jpg)
我第一次关注PHPUnit教程,并且我的测试在本地运行良好.但是,在Travis CI上运行测试时,不执行任何测试,并且构建以0退出.
我的目录结构和完整代码可以在repo上看到.
Travis CI (Full build log)的构建日志
1.51s$curl -s http://getcomposer.org/installer | php
#!/usr/bin/env php
All settings correct for using Composer
Downloading...
Composer successfully installed to: /home/travis/build/idavidmcdonald/phpunit-tutorial/composer.phar
Use it: php composer.phar
before_script.2
0.33s$php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
0.08s$vendor/bin/phpunit --debug
PHPUnit 3.7.14 by Sebastian Bergmann.
Configuration read from /home/travis/build/idavidmcdonald/phpunit-tutorial/phpunit.xml
Time: 13 ms, Memory: 2.00Mb
No tests executed!
The command "vendor/bin/phpunit --debug" exited with 0.
Done. Your build exited with 0.
phpunit.xml:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true" bootstrap="vendor/autoload.php">
<testsuites>
<testsuite name="Application Test Suite">
<directory>phpunittutorial/tests/</directory>
</testsuite>
</testsuites>
</phpunit>
.travis.yml:
language: php
php:
- 5.4
- 5.5
before_script:
- curl -s http://getcomposer.org/installer | php
- php composer.phar install
script: vendor/bin/phpunit --debug
我的测试在本地成功运行,但是我的phpunit.xml文件是否存在问题?
解决方法:
包含测试的目录不正确.
正确的路径是phpUnitTutorial / tests.请注意,Windows并不关心区分大小写,但世界上其他所有人都关心.最好的办法是始终对路径使用小写字母,或者仔细检查您在各处使用的大小写是否正确(PSR-0和PSR-4要求路径名与类名具有相同的大小写,通常包括大写字母).
顺便说一句:您可能应该升级到最新版本的PHPUnit.那个旧的3.7系列已经很多年没有更新了,向4.x的过渡也不是那么陡峭-您应该这样做.
内容总结
以上是互联网集市为您收集整理的PHPunit在Travis CI上不执行测试全部内容,希望文章能够帮你解决PHPunit在Travis CI上不执行测试所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。