Slide 36
Slide 36 text
Unit test for type-checked function
/**
* @dataprovider provideIncInvalid
*/
function testIncRejectsInvalid($a) {
try {
inc($a);
$this->fail('Expected exception');
} catch (InvalidArgumentException $ex) {}
}
function provideIncInvalid() {
return array(
null, true, "string", array()
);
}