小编Edd*_*eka的帖子

为什么 PHPUnit 9 不期望记录 phpunit.xml.dist 的 log 子元素

我目前正在将旧的 PHP 应用程序(超过 10 年)转换到 PHP 7.4,我们目前正在应用程序的 PHP 7.4 分支上实现持续集成。我们决定使用 PHP 当前稳定版本支持的 PHPUnit 版本。所以我们将 PHP 7.4 分支的 ci 测试工作升级到了 PHPUnit 9.3。

我们根据文档进行了所有必要的更改,但是我们因一个我们不知道如何修复的警告而被阻止(授予测试执行并且报告发布在正确的位置)警告 - 配置文件未通过验证!

  The following problems have been detected:

  Line 38:
  - Element 'log': This element is not expected..
Run Code Online (Sandbox Code Playgroud)

我在下面分享我们的 PHPUnit 配置,并使用我们用来启动它的命令,任何人都可以发现它有什么问题吗?

phpunit -c phpunit.xml.dist


<?xml version="1.0" encoding="UTF-8"?>
<phpunit
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.3/phpunit.xsd"
         colors                      = "true"
         bootstrap                   = "tests/bootstrap.php"
         >

    <testsuites>
        <testsuite name="Unit Tests">
            <directory>tests/</directory>
        </testsuite>
    </testsuites>
    <coverage>
        <include>
            <directory suffix=".php">api</directory>
        </include>
    </coverage>
    <logging>
        <log type="junit" target="build/unit_report.xml"/>
    </logging>
</phpunit>
Run Code Online (Sandbox Code Playgroud)

php phpunit

1
推荐指数
1
解决办法
1012
查看次数

标签 统计

php ×1

phpunit ×1