Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LocalFileStorageTest: restore error_reporting() level and error handler #3309

Merged
merged 1 commit into from Jun 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions test/php/library/Icinga/File/Storage/LocalFileStorageTest.php
Expand Up @@ -11,10 +11,16 @@

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) {
Expand All @@ -35,6 +41,12 @@ public function __construct($name = null, array $data = array(), $dataName = '')
});
}

public function __destruct()
{
error_reporting($this->oldErrorReportingLevel);
restore_error_handler();
}

public function testGetIterator()
{
$lfs = new TemporaryLocalFileStorage();
Expand Down