<?php
class DataTest extends PHPUnit_Framework_TestCase{
/**
* @dataProvider additionProvider
*/
public function testAdd($a, $b, $expected)
{
$this->assertEquals($expected, $a + $b);
}
public function additionProvider()
{
return array( array(0, 0, 0), array(0, 1, 1), array(1, 0, 1), array(1, 1, 3)
);
}
}?>
phpunit DataTestPHPUnit 4.2.0 by Sebastian Bergmann.
...F
Time: 0 seconds, Memory: 5.75Mb
There was 1 failure:
1) DataTest::testAdd with data set #3 (1, 1, 3)
Failed asserting that 2 matches expected 3.
/home/sb/DataTest.php:9
FAILURES!
Tests: 4, Assertions: 4, Failures: 1.