gpt4 book ai didi

phpunit - 如何在 phpunit 中运行来自数据提供程序的特定数据

转载 作者:行者123 更新时间:2023-12-05 00:57:57 24 4
gpt4 key购买 nike

如果我只想使用来自数据提供者的一个数据运行测试,我该怎么做?

我在这个线程上尝试了解决方案,但没有奏效
Cannot run single test with data provider in PHPUnit

最佳答案

我发现只需添加 #n只适用于数字索引的数据提供者。

phpunit --filter ClassName::testName#datasetNumber

添加 @name用于关联索引的命名数据提供程序。
phpunit --filter ClassName::testName@datasetName

或者您可以使用正则表达式。见 documentation更多例子。

关于phpunit - 如何在 phpunit 中运行来自数据提供程序的特定数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33792357/

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