I have the following test case:
include_once('../Logger.php');
class LoggerTest extends PHPUnit_Framework_TestCase {
public function providerLogger() {
return new Logger;
}
/**
* @dataProvider providerLogger
*/
public function testAddStream($logger) {
$this->assertTrue(false);
}
}
When I run it in PHPUnit, I get:
PHPUnit 3.4.14 by Sebastian Bergmann.
..........
Time: 0 seconds, Memory: 5.75Mb
OK (1 tests, 0 assertions)
Test should fail, but it doesn't. I tried having:
public function providerLogger() {
return array(new Logger);
}
But I get:
The data provider specified for LoggerTest::testAddStream is invalid.
I tried declaring it static
(like the manual says), but still no difference.
I remember having it working in a similar fashion before, but I could be wrong. What am I missing?
Thanks in advance for your help.
PHPUnit 3.4.14 (taken from PEAR) on PHP 5.3.3