Skip to content
Snippets Groups Projects
Commit b3c5ef3a authored by Thomas Müller's avatar Thomas Müller
Browse files

Adding unit test for read and write of big file

parent 02404a6a
No related branches found
No related tags found
No related merge requests found
...@@ -65,6 +65,22 @@ class Encryption extends \Test\TestCase { ...@@ -65,6 +65,22 @@ class Encryption extends \Test\TestCase {
fclose($stream); fclose($stream);
} }
public function testWriteReadBigFile() {
$expectedData = file_get_contents(\OC::$SERVERROOT . '/tests/data/lorem-big.txt');
// write it
$fileName = tempnam("/tmp", "FOO");
$stream = $this->getStream($fileName, 'w+');
fwrite($stream, $expectedData);
fclose($stream);
// read it all
$stream = $this->getStream($fileName, 'r');
$data = stream_get_contents($stream);
fclose($stream);
$this->assertEquals($expectedData, $data);
}
/** /**
* @return \PHPUnit_Framework_MockObject_MockObject * @return \PHPUnit_Framework_MockObject_MockObject
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment