I am following the guide from Zend Framework 2's website on Unit Testing. My 'skeleton' app differs from the tutorial slightly in that I have integrated Doctrine 2 instead of using Zend's built in DB adapter.
Within the indexAction() of my AlbumController.php I am using the following snippet to retrieve all album records:
return new ViewModel(array(
'albums' => $this->getEntityManager()->getRepository('Album\Entity\Album')->findAll()
));
How can I mock this in testIndexActionCanBeAccessed() within the IndexControllerTest.php file so that it returns dummy values?
Appreciate the help.