lithium\tests\cases\core\ErrorHandlerTest::testExceptionSubclassCatching PHP Method

testExceptionSubclassCatching() public method

    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->assertCount(1, $this->errors);
        $result = end($this->errors);
        $expected = 'Test subclass';
        $this->assertEqual($expected, $result['message']);
    }