From e8e5bd61aedb7a3f6105b3184b62a91fa81ce382 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20M=C3=BCller?= Date: Thu, 2 Apr 2015 12:48:41 +0200 Subject: [PATCH] fixing unit tests for encryption stream wrapper seek --- tests/lib/files/stream/encryption.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 */ -- 2.39.5