|
21 | 21 | use Symfony\Component\Debug\ErrorHandler;
|
22 | 22 | use Symfony\Component\Debug\ExceptionHandler;
|
23 | 23 | use Symfony\Component\EventDispatcher\EventDispatcher;
|
| 24 | +use Symfony\Component\HttpFoundation\Request; |
| 25 | +use Symfony\Component\HttpKernel\Event\KernelEvent; |
24 | 26 | use Symfony\Component\HttpKernel\EventListener\DebugHandlersListener;
|
| 27 | +use Symfony\Component\HttpKernel\HttpKernelInterface; |
25 | 28 | use Symfony\Component\HttpKernel\KernelEvents;
|
26 | 29 |
|
27 | 30 | /**
|
@@ -62,6 +65,31 @@ public function testConfigure()
|
62 | 65 | $this->assertSame(array($logger, LogLevel::INFO), $loggers[E_DEPRECATED]);
|
63 | 66 | }
|
64 | 67 |
|
| 68 | + public function testConfigureForHttpKernelWithNoTerminateWithException() |
| 69 | + { |
| 70 | + $listener = new DebugHandlersListener(null); |
| 71 | + $eHandler = new ErrorHandler(); |
| 72 | + $event = new KernelEvent( |
| 73 | + $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'), |
| 74 | + Request::create('/'), |
| 75 | + HttpKernelInterface::MASTER_REQUEST |
| 76 | + ); |
| 77 | + |
| 78 | + $exception = null; |
| 79 | + $h = set_exception_handler(array($eHandler, 'handleException')); |
| 80 | + try { |
| 81 | + $listener->configure($event); |
| 82 | + } catch (\Exception $exception) { |
| 83 | + } |
| 84 | + restore_exception_handler(); |
| 85 | + |
| 86 | + if (null !== $exception) { |
| 87 | + throw $exception; |
| 88 | + } |
| 89 | + |
| 90 | + $this->assertNull($h); |
| 91 | + } |
| 92 | + |
65 | 93 | public function testConsoleEvent()
|
66 | 94 | {
|
67 | 95 | $dispatcher = new EventDispatcher();
|
|
0 commit comments