mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
Add method to get a readable stream of a file
This commit is contained in:
parent
b1e265cd57
commit
eca03d1b88
4 changed files with 53 additions and 1 deletions
|
|
@ -282,4 +282,19 @@ class Share extends \PHPUnit_Framework_TestCase {
|
|||
$this->assertTrue(abs($now - $mtime) <= 1, 'Modified time differs by ' . abs($now - $mtime) . ' seconds');
|
||||
$this->share->del($this->root . '/foo.txt');
|
||||
}
|
||||
|
||||
public function testListRoot() {
|
||||
$files = $this->share->dir('');
|
||||
$this->assertGreaterThan(0, count($files));
|
||||
}
|
||||
|
||||
public function testReadStream() {
|
||||
$sourceFile = $this->getTextFile();
|
||||
$this->share->put($sourceFile, $this->root . '/foobar');
|
||||
$fh = $this->share->read($this->root . '/foobar');
|
||||
$content = stream_get_contents($fh);
|
||||
$this->share->del($this->root . '/foobar');
|
||||
|
||||
$this->assertEquals(file_get_contents($sourceFile), $content);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue