summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-04-02 12:48:41 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-07 13:30:30 +0200
commite8e5bd61aedb7a3f6105b3184b62a91fa81ce382 (patch)
tree9d6b5fb58d23b306329ff96b40e8010744d7516d
parentfac7ec3fc445ed528d84b258717e856e3638d734 (diff)
downloadnextcloud-server-e8e5bd61aedb7a3f6105b3184b62a91fa81ce382.tar.gz
nextcloud-server-e8e5bd61aedb7a3f6105b3184b62a91fa81ce382.zip
fixing unit tests for encryption stream wrapper seek
-rw-r--r--tests/lib/files/stream/encryption.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/lib/files/stream/encryption.php b/tests/lib/files/stream/encryption.php
index 3a5a2d4899e..fac1b768554 100644
--- a/tests/lib/files/stream/encryption.php
+++ b/tests/lib/files/stream/encryption.php
@@ -52,6 +52,19 @@ class Encryption extends \Test\TestCase {
fclose($stream);
}
+ public function testSeek() {
+ $fileName = tempnam("/tmp", "FOO");
+ $stream = $this->getStream($fileName, 'w+');
+ $this->assertEquals(6, fwrite($stream, 'foobar'));
+ $this->assertEquals(0, fseek($stream, 3));
+ $this->assertEquals(6, fwrite($stream, 'foobar'));
+ fclose($stream);
+
+ $stream = $this->getStream($fileName, 'r');
+ $this->assertEquals('foofoobar', fread($stream, 100));
+ fclose($stream);
+ }
+
/**
* @return \PHPUnit_Framework_MockObject_MockObject
*/