diff --git a/Tests/Functional/ThrowableStorage/CompoundStorageTest.php b/Tests/Functional/ThrowableStorage/CompoundStorageTest.php index dd2e278..8262398 100644 --- a/Tests/Functional/ThrowableStorage/CompoundStorageTest.php +++ b/Tests/Functional/ThrowableStorage/CompoundStorageTest.php @@ -84,14 +84,19 @@ public function When_Bootstrap_staticObjectManager_is_unset_the_logged_exception ] ]); + self::expectException(Test::class); + self::expectExceptionCode(1); + + $staticObjectManager = Bootstrap::$staticObjectManager; Bootstrap::$staticObjectManager = null; $throwable = new Test('foo', 1); - self::expectException(Test::class); - self::expectExceptionCode(1); - - $storage->logThrowable($throwable); + try { + $storage->logThrowable($throwable); + } finally { + Bootstrap::$staticObjectManager = $staticObjectManager; + } } }