I am making unit tests and after creating a test that covers all test cases xDebug does not show some of my code as covered.
The 'slide' and default cases are shown as not covered even though I have test cases that cover both.
switch ($fileType) {
case "video":
case "pdf":
//save content to file name
Storage::put($path . $key . '.' . $ext, File::get($file));
//save data to db
$dataId = $key;
break;
case "slide":
Storage::makeDirectory($path . $key);
$i = 1;
foreach ($file as $f) {
Storage::put($path . $key . '/slide-' . $i++ . '.' . $ext, File::get($f));
}
$dataId = $key . '-' . --$i;
break;
default:
return false;
break;
}