I want to run a bunch of tests with one object with different parameters in the setUp function.
How should I do it? I tried using @dataProvider, but this does not work with setUp, which I quickly discovered.
Here is what I would like to do (using @dataProvider):
function setUp($namespace, $args) {
$this->tag = new Tag($namespace, $args);
}
function provider() {
return array(
array('hello', array()),
array('world', array())
);
}
function testOne() {
}
function testTwo() {
}
As a result, testOne () and testTwo () are launched against the object with the namespace "hello" and the object with the namespace "world"
Any help would be greatly appreciated!
Thanks Matt
source
share