You are here

public function ExceptionHandlerTest::testHandleOutOfMemoryException in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/debug/Tests/ExceptionHandlerTest.php \Symfony\Component\Debug\Tests\ExceptionHandlerTest::testHandleOutOfMemoryException()

File

vendor/symfony/debug/Tests/ExceptionHandlerTest.php, line 118

Class

ExceptionHandlerTest

Namespace

Symfony\Component\Debug\Tests

Code

public function testHandleOutOfMemoryException() {
  $exception = new OutOfMemoryException('foo', 0, E_ERROR, __FILE__, __LINE__);
  $handler = $this
    ->getMock('Symfony\\Component\\Debug\\ExceptionHandler', array(
    'sendPhpResponse',
  ));
  $handler
    ->expects($this
    ->once())
    ->method('sendPhpResponse');
  $that = $this;
  $handler
    ->setHandler(function ($e) use ($that) {
    $that
      ->fail('OutOfMemoryException should bypass the handler');
  });
  $handler
    ->handle($exception);
}