【发布时间】:2016-06-24 16:39:07
【问题描述】:
我在 Laravel 5.2 中做了一个项目,它的源代码部署在 github here。我在使用 PHPUnit 测试项目并与 Travis-CI 集成时遇到问题。
这是我的 Travis-CI 配置文件:
language: php
php:
- 5.6
before_script:
- cp .env.travis .env
- mysql -e 'create database homestead_test;'
- composer self-update
- composer install --no-interaction
- php artisan key:generate
script:
- vendor/bin/phpunit
这是我的 PHPUnit.xml 文件:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="bootstrap/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Application Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory>
<exclude>
<file>./app/Http/routes.php</file>
</exclude>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
</php>
</phpunit>
其他文件可以在我的存储库中看到。如果您需要任何说明,请在下方评论。
我的 travis Build 可以看到here。
这是我在 Travis 构建中遇到的错误:
PHP Warning: require(/home/travis/build/TheOpenBlog/TheOpenBlog/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/travis/build/TheOpenBlog/TheOpenBlog/bootstrap/autoload.php on line 17
【问题讨论】:
标签: php database laravel-5.2 travis-ci