public function testErrorCatching() {
$this->skipIf(true, 'Refactoring original error-handling iteration.');
$self = $this;
ErrorHandler::config(array(array(
'code' => E_WARNING | E_USER_WARNING,
'handler' => function($info) use ($self) {
$self->errors[] = $info;
}
)));
file_get_contents(false);
$this->assertEqual(1, count($this->errors));
$result = end($this->errors);
$this->assertPattern('/Filename cannot be empty/', $result['message']);
trigger_error('Test warning', E_USER_WARNING);
$this->assertEqual(2, count($this->errors));
$result = end($this->errors);
$this->assertEqual('Test warning', $result['message']);
trigger_error('Test notice', E_USER_NOTICE);
$this->assertEqual(2, count($this->errors));
}