From e65ec65515429fa25ab7ca41a338f53411cedf6d Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 16 Jun 2016 00:19:51 +0200 Subject: [PATCH] [PHPUnitBridge] PHP 5.3 compatibility --- src/Symfony/Bridge/PhpUnit/ErrorAssert.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bridge/PhpUnit/ErrorAssert.php b/src/Symfony/Bridge/PhpUnit/ErrorAssert.php index b1594cbc91..0d255bc0f2 100644 --- a/src/Symfony/Bridge/PhpUnit/ErrorAssert.php +++ b/src/Symfony/Bridge/PhpUnit/ErrorAssert.php @@ -53,8 +53,14 @@ final class ErrorAssert }); $testCode(); - } finally { - restore_error_handler(); + } catch (\Exception $e) { + } catch (\Throwable $e) { + } + + restore_error_handler(); + + if (isset($e)) { + throw $e; } \PHPUnit_Framework_Assert::assertCount(count($expectedMessages), $triggeredMessages);