onDispatch() public method

Callback method for dispatch and dispatch.error events.
public onDispatch ( MvcEvent $event )
$event Zend\Mvc\MvcEvent
コード例 #1
0
 /**
  * @covers \AssetManager\Module::onDispatch
  */
 public function testWillIgnoreInvalidResponseType()
 {
     $cliResponse = $this->getMock(ConsoleResponse::class, array(), array(), '', false);
     $mvcEvent = $this->getMock(MvcEvent::class);
     $module = new Module();
     $cliResponse->expects($this->never())->method('getStatusCode');
     $mvcEvent->expects($this->once())->method('getResponse')->will($this->returnValue($cliResponse));
     $this->assertNull($module->onDispatch($mvcEvent));
 }