Php 特拉维斯做了一次失败的测试

Php 特拉维斯做了一次失败的测试,php,phpunit,travis-ci,Php,Phpunit,Travis Ci,我是travis ci的新手,但我不明白为什么通过的测试会失败 下面是一个场景。我在github有一个回购协议,结构是这样的 src/ repo_name/ /foo.class.php test/ bootstrap.php repo_name/ testFoo.class.php .travis.yml phpunit.xml composer.json 以下是.travis.yml language: php php: - 5.5 - 5

我是travis ci的新手,但我不明白为什么通过的测试会失败

下面是一个场景。我在github有一个回购协议,结构是这样的

 src/
   repo_name/
      /foo.class.php

test/
  bootstrap.php
  repo_name/
      testFoo.class.php
.travis.yml
phpunit.xml
composer.json
以下是
.travis.yml

language: php
php:
  - 5.5
  - 5.4
下面是phpunit.xml的内容

<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         syntaxCheck="false"
         bootstrap="test/bootstrap.php"
        >
    <testsuites>
        <testsuite name="First Tests">
            <directory>./test/</directory>
        </testsuite>
    </testsuites>

    <filter>
        <whitelist>
            <directory>./src/</directory>
        </whitelist>
    </filter>
</phpunit>

必须是因为它不能包含引导文件。 无法打开文件“/home/travis/build/repo_name/repo_name/test/bootstrap.php”

我不只是把
script:phpunit
放在.travis.yml中,而是放:

script:phpunit——配置phpunit.xml

<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         syntaxCheck="false"
         bootstrap="test/bootstrap.php"
        >
    <testsuites>
        <testsuite name="First Tests">
            <directory>./test/</directory>
        </testsuite>
    </testsuites>

    <filter>
        <whitelist>
            <directory>./src/</directory>
        </whitelist>
    </filter>
</phpunit>

我已经对此进行了测试,它可以与您的设置一起使用。

如果单击作业id(),您将看到一个带有控制台输出的页面,这可能有助于隔离问题。@AlexandruG。好啊我已经添加了错误消息。我还是不明白为什么它不需要这些文件。我可以在找到
phpunit.xml
的目录中简单地运行
phpunit
,一切都很好。你能给我一个链接到你的Travis版本吗?