mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 09:14:06 +02:00
allow setting protocol levels
This commit is contained in:
parent
b69c20d21a
commit
61012e6196
9 changed files with 149 additions and 60 deletions
|
|
@ -10,7 +10,7 @@ namespace Icewind\SMB\Test;
|
|||
use Icewind\SMB\BasicAuth;
|
||||
use Icewind\SMB\Exception\AuthenticationException;
|
||||
use Icewind\SMB\Exception\ConnectionRefusedException;
|
||||
use Icewind\SMB\Exception\InvalidHostException;
|
||||
use Icewind\SMB\IOptions;
|
||||
use Icewind\SMB\IShare;
|
||||
use Icewind\SMB\Options;
|
||||
use Icewind\SMB\System;
|
||||
|
|
@ -114,4 +114,41 @@ class ServerTest extends TestCase {
|
|||
);
|
||||
$server->listShares();
|
||||
}
|
||||
|
||||
public function testProtocolMatch() {
|
||||
$options = new Options();
|
||||
$options->setMinProtocol(IOptions::PROTOCOL_SMB2);
|
||||
$options->setMaxProtocol(IOptions::PROTOCOL_SMB3);
|
||||
$server = new Server(
|
||||
$this->config->host,
|
||||
new BasicAuth(
|
||||
$this->config->user,
|
||||
'test',
|
||||
$this->config->password
|
||||
),
|
||||
new System(),
|
||||
new TimeZoneProvider(new System()),
|
||||
$options
|
||||
);
|
||||
$server->listShares();
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
public function testToLowMaxProtocol() {
|
||||
$this->expectException(ConnectionRefusedException::class);
|
||||
$options = new Options();
|
||||
$options->setMaxProtocol(IOptions::PROTOCOL_NT1);
|
||||
$server = new Server(
|
||||
$this->config->host,
|
||||
new BasicAuth(
|
||||
$this->config->user,
|
||||
'test',
|
||||
$this->config->password
|
||||
),
|
||||
new System(),
|
||||
new TimeZoneProvider(new System()),
|
||||
$options
|
||||
);
|
||||
$server->listShares();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue