gpt4 book ai didi

unit-testing - 如何从 xml 配置中的 PHPUnit 测试套件中排除文件?

转载 作者:行者123 更新时间:2023-12-03 07:37:28 26 4
gpt4 key购买 nike

我有以下非常简单的 PHPUnit XML 配置:

<phpunit bootstrap="/_tests/TestAutoload.php">
<testsuites>
<testsuite name="Unit Tests">
<directory suffix=".php">_tests</directory>
</testsuite>
</testsuites>
</phpunit>

如何从测试套件中排除此目录中的某些文件?我试过<exclude><blacklist> ,但在这种情况下似乎不起作用。除了 phpunit.de 之外也找不到任何其他文档一个,其中没有提及任何相关内容。除此之外,这个配置工作得很好。

最佳答案

排除文件名TestCase.php

将其添加到您的phpunit.xml

<testsuites>
<testsuite name="BLABLA">
<directory suffix=".php">./tests</directory>
<exclude>./tests/TestCase.php</exclude>
</testsuite>
</testsuites>
<小时/>

这是 a real-live test-suite 的附加摘录我可以确认它可以与:

...
<testsuites>
<testsuite name="n98-magerun-tests">
<directory>./tests</directory>
<exclude>tests/N98/Magento/Command/Installer/UninstallCommandTest.php</exclude>
</testsuite>
...

关于unit-testing - 如何从 xml 配置中的 PHPUnit 测试套件中排除文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2736343/

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