Source

						public function testExceptionCatching() {
		$self = $this;
		ErrorHandler::config(array(array(
			'type' => 'Exception',
			'handler' => function($info) use ($self) {
				$self->errors[] = $info;
			}
		)));

		ErrorHandler::handle(new Exception('Test!'));

		$this->assertEqual(1, count($this->errors));
		$result = end($this->errors);
		$expected = 'Test!';
		$this->assertEqual($expected, $result['message']);

		$this->expectException('/Test/');
		trigger_error('Test warning!', E_USER_WARNING);
		$this->assertEqual(1, count($this->errors));
	}