update wrong auth test

This commit is contained in:
Robin Appelman 2021-10-28 17:58:05 +02:00
commit 02e848852f
4 changed files with 55 additions and 62 deletions

View file

@ -17,33 +17,12 @@ use Icewind\SMB\System;
use Icewind\SMB\TimeZoneProvider;
class NativeShareTest extends AbstractShareTest {
public function setUp(): void {
public function getServerClass(): string {
$this->requireBackendEnv('libsmbclient');
if (!function_exists('smbclient_state_new')) {
$this->markTestSkipped('libsmbclient php extension not installed');
}
$this->config = json_decode(file_get_contents(__DIR__ . '/config.json'));
$options = new Options();
$options->setMinProtocol(IOptions::PROTOCOL_SMB2);
$options->setMaxProtocol(IOptions::PROTOCOL_SMB3);
$this->server = new NativeServer(
$this->config->host,
new BasicAuth(
$this->config->user,
'test',
$this->config->password
),
new System(),
new TimeZoneProvider(new System()),
$options
);
$this->share = $this->server->getShare($this->config->share);
if ($this->config->root) {
$this->root = '/' . $this->config->root . '/' . uniqid();
} else {
$this->root = '/' . uniqid();
}
$this->share->mkdir($this->root);
return NativeServer::class;
}
public function testProtocolMatch() {