mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
Also add Share::getWrite to non native shares
This commit is contained in:
parent
7c2393afb0
commit
89d73346f2
7 changed files with 112 additions and 35 deletions
|
|
@ -23,7 +23,7 @@ class Share extends \PHPUnit_Framework_TestCase {
|
|||
public function setUp() {
|
||||
$this->config = json_decode(file_get_contents(__DIR__ . '/config.json'));
|
||||
$this->server = new \Icewind\SMB\Server($this->config->host, $this->config->user, $this->config->password);
|
||||
$this->share= new \Icewind\SMB\Share($this->server, $this->config->share);
|
||||
$this->share = new \Icewind\SMB\Share($this->server, $this->config->share);
|
||||
if ($this->config->root) {
|
||||
$this->root = '/' . $this->config->root . '/' . uniqid();
|
||||
} else {
|
||||
|
|
@ -298,4 +298,17 @@ class Share extends \PHPUnit_Framework_TestCase {
|
|||
|
||||
$this->assertEquals(file_get_contents($sourceFile), $content);
|
||||
}
|
||||
|
||||
public function testWriteStream() {
|
||||
$fh = $this->share->write($this->root . '/foobar', 'qwerty');
|
||||
fwrite($fh, 'qwerty');
|
||||
fclose($fh);
|
||||
// sleep(5);
|
||||
|
||||
|
||||
$tmpFile1 = tempnam('/tmp', 'smb_test_');
|
||||
$this->share->get($this->root . '/foobar', $tmpFile1);
|
||||
$this->assertEquals('qwerty', file_get_contents($tmpFile1));
|
||||
unlink($tmpFile1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue