[Pkg-owncloud-commits] [owncloud] 118/258: add seek and tell to streamwrapper test
David Prévot
taffit at moszumanska.debian.org
Sat Oct 11 17:22:27 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit dfc6bfe13123f9f978a55dd0f6a5602325a19694
Author: Jörn Friedrich Dreyer <jfd at butonic.de>
Date: Sun Sep 21 22:47:40 2014 +0200
add seek and tell to streamwrapper test
---
tests/lib/streamwrappers.php | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/tests/lib/streamwrappers.php b/tests/lib/streamwrappers.php
index d15b712..1b61446 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:///'));
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list