Exemplo n.º 1
0
 /**
  * @covers Opl_ErrorHandler::display
  */
 public function testOutputCancellationOnMatchedException()
 {
     ob_start();
     ob_start();
     echo 'XYZ';
     $handler = new Opl_ErrorHandler();
     $handler->addPort(new Opl_ErrorHandler_Port());
     $handler->display(new Opl_Exception('Foo'));
     $out = ob_get_clean();
     if (strpos($out, 'XYZ') !== false) {
         $this->fail('The earlier string XYZ was not cancelled by the exception handler.');
     }
     return true;
 }
Exemplo n.º 2
0
 /**
  * Registers the OPL error handling port in OPL error handler together
  * with the necessary informers.
  *
  * @static
  * @param Opl_ErrorHandler $handler The OPL error handler
  */
 public static function register(Opl_ErrorHandler $handler)
 {
     $handler->addPort(new Opl_ErrorHandler_Port());
 }