[英]PhpUnit inline DataProvider
Is there a way to specify the test parameters directly in the annotation ?有没有办法直接在注释中指定测试参数? Something like this :
像这样的事情:
/**
* @dataProvider [[0, 0, 0], [0, 1, 1], [1, 0, 1]]
*/
public function testAdd($a, $b, $expected)
{
$this->assertEquals($expected, $a + $b);
}
Because it can be useful when the DataProvider is used only once with simple data set.因为当 DataProvider 仅对简单数据集使用一次时,它会很有用。
您描述的内容已添加到PHPUnit 4.8 中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.