public function setUp() { $this->application = $this->getMock('Zend\\Mvc\\Application', array(), array(), '', false); $this->event = $this->getMock('Zend\\Mvc\\MvcEvent'); $this->serviceManager = $this->getMock('Zend\\ServiceManager\\ServiceManager'); $this->cli = $this->getMock('Symfony\\Component\\Console\\Application', array('run')); $this->serviceManager->expects($this->any())->method('get')->with('doctrine.cli')->will($this->returnValue($this->cli)); $this->application->expects($this->any())->method('getServiceManager')->will($this->returnValue($this->serviceManager)); $this->event->expects($this->any())->method('getTarget')->will($this->returnValue($this->application)); }
public function setUp() { $this->module = new Module(); $this->app = $this->getMockBuilder('Zend\\Mvc\\Application')->disableOriginalConstructor()->getMock(); $sm = new ServiceManager(new Config(['services' => ['translator' => Translator::factory(['locale' => 'id_ID'])]])); $this->app->expects($this->any())->method('getServiceManager')->willReturn($sm); $em = new EventManager(); $em->setSharedManager(new SharedEventManager()); $this->app->expects($this->any())->method('getEventManager')->willReturn($em); }
private function setUpApplication() { $this->request = $this->getMockBuilder('Zend\\Http\\PhpEnvironment\\Request')->disableOriginalConstructor()->getMock(); $this->response = $this->getMockBuilder('Zend\\Http\\PhpEnvironment\\Response')->disableOriginalConstructor()->getMock(); $this->routeMatch = $this->getMockBuilder('Zend\\Mvc\\Router\\RouteMatch')->disableOriginalConstructor()->getMock(); $this->mvcEvent = $this->getMockBuilder('Zend\\Mvc\\MvcEvent')->disableOriginalConstructor()->getMock(); $this->mvcEvent->expects($this->any())->method('getRouteMatch')->will($this->returnValue($this->routeMatch)); $this->application->expects($this->any())->method('getMvcEvent')->will($this->returnValue($this->mvcEvent)); $this->application->expects($this->any())->method('getRequest')->will($this->returnValue($this->request)); $this->application->expects($this->any())->method('getResponse')->will($this->returnValue($this->response)); }