Ejemplo n.º 1
0
 public function testExecute()
 {
     // Add an exception config
     $exceptionConfig = new ExceptionConfig();
     $exceptionConfig->setPath('/exception.php');
     $exceptionConfig->setKey('example.exception');
     $exceptionConfig->setType('\\Exception');
     // Action Mapping
     $actionMapping = new ActionMapping();
     $actionMapping->setType('\\Phruts\\Actions\\ForwardAction');
     $actionMapping->addExceptionConfig($exceptionConfig);
     $actionMapping->setPath('throw');
     $formInstance = null;
     $request = new Request();
     $response = new Response();
     $forward = $this->exceptionHandler->execute(new \Exception('Example Error'), $exceptionConfig, $actionMapping, $formInstance, $request, $response);
     $this->assertTrue($forward instanceof \Phruts\Config\ForwardConfig);
 }