From a504281248f136848ba2d01270ad314f75689d03 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 5 Dec 2017 11:48:17 +0100 Subject: [PATCH] LocalFileStorageTest: restore error_reporting() level and error handler ... not to cause side effects in other tests --- .../Icinga/File/Storage/LocalFileStorageTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/php/library/Icinga/File/Storage/LocalFileStorageTest.php b/test/php/library/Icinga/File/Storage/LocalFileStorageTest.php index 86ccc6f03..5f104a50c 100644 --- a/test/php/library/Icinga/File/Storage/LocalFileStorageTest.php +++ b/test/php/library/Icinga/File/Storage/LocalFileStorageTest.php @@ -11,10 +11,16 @@ use Icinga\Test\BaseTestCase; class LocalFileStorageTest extends BaseTestCase { + /** + * @var int + */ + protected $oldErrorReportingLevel; + public function __construct($name = null, array $data = array(), $dataName = '') { parent::__construct($name, $data, $dataName); + $this->oldErrorReportingLevel = error_reporting(); error_reporting(E_ALL | E_STRICT); set_error_handler(function ($errno, $errstr, $errfile, $errline) { @@ -35,6 +41,12 @@ class LocalFileStorageTest extends BaseTestCase }); } + public function __destruct() + { + error_reporting($this->oldErrorReportingLevel); + restore_error_handler(); + } + public function testGetIterator() { $lfs = new TemporaryLocalFileStorage();