Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / symfony / debug / Tests / phpt / exception_rethrown.phpt
1 --TEST--
2 Test rethrowing in custom exception handler
3 --FILE--
4 <?php
5
6 namespace Symfony\Component\Debug;
7
8 $vendor = __DIR__;
9 while (!file_exists($vendor.'/vendor')) {
10     $vendor = \dirname($vendor);
11 }
12 require $vendor.'/vendor/autoload.php';
13
14 if (true) {
15     class TestLogger extends \Psr\Log\AbstractLogger
16     {
17         public function log($level, $message, array $context = array())
18         {
19             echo $message, "\n";
20         }
21     }
22 }
23
24 set_exception_handler(function ($e) { echo 123; throw $e; });
25 ErrorHandler::register()->setDefaultLogger(new TestLogger());
26 ini_set('display_errors', 1);
27
28 throw new \Exception('foo');
29 ?>
30 --EXPECTF--
31 Uncaught Exception: foo
32 123
33 Fatal error: Uncaught %s:25
34 Stack trace:
35 %a