fixing unit tests for encryption stream wrapper seek

This commit is contained in:
Thomas Müller 2015-04-02 12:48:41 +02:00
parent fac7ec3fc4
commit e8e5bd61ae
1 changed files with 13 additions and 0 deletions

View File

@ -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
*/