在phpunit测试中没有显示颜色

时间:2014-06-04 13:51:12

标签: ubuntu phpunit

我正在使用Symfony2并在app / phpunit.xml.dist下

我打开了颜色选项。

<phpunit
    ...
    colors = "true"
    ...

我在Ubuntu 14.04下使用ssh并使用PHPUnit 4.1.1。

我通过Symfony2中包含的bin执行我的测试。

bin/phpunit src/Acme/Bundle/Tests

我在网上发现的唯一一件事就是让颜色关闭但不进行故障排除才能启用它们。

还有什么我需要做的才能让颜色显示出来吗?

1 个答案:

答案 0 :(得分:1)

似乎phpunit没有得到正确的配置。

来自Symfony documentation:

The -c option tells PHPUnit to look in the app/ directory for a configuration file. If you're curious about the PHPUnit options, check out the app/phpunit.xml.dist file.

而且,正如您正确找到的那样,用法如下:

bin/phpunit -c app/ sometestdir

有了这个,你告诉phpunitapp/目录中获取配置,然后测试sometestdir文件夹。

:)

http://phpunit.de/manual/current/en/textui.html#textui.clioptions

的更多信息