php - 使用数据提供者时压倒性的 testdox 输出(具有大量数据集)
问题描述
我们在单元测试中使用具有大量数据集的数据提供者。对于每个数据集,PHPUnit 在 testdox 输出中打印一行。在我们的例子中,这是压倒性的,使得 testdox 的输出非常难以阅读,因此毫无用处。
我找不到让 PHPUnit 在 testdox 输出中每次测试只打印一行的配置设置或注释(不管 dataprovider 返回的数据集数量)。
有没有一种方法可以让 PHPUnit 在 testdox 输出中每次测试只打印一行(无论 dataprovider 返回的数据集数量如何)?
我们使用 PHPUnit 8.4.1 和 PHP 7.2.20。
--- 编辑:添加示例 ---
这是我们当前 Testdox 输出的片段:
...
✔ Returns the cross amount to be used for the account for all appropriate accounting records with data set 805
✔ Returns the cross amount to be used for the account for all appropriate accounting records with data set 806
✔ Returns the cross amount to be used for the account for all appropriate accounting records with data set 807
✔ Returns the cross amount to be used for the account for all appropriate accounting records with data set 808
✔ Returns the cross amount to be used for the account for all appropriate accounting records with data set 809
✔ Returns the cross amount to be used for the account for all appropriate accounting records with data set 810
✔ Returns the cross amount to be used for the account for all appropriate accounting records with data set 811
✔ Returns the cross amount to be used for the account for all appropriate accounting records with data set 812
✔ Returns the cross amount to be used for the account for all appropriate accounting records with data set 813
✔ Returns the cross amount to be used for the account for all appropriate accounting records with data set 814
✔ Returns the cross amount to be used for the account for all appropriate accounting records with data set 815
✔ Returns the net amount to be used for the contra account for taxable aktivkonto an aufwandkonto accounting records
✔ Returns the net amount to be used for the contra account for taxable aktivkonto an ertragkonto accounting records
✔ Returns the net amount to be used for the contra account for taxable kundenkonto an aktivkonto accounting records
✔ Returns the net amount to be used for the contra account for taxable kundenkonto an ertragkonto accounting records
✔ Returns the net amount to be used for the contra account for taxable lieferantenkonto an aufwandkonto accounting records
✔ Returns the cross amount to be used for the contra account for all appropriate accounting records with data set 0
✔ Returns the cross amount to be used for the contra account for all appropriate accounting records with data set 1
✔ Returns the cross amount to be used for the contra account for all appropriate accounting records with data set 2
✔ Returns the cross amount to be used for the contra account for all appropriate accounting records with data set 3
✔ Returns the cross amount to be used for the contra account for all appropriate accounting records with data set 4
✔ Returns the cross amount to be used for the contra account for all appropriate accounting records with data set 5
✔ Returns the cross amount to be used for the contra account for all appropriate accounting records with data set 6
✔ Returns the cross amount to be used for the contra account for all appropriate accounting records with data set 7
✔ Returns the cross amount to be used for the contra account for all appropriate accounting records with data set 8
✔ Returns the cross amount to be used for the contra account for all appropriate accounting records with data set 9
✔ Returns the cross amount to be used for the contra account for all appropriate accounting records with data set 10
✔ Returns the cross amount to be used for the contra account for all appropriate accounting records with data set 11
...
这可能是一个更精简的输出,例如,如果没有数据集会让测试失败:
...
✔ Returns the cross amount to be used for the account for all appropriate accounting records
✔ Returns the net amount to be used for the contra account for taxable aktivkonto an aufwandkonto accounting records
✔ Returns the net amount to be used for the contra account for taxable aktivkonto an ertragkonto accounting records
✔ Returns the net amount to be used for the contra account for taxable kundenkonto an aktivkonto accounting records
✔ Returns the net amount to be used for the contra account for taxable kundenkonto an ertragkonto accounting records
✔ Returns the net amount to be used for the contra account for taxable lieferantenkonto an aufwandkonto accounting records
✔ Returns the cross amount to be used for the contra account for all appropriate accounting records
...
解决方案
不,没有这样的设置。而且我认为添加它不会有用。您可能想要查看@testdox
注释以及在此处使用变量(来自数据提供者参数)以产生更有用的输出的可能性。
推荐阅读
- r - 如何在具有大量互连的大型网络分析的 R 中组织布局
- android - 得到一个不会让 apk 运行的编译错误
- python - 如何修复显示为“{”而不是“a”的替换字母,这就是它的意思
- c# - 无法从soap c#SoapHttpClientProtocol创建SSL/TLS安全通道
- python - 如何在不使用任何库的情况下向服务器发送 HTTP 请求并在 python 中获得答案
- laravel - 是否有使用 vuejs 在 laravel 中访问关系的动态方式?
- google-cloud-run - Google Cloud Run 是否允许您在 Java 中生成额外的线程?
- python-3.x - 如何使用字典或其他方法将 df1 传输到 df2
- java - 何时在方法上使用 java 函数接口?
- c# - 使用c#应用和firebase认证登录