php - PHPunit 警告错误测试套件不是预期的
问题描述
我是使用 PHPunit 的新手。我用 composer 安装了 PHPunit 并创建了一个 phpunit.xml 文件:
<?xml version="1.0" encoding="UTF-8" ?>
<phpunit bootstrap="vendor/autoload.php" colors="true">
<testsuits>
<testsuit name="unit">
<directory>tests</directory>
</testsuit>
</testsuits>
</phpunit>
我收到以下错误消息
Sebastian Bergmann 和贡献者的 PHPUnit 7.5.16。
警告 - 配置文件未通过验证!已检测到以下问题:
第 4 行: - 元素“testsuits”:不需要此元素。
测试结果可能不如预期。
解决方案
您的文件有错字,<testsuites>
而不是<testsuits>
,也为,<testsuite>
而不是<testsuit>
见https://phpunit.readthedocs.io/en/8.3/configuration.html#the-testsuites-element
推荐阅读
- node.js - Node-Windows - 在登录屏幕上运行 GUI 应用程序
- css - 在将文本全部放入另一列之前,如何更喜欢将文本换行?
- ios - iPhone X 上的 react-native-router-flux 标签栏样式
- julia - 如何在 Julia 1.0 中做 memoization 或 memoisation
- c# - 将任何 DateTime 值转换为 UTC
- kubernetes - Kong Ingress 控制器说明
- javascript - 在构建 angular-6 应用程序时遇到此错误,我该如何解决?
- python - 单击 Windows 应用程序并使用 pywinauto 输入文本
- c++ - 共享内存数组中两个单元格的差异(并发)
- javascript - 如何在 Node js 中同步使用串口?