handle() public static method

Receives the handled errors and exceptions that have been caught, and processes them in a normalized manner.
public static handle ( object | array $info, array $scope = [] ) : boolean
$info object | array
$scope array
return boolean True if successfully handled, false otherwise.
 public function testExceptionSubclassCatching()
 {
     $self = $this;
     ErrorHandler::config(array(array('type' => 'Exception', 'handler' => function ($info) use($self) {
         $self->errors[] = $info;
     })));
     ErrorHandler::handle(new UnexpectedValueException('Test subclass'));
     $this->assertEqual(1, count($this->errors));
     $result = end($this->errors);
     $expected = 'Test subclass';
     $this->assertEqual($expected, $result['message']);
 }