move backends into their own namespace and add support for multiple auth methods

This commit is contained in:
Robin Appelman 2018-03-13 16:18:37 +01:00
commit 29bdebad42
33 changed files with 752 additions and 377 deletions

View file

@ -7,16 +7,19 @@
namespace Icewind\SMB\Test;
use Icewind\SMB\NativeServer;
use Icewind\SMB\BasicAuth;
use Icewind\SMB\Native\NativeServer;
use Icewind\SMB\System;
use Icewind\SMB\TimeZoneProvider;
class NativeStreamTest extends TestCase {
/**
* @var \Icewind\SMB\Server $server
* @var \Icewind\SMB\IServer $server
*/
protected $server;
/**
* @var \Icewind\SMB\NativeShare $share
* @var \Icewind\SMB\Native\NativeShare $share
*/
protected $share;
@ -33,7 +36,15 @@ class NativeStreamTest extends TestCase {
$this->markTestSkipped('libsmbclient php extension not installed');
}
$this->config = json_decode(file_get_contents(__DIR__ . '/config.json'));
$this->server = new NativeServer($this->config->host, $this->config->user, $this->config->password);
$this->server = new NativeServer(
$this->config->host,
new BasicAuth(
$this->config->user,
$this->config->password
),
new System(),
new TimeZoneProvider($this->config->host, new System())
);
$this->share = $this->server->getShare($this->config->share);
if ($this->config->root) {
$this->root = '/' . $this->config->root . '/' . uniqid();