Restore error handling after using libsmbclient-php

This commit is contained in:
Robin Appelman 2014-07-15 16:40:58 +02:00
commit 5f80502017
3 changed files with 68 additions and 12 deletions

View file

@ -6,7 +6,6 @@ require_once 'share.php';
class NativeShare extends Share {
/**
* @var \Icewind\SMB\NativeShare $share
*/
@ -26,4 +25,17 @@ class NativeShare extends Share {
}
$this->share->mkdir($this->root);
}
public function testRestoreErrorHandler() {
$handlerCalled = false;
set_error_handler(function () use (&$handlerCalled) {
$handlerCalled = true;
});
$this->share->dir($this->root);
trigger_error('dummy');
$this->assertTrue($handlerCalled);
restore_error_handler();
}
}