Am using PHPUnit for unit testing my functions when ever any warning comes in code the test script will not be executed for that functions, can anyone tell me how to ignore
The documentented strategy to do this at a per-test level is to use the @
error suppression operator when your test calls the function that would trigger a warning or notice.
The following code is the example from the PHPUnit documentation:
assertFalse(@$writer->write('/is-not-writeable/file', 'stuff'));
}
}
class FileWriter
{
public function write($file, $content) {
$file = fopen($file, 'w');
if($file == false) {
return false;
}
// ...
}
}