aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2012-11-04 08:59:45 -0800
committerThomas Müller <thomas.mueller@tmit.eu>2012-11-04 08:59:45 -0800
commit8ac3849a95bd6a733cce9134bab4bf38c5c0fadd (patch)
tree5fc42258625fa612348f701f0dd334ee476bdd4d /apps/files_encryption/tests
parent8c4c74b23f268b232e3f591ea564c018597ee82d (diff)
parent30d7993e0105a6c98cbf61d4253d08acf236aca7 (diff)
downloadnextcloud-server-8ac3849a95bd6a733cce9134bab4bf38c5c0fadd.tar.gz
nextcloud-server-8ac3849a95bd6a733cce9134bab4bf38c5c0fadd.zip
Merge pull request #238 from fmms/checkstyle04
Checkstyle fixes
Diffstat (limited to 'apps/files_encryption/tests')
-rw-r--r--apps/files_encryption/tests/encryption.php6
-rw-r--r--apps/files_encryption/tests/proxy.php6
-rw-r--r--apps/files_encryption/tests/stream.php20
3 files changed, 16 insertions, 16 deletions
diff --git a/apps/files_encryption/tests/encryption.php b/apps/files_encryption/tests/encryption.php
index b714b00b8f2..0e119f55bea 100644
--- a/apps/files_encryption/tests/encryption.php
+++ b/apps/files_encryption/tests/encryption.php
@@ -17,7 +17,7 @@ class Test_Encryption extends UnitTestCase {
$this->assertNotEqual($encrypted, $source);
$this->assertEqual($decrypted, $source);
- $chunk=substr($source,0, 8192);
+ $chunk=substr($source, 0, 8192);
$encrypted=OC_Crypt::encrypt($chunk, $key);
$this->assertEqual(strlen($chunk), strlen($encrypted));
$decrypted=OC_Crypt::decrypt($encrypted, $key);
@@ -30,14 +30,14 @@ class Test_Encryption extends UnitTestCase {
$this->assertEqual($decrypted, $source);
$tmpFileEncrypted=OCP\Files::tmpFile();
- OC_Crypt::encryptfile($file,$tmpFileEncrypted, $key);
+ OC_Crypt::encryptfile($file, $tmpFileEncrypted, $key);
$encrypted=file_get_contents($tmpFileEncrypted);
$decrypted=OC_Crypt::blockDecrypt($encrypted, $key);
$this->assertNotEqual($encrypted, $source);
$this->assertEqual($decrypted, $source);
$tmpFileDecrypted=OCP\Files::tmpFile();
- OC_Crypt::decryptfile($tmpFileEncrypted,$tmpFileDecrypted, $key);
+ OC_Crypt::decryptfile($tmpFileEncrypted, $tmpFileDecrypted, $key);
$decrypted=file_get_contents($tmpFileDecrypted);
$this->assertEqual($decrypted, $source);
diff --git a/apps/files_encryption/tests/proxy.php b/apps/files_encryption/tests/proxy.php
index 25427ff4b97..1c800bbc5f6 100644
--- a/apps/files_encryption/tests/proxy.php
+++ b/apps/files_encryption/tests/proxy.php
@@ -13,8 +13,8 @@ class Test_CryptProxy extends UnitTestCase {
public function setUp() {
$user=OC_User::getUser();
- $this->oldConfig=OCP\Config::getAppValue('files_encryption','enable_encryption','true');
- OCP\Config::setAppValue('files_encryption','enable_encryption','true');
+ $this->oldConfig=OCP\Config::getAppValue('files_encryption','enable_encryption', 'true');
+ OCP\Config::setAppValue('files_encryption', 'enable_encryption', 'true');
$this->oldKey=isset($_SESSION['enckey'])?$_SESSION['enckey']:null;
@@ -30,7 +30,7 @@ class Test_CryptProxy extends UnitTestCase {
//set up temporary storage
OC_Filesystem::clearMounts();
- OC_Filesystem::mount('OC_Filestorage_Temporary', array(),'/');
+ OC_Filesystem::mount('OC_Filestorage_Temporary', array(), '/');
OC_Filesystem::init('/'.$user.'/files');
diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php
index 2caebf912ed..67b5e98ae67 100644
--- a/apps/files_encryption/tests/stream.php
+++ b/apps/files_encryption/tests/stream.php
@@ -10,23 +10,23 @@ class Test_CryptStream extends UnitTestCase {
private $tmpFiles=array();
function testStream() {
- $stream=$this->getStream('test1','w', strlen('foobar'));
- fwrite($stream,'foobar');
+ $stream=$this->getStream('test1', 'w', strlen('foobar'));
+ fwrite($stream, 'foobar');
fclose($stream);
- $stream=$this->getStream('test1','r', strlen('foobar'));
+ $stream=$this->getStream('test1', 'r', strlen('foobar'));
$data=fread($stream, 6);
fclose($stream);
$this->assertEqual('foobar', $data);
$file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
- $source=fopen($file,'r');
+ $source=fopen($file, 'r');
$target=$this->getStream('test2', 'w', 0);
OCP\Files::streamCopy($source, $target);
fclose($target);
fclose($source);
- $stream=$this->getStream('test2','r', filesize($file));
+ $stream=$this->getStream('test2', 'r', filesize($file));
$data=stream_get_contents($stream);
$original=file_get_contents($file);
$this->assertEqual(strlen($original), strlen($data));
@@ -51,7 +51,7 @@ class Test_CryptStream extends UnitTestCase {
$file=$this->tmpFiles[$id];
}
$stream=fopen($file, $mode);
- OC_CryptStream::$sourceStreams[$id]=array('path'=>'dummy'.$id,'stream'=>$stream,'size'=>$size);
+ OC_CryptStream::$sourceStreams[$id]=array('path'=>'dummy'.$id, 'stream'=>$stream, 'size'=>$size);
return fopen('crypt://streams/'.$id, $mode);
}
@@ -59,11 +59,11 @@ class Test_CryptStream extends UnitTestCase {
$file=__DIR__.'/binary';
$source=file_get_contents($file);
- $stream=$this->getStream('test','w', strlen($source));
+ $stream=$this->getStream('test', 'w', strlen($source));
fwrite($stream, $source);
fclose($stream);
- $stream=$this->getStream('test','r', strlen($source));
+ $stream=$this->getStream('test', 'r', strlen($source));
$data=stream_get_contents($stream);
fclose($stream);
$this->assertEqual(strlen($data), strlen($source));
@@ -72,11 +72,11 @@ class Test_CryptStream extends UnitTestCase {
$file=__DIR__.'/zeros';
$source=file_get_contents($file);
- $stream=$this->getStream('test2','w', strlen($source));
+ $stream=$this->getStream('test2', 'w', strlen($source));
fwrite($stream, $source);
fclose($stream);
- $stream=$this->getStream('test2','r', strlen($source));
+ $stream=$this->getStream('test2', 'r', strlen($source));
$data=stream_get_contents($stream);
fclose($stream);
$this->assertEqual(strlen($data), strlen($source));