fixing unit tests for encryption stream wrapper seek
This commit is contained in:
parent
fac7ec3fc4
commit
e8e5bd61ae
|
@ -52,6 +52,19 @@ class Encryption extends \Test\TestCase {
|
||||||
fclose($stream);
|
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
|
* @return \PHPUnit_Framework_MockObject_MockObject
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue