protected function setUp() { parent::setUp(); $this->controller = new CrudController(); $sm = new ServiceManagerTestCase(); $this->controller->setServiceLocator($sm->getServiceManager()); $pluginManager = $this->getMock('Zend\\Mvc\\Controller\\PluginManager', array('get')); $pluginManager->expects($this->any())->method('get')->will($this->returnCallback(array($this, 'helperMockCallbackPluginManagerGet'))); $this->pluginManager = $pluginManager; $this->controller->setPluginManager($pluginManager); }