diff options
Diffstat (limited to 'apps/files_encryption/tests/stream.php')
-rw-r--r-- | apps/files_encryption/tests/stream.php | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php index 5ea0da48017..2caebf912ed 100644 --- a/apps/files_encryption/tests/stream.php +++ b/apps/files_encryption/tests/stream.php @@ -15,14 +15,14 @@ class Test_CryptStream extends UnitTestCase { fclose($stream); $stream=$this->getStream('test1','r', strlen('foobar')); - $data=fread($stream,6); + $data=fread($stream, 6); fclose($stream); - $this->assertEqual('foobar',$data); + $this->assertEqual('foobar', $data); $file=OC::$SERVERROOT.'/3rdparty/MDB2.php'; $source=fopen($file,'r'); - $target=$this->getStream('test2','w',0); - OCP\Files::streamCopy($source,$target); + $target=$this->getStream('test2', 'w', 0); + OCP\Files::streamCopy($source, $target); fclose($target); fclose($source); @@ -30,7 +30,7 @@ class Test_CryptStream extends UnitTestCase { $data=stream_get_contents($stream); $original=file_get_contents($file); $this->assertEqual(strlen($original), strlen($data)); - $this->assertEqual($original,$data); + $this->assertEqual($original, $data); } /** @@ -40,7 +40,7 @@ class Test_CryptStream extends UnitTestCase { * @param int size * @return resource */ - function getStream($id,$mode,$size) { + function getStream($id, $mode, $size) { if($id==='') { $id=uniqid(); } @@ -50,9 +50,9 @@ class Test_CryptStream extends UnitTestCase { }else{ $file=$this->tmpFiles[$id]; } - $stream=fopen($file,$mode); + $stream=fopen($file, $mode); OC_CryptStream::$sourceStreams[$id]=array('path'=>'dummy'.$id,'stream'=>$stream,'size'=>$size); - return fopen('crypt://streams/'.$id,$mode); + return fopen('crypt://streams/'.$id, $mode); } function testBinary() { @@ -60,26 +60,26 @@ class Test_CryptStream extends UnitTestCase { $source=file_get_contents($file); $stream=$this->getStream('test','w', strlen($source)); - fwrite($stream,$source); + fwrite($stream, $source); fclose($stream); $stream=$this->getStream('test','r', strlen($source)); $data=stream_get_contents($stream); fclose($stream); $this->assertEqual(strlen($data), strlen($source)); - $this->assertEqual($source,$data); + $this->assertEqual($source, $data); $file=__DIR__.'/zeros'; $source=file_get_contents($file); $stream=$this->getStream('test2','w', strlen($source)); - fwrite($stream,$source); + fwrite($stream, $source); fclose($stream); $stream=$this->getStream('test2','r', strlen($source)); $data=stream_get_contents($stream); fclose($stream); $this->assertEqual(strlen($data), strlen($source)); - $this->assertEqual($source,$data); + $this->assertEqual($source, $data); } } |