Can someone pls tell me how do I cover the following exception case in my PhpUnit test?
$DB->Insert(db query here...);
$lastInsertID = $DB->InsertID();
if (!$lastInsertID) {
throw new Exception('Unable to insert new record');
}
Thanks in advance
you could mock $DB->Insert
to return false