public function testHandlerPrintsTextAndDelegatesToErrorHandler() { $handlerMock = $this->getMock('Psc\\Code\\ErrorHandler', array('handleCaughtException')); $handlerMock->expects($this->once())->method('handleCaughtException')->will($this->returnSelf()); PSC::getEnvironment()->setErrorHandler($handlerMock); $this->expectOutputRegex('/does not matter/'); Exception::handler(new Exception('does not matter')); }