We have the concept of data provider in PHPUnit . Data provider method provide arbitrary arguments. Like below
<code>
<?php
class DataTest extends PHPUnit_Framework_TestCase
{
/**
* @dataProvider provider
*/
public function testAdd($a, $b, $c)
{
$this->assertEquals($c, $a + $b);
}
public function provider()
{
return array(
array(0, 0, 0),
array(0, 1, 1),
array(1, 0, 1),
array(1, 1, 3)
);
}
}
?>
</code>
Now my question is that how i can do this for Qunit ????
There is QUnit addon to run parameterized tests: https://github.com/AStepaniuk/qunit-parameterize
I think that is what you are looking for.