我是 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>
Run Code Online (Sandbox Code Playgroud)
我收到以下错误消息
PHPUnit 7.5.16 由 Sebastian Bergmann 和贡献者编写。
警告 - 配置文件未通过验证!检测到以下问题:
第 4 行: - 元素“testsuits”:不需要此元素。
测试结果可能与预期不符。
你的文件有一个错字<testsuites>,not <testsuits>and also for<testsuite>而不是<testsuit>
见https://phpunit.readthedocs.io/en/8.3/configuration.html#the-testsuites-element