I’m currently writing unit tests for various parts of my system and have hit upon issue. How do I test the below function, I don’t have an actual database connected so I need to mock my Job model but I’m unsure how to mock the findByPk() call. Any suggestions?
public function transform($value)
{
$intValue = (int)trim($value, '"');
$job = \Job::model()->findByPk($intValue);
....