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.
Thanks to Sebastian Bergmann, the solution is to use @testWith
:
/**
* @testWith [0, 0, 0]
* [0, 1, 1]
* [1, 1, 2]
* [1, 0, 1]
*/
public function testAdd($a, $b, $c)
{
$this->assertEquals($c, $a + $b);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With