Hello,
I have a query about PHPUnit. How do I create a test case in PHPUnit for cases that are NOT handled in the base class itself. For example, Please Consider the following showMessage method.
Class Message
{
public function showMessage($type = 1)
{
if(1 == $type){
return 'Success';
}elseif(2 == $type){
return 'ERROR';
}
}
}
In the showMessage method above, there should also be a case that if the $type is anything other than 1 or 2, so it should have a else case, so the conditions should be something like
if(1 == $type){
return 'Success';
}elseif(2 == $type){
return 'ERROR';
}else{
return 'UNKNOWN';
}
Thanks for any inputs