LocalFileStorageTest: restore error_reporting() level and error handler
... not to cause side effects in other tests
This commit is contained in:
parent
7f5962dfae
commit
a504281248
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue