gpt4 book ai didi

phpunit xml 配置颜色指令不起作用

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:49:34 25 4
gpt4 key购买 nike

我为单元测试定义了一个 phpunit.xml 配置文件。在此文件中,我指示在单元测试结果中显示颜色,如下所示:

<phpunit
...
colors="true"
...
</phpunit>

当我在命令行中运行测试时一切正常,除了结果中没有绿色和红色。

如果我删除配置文件并在命令行中使用参数--color=always,那么我会得到带有颜色的结果。

在配置文件中,我已经尝试将 colors="true" 更改为 colors="always" 但没有结果。

我的配置文件有问题吗?

这是我的 phpunit.xml 配置文件:

<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.1/phpunit.xsd"
backupGlobals="true"
backupStaticAttributes="false"
cacheTokens="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
forceCoversAnnotation="false"
mapTestClassNameToCoveredClassName="false"
printerClass="PHPUnit_TextUI_ResultPrinter"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
stopOnRisky="false"
testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader"
timeoutForSmallTests="1"
timeoutForMediumTests="10"
timeoutForLargeTests="60"
verbose="false">
<testsuites>
<testsuite name="examples">
<directory>/home/miguelbgouveia/Documents/projects/joomla/tests</directory>
<file>test_example.php</file>
</testsuite>
</testsuites>
</phpunit>

并且phpunit的版本是5.1.2

最佳答案

我通过删除行解决了这个问题

printerClass="PHPUnit_TextUI_ResultPrinter"

它看起来像以前,但有颜色。希望这也能解决您的问题

关于phpunit xml 配置颜色指令不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35153617/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com