From 3eb5a59ebd3f22a3b637d00a3d28910d3c72231d Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 24 Jun 2019 16:00:23 +0200 Subject: [PATCH] tests: Make sure we close all output-buffer we started beforehand --- tests/Whoops/Handler/PlainTextHandlerTest.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/Whoops/Handler/PlainTextHandlerTest.php b/tests/Whoops/Handler/PlainTextHandlerTest.php index 4b92fcc..d4a869a 100644 --- a/tests/Whoops/Handler/PlainTextHandlerTest.php +++ b/tests/Whoops/Handler/PlainTextHandlerTest.php @@ -63,10 +63,13 @@ class PlainTextHandlerTest extends TestCase $run->register(); $exception = $exception ?: $this->getException(); - ob_start(); - $run->handleException($exception); - - return ob_get_clean(); + + try { + ob_start(); + $run->handleException($exception); + } finally { + return ob_get_clean(); + } } /**