aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjknockaert <jasper@knockaert.nl>2015-05-18 11:32:29 +0200
committerjknockaert <jasper@knockaert.nl>2015-05-18 11:32:29 +0200
commit9a71eddaf926f5379090384c7e8e86a295da26bf (patch)
tree0832eccc6cd4a3f3c62859942719512589e2692e /tests
parentf5415653fd975b41e0bc27fca8b0666288fc5eef (diff)
downloadnextcloud-server-9a71eddaf926f5379090384c7e8e86a295da26bf.tar.gz
nextcloud-server-9a71eddaf926f5379090384c7e8e86a295da26bf.zip
work on tests
Tests reorganised and extended
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/stream/encryption.php21
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/lib/files/stream/encryption.php b/tests/lib/files/stream/encryption.php
index 892491cbc32..7905d55530b 100644
--- a/tests/lib/files/stream/encryption.php
+++ b/tests/lib/files/stream/encryption.php
@@ -160,15 +160,6 @@ class Encryption extends \Test\TestCase {
$this->assertEquals('foobar', fread($stream, 100));
fclose($stream);
- unlink($fileName);
- }
-
- public function testWriteWriteRead() {
- $fileName = tempnam("/tmp", "FOO");
- $stream = $this->getStream($fileName, 'w+', 0);
- $this->assertEquals(6, fwrite($stream, 'foobar'));
- fclose($stream);
-
$stream = $this->getStream($fileName, 'r+', 6);
$this->assertEquals(3, fwrite($stream, 'bar'));
fclose($stream);
@@ -176,6 +167,8 @@ class Encryption extends \Test\TestCase {
$stream = $this->getStream($fileName, 'r', 6);
$this->assertEquals('barbar', fread($stream, 100));
fclose($stream);
+
+ unlink($fileName);
}
public function testRewind() {
@@ -191,7 +184,9 @@ class Encryption extends \Test\TestCase {
$stream = $this->getStream($fileName, 'r', 6);
$this->assertEquals('barbar', fread($stream, 100));
fclose($stream);
- }
+
+ unlink($fileName);
+}
public function testSeek() {
$fileName = tempnam("/tmp", "FOO");
@@ -203,6 +198,12 @@ class Encryption extends \Test\TestCase {
$stream = $this->getStream($fileName, 'r', 9);
$this->assertEquals('foofoobar', fread($stream, 100));
+ $this->assertEquals(-1, fseek($stream, 10));
+ $this->assertEquals(0, fseek($stream, 9));
+ $this->assertEquals(-1, fseek($stream, -10, 'SEEK_CUR'));
+ $this->assertEquals(0, fseek($stream, -9, 'SEEK_CUR'));
+ $this->assertEquals(-1, fseek($stream, -10, 'SEEK_END'));
+ $this->assertEquals(0, fseek($stream, -9, 'SEEK_END'));
fclose($stream);
unlink($fileName);