mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
Add truncate support to native streams
This commit is contained in:
parent
9068418528
commit
3ae0f3dd0c
2 changed files with 14 additions and 0 deletions
|
|
@ -84,6 +84,16 @@ class NativeStream extends \PHPUnit_Framework_TestCase {
|
|||
unlink($sourceFile);
|
||||
}
|
||||
|
||||
public function testTruncate() {
|
||||
$fh = $this->share->write($this->root . '/foobar');
|
||||
fwrite($fh, 'foobar');
|
||||
ftruncate($fh, 3);
|
||||
fclose($fh);
|
||||
|
||||
$fh = $this->share->read($this->root . '/foobar');
|
||||
$this->assertEquals('foo', stream_get_contents($fh));
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
if ($this->share) {
|
||||
$this->cleanDir($this->root);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue