nickturner/PHPUnit_Html — Issue #1: second test with dataProvider fails
Author: evpozdniakov
Created: 2011-10-26 18:40:54+00:00
State: open

Hello, nickturner!

I've just started using PHPUnit_Html and I like it! But recently I've discovered a problem. It is about using tests with data providers. I'm going to try describing the problem. Sorry for my english, which is not perfect.

So, when I create my first test with data provider, it seems to bee all fine — I see the test results on my web page. But if I add one more test with data provider, the result page doesn't change — I see results of the first test but can't see results of the second...

Below you are my code. The test example is taken from http://www.phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.data-providers

Hope you'll manage this problem, and thank you for your work!

class MyTest 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)
);
}

/**
* @dataProvider provider2
*/
public function testAdd2($a, $b, $c)
{
$this->assertEquals($c, $a + $b);
}

public function provider2()
{
return array(
array(0, 0, 0),
array(0, 1, 1),
array(1, 0, 1),
array(1, 1, 2)
);
}
}