mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 09:14:06 +02:00
implement feof for native stream
This commit is contained in:
parent
aaf2c049fd
commit
fcb7aa6a55
2 changed files with 27 additions and 1 deletions
|
|
@ -97,6 +97,21 @@ class NativeStream extends \PHPUnit_Framework_TestCase {
|
|||
$this->assertEquals('foo', stream_get_contents($fh));
|
||||
}
|
||||
|
||||
public function testEOF() {
|
||||
if (version_compare(phpversion(), '5.4.0', '<')) {
|
||||
$this->markTestSkipped('php <5.4 doesn\'t support truncate for stream wrappers');
|
||||
}
|
||||
$fh = $this->share->write($this->root . '/foobar');
|
||||
fwrite($fh, 'foobar');
|
||||
fclose($fh);
|
||||
|
||||
$fh = $this->share->read($this->root . '/foobar');
|
||||
fread($fh, 3);
|
||||
$this->assertFalse(feof($fh));
|
||||
fread($fh, 5);
|
||||
$this->assertTrue(feof($fh));
|
||||
}
|
||||
|
||||
public function testLockUnsupported() {
|
||||
$fh = $this->share->write($this->root . '/foobar');
|
||||
$this->assertFalse(flock($fh, LOCK_SH));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue