diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-09-22 16:25:07 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-09-22 16:25:07 +0200 |
commit | 9e8d2907e2c86c1c425feefd5e5a97ed4325b040 (patch) | |
tree | e133d1e42c3bd3860eceb4aadbe91287ac39567e /tests | |
parent | da20d71174d2019e4a8ddfa49d471697f18fe16c (diff) | |
parent | f83689e1be43aaa6bf2fbac2772868151597911b (diff) | |
download | nextcloud-server-9e8d2907e2c86c1c425feefd5e5a97ed4325b040.tar.gz nextcloud-server-9e8d2907e2c86c1c425feefd5e5a97ed4325b040.zip |
Merge pull request #11204 from owncloud/fix_oc_stream_seek
Fix oc stream seek
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/streamwrappers.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/lib/streamwrappers.php b/tests/lib/streamwrappers.php index d15b712139d..1b61446f4dc 100644 --- a/tests/lib/streamwrappers.php +++ b/tests/lib/streamwrappers.php @@ -79,6 +79,16 @@ class Test_StreamWrappers extends PHPUnit_Framework_TestCase { $this->assertEquals(array('.', '..', 'bar.txt', 'foo.txt'), scandir('oc:///')); $this->assertEquals('qwerty', file_get_contents('oc:///bar.txt')); + $fh = fopen('oc:///bar.txt', 'rb'); + $this->assertSame(0, ftell($fh)); + $content = fread($fh, 4); + $this->assertSame(4, ftell($fh)); + $this->assertSame('qwer', $content); + $content = fread($fh, 1); + $this->assertSame(5, ftell($fh)); + $this->assertSame(0, fseek($fh, 0)); + $this->assertSame(0, ftell($fh)); + unlink('oc:///foo.txt'); $this->assertEquals(array('.', '..', 'bar.txt'), scandir('oc:///')); } |