mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
extend tests a bit
This commit is contained in:
parent
037efdcfb5
commit
d218982775
4 changed files with 50 additions and 13 deletions
|
|
@ -10,6 +10,7 @@ namespace Icewind\SMB\Test;
|
|||
use Icewind\SMB\BasicAuth;
|
||||
use Icewind\SMB\Change;
|
||||
use Icewind\SMB\Exception\AlreadyExistsException;
|
||||
use Icewind\SMB\Exception\Exception;
|
||||
use Icewind\SMB\Exception\RevisionMismatchException;
|
||||
use Icewind\SMB\INotifyHandler;
|
||||
use Icewind\SMB\IShare;
|
||||
|
|
@ -76,7 +77,7 @@ class NotifyHandlerTest extends TestCase {
|
|||
$changes = array_filter($changes, function (Change $change) {
|
||||
return $change->getPath()[0] !== '.';
|
||||
});
|
||||
|
||||
|
||||
$process->stop();
|
||||
$expected = [
|
||||
new Change(INotifyHandler::NOTIFY_ADDED, 'source.txt'),
|
||||
|
|
@ -186,4 +187,29 @@ class NotifyHandlerTest extends TestCase {
|
|||
});
|
||||
$this->assertNotNull($results);
|
||||
}
|
||||
|
||||
public function testNoStdBuf(): void {
|
||||
$this->requireBackendEnv('smbclient');
|
||||
$this->config = json_decode(file_get_contents(__DIR__ . '/config.json'));
|
||||
$system = $this->getMockBuilder(System::class)
|
||||
->onlyMethods(['getStdBufPath'])
|
||||
->getMock();
|
||||
$system->method('getStdBufPath')
|
||||
->willReturn(null);
|
||||
$server = new Server(
|
||||
$this->config->host,
|
||||
new BasicAuth(
|
||||
$this->config->user,
|
||||
'test',
|
||||
$this->config->password
|
||||
),
|
||||
$system,
|
||||
new TimeZoneProvider(new System()),
|
||||
new Options()
|
||||
);
|
||||
$share = $server->getShare($this->config->share);
|
||||
|
||||
$this->expectException(Exception::class);
|
||||
$share->notify('');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue