diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2014-09-21 22:47:40 +0200 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2014-09-21 22:47:40 +0200 |
commit | ef6db5e9d7a20fe85f2758881b67d6c63f378ca4 (patch) | |
tree | 365ea3bd5f7ce95d3a68965563c8b65d5fce0040 /tests | |
parent | b622fa502ef516384e5bc23df2ca19315cb0455b (diff) | |
download | nextcloud-server-ef6db5e9d7a20fe85f2758881b67d6c63f378ca4.tar.gz nextcloud-server-ef6db5e9d7a20fe85f2758881b67d6c63f378ca4.zip |
add seek and tell to streamwrapper test
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:///')); } |