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

testErrorTrapping() public method

public testErrorTrapping ( )
    public function testErrorTrapping()
    {
        ErrorHandler::stop();
        $self = $this;
        ErrorHandler::config(array(array('handler' => function ($info) use($self) {
            $self->errors[] = $info;
        })));
        ErrorHandler::run(array('trapErrors' => true));
        $this->assertCount(0, $this->errors);
        list($foo, $bar) = array('baz');
        $this->assertCount(1, $this->errors);
    }