summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-08-22 01:50:31 -0700
committerThomas Müller <thomas.mueller@tmit.eu>2013-08-22 01:50:31 -0700
commit582b33bdf15ecd9b29fee721167dfaee95aea854 (patch)
tree012852c03c17a1013a50b1471d9cf22f6aa2ca2b /apps/files_encryption/tests
parentfbc23c4a01e8d900fb057393a6ffaba77ab35ddc (diff)
parent83afb46205ef9b2235a4b978beed44267d3e6c81 (diff)
downloadnextcloud-server-582b33bdf15ecd9b29fee721167dfaee95aea854.tar.gz
nextcloud-server-582b33bdf15ecd9b29fee721167dfaee95aea854.zip
Merge pull request #4537 from owncloud/no-realpath
Do not use realpath() on includes.
Diffstat (limited to 'apps/files_encryption/tests')
-rwxr-xr-xapps/files_encryption/tests/crypt.php30
-rw-r--r--apps/files_encryption/tests/keymanager.php26
-rwxr-xr-xapps/files_encryption/tests/share.php20
-rw-r--r--apps/files_encryption/tests/stream.php16
-rwxr-xr-xapps/files_encryption/tests/trashbin.php18
-rwxr-xr-xapps/files_encryption/tests/util.php24
-rwxr-xr-xapps/files_encryption/tests/webdav.php16
7 files changed, 75 insertions, 75 deletions
diff --git a/apps/files_encryption/tests/crypt.php b/apps/files_encryption/tests/crypt.php
index 630b50481e5..5146613e252 100755
--- a/apps/files_encryption/tests/crypt.php
+++ b/apps/files_encryption/tests/crypt.php
@@ -7,16 +7,16 @@
* See the COPYING-README file.
*/
-require_once realpath(dirname(__FILE__) . '/../3rdparty/Crypt_Blowfish/Blowfish.php');
-require_once realpath(dirname(__FILE__) . '/../../../lib/base.php');
-require_once realpath(dirname(__FILE__) . '/../lib/crypt.php');
-require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php');
-require_once realpath(dirname(__FILE__) . '/../lib/proxy.php');
-require_once realpath(dirname(__FILE__) . '/../lib/stream.php');
-require_once realpath(dirname(__FILE__) . '/../lib/util.php');
-require_once realpath(dirname(__FILE__) . '/../lib/helper.php');
-require_once realpath(dirname(__FILE__) . '/../appinfo/app.php');
-require_once realpath(dirname(__FILE__) . '/util.php');
+require_once __DIR__ . '/../3rdparty/Crypt_Blowfish/Blowfish.php';
+require_once __DIR__ . '/../../../lib/base.php';
+require_once __DIR__ . '/../lib/crypt.php';
+require_once __DIR__ . '/../lib/keymanager.php';
+require_once __DIR__ . '/../lib/proxy.php';
+require_once __DIR__ . '/../lib/stream.php';
+require_once __DIR__ . '/../lib/util.php';
+require_once __DIR__ . '/../lib/helper.php';
+require_once __DIR__ . '/../appinfo/app.php';
+require_once __DIR__ . '/util.php';
use OCA\Encryption;
@@ -67,12 +67,12 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$this->pass = \Test_Encryption_Crypt::TEST_ENCRYPTION_CRYPT_USER1;
// set content for encrypting / decrypting in tests
- $this->dataLong = file_get_contents(realpath(dirname(__FILE__) . '/../lib/crypt.php'));
+ $this->dataLong = file_get_contents(__DIR__ . '/../lib/crypt.php');
$this->dataShort = 'hats';
- $this->dataUrl = realpath(dirname(__FILE__) . '/../lib/crypt.php');
- $this->legacyData = realpath(dirname(__FILE__) . '/legacy-text.txt');
- $this->legacyEncryptedData = realpath(dirname(__FILE__) . '/legacy-encrypted-text.txt');
- $this->legacyEncryptedDataKey = realpath(dirname(__FILE__) . '/encryption.key');
+ $this->dataUrl = __DIR__ . '/../lib/crypt.php';
+ $this->legacyData = __DIR__ . '/legacy-text.txt';
+ $this->legacyEncryptedData = __DIR__ . '/legacy-encrypted-text.txt';
+ $this->legacyEncryptedDataKey = __DIR__ . '/encryption.key';
$this->randomKey = Encryption\Crypt::generateKey();
$keypair = Encryption\Crypt::createKeypair();
diff --git a/apps/files_encryption/tests/keymanager.php b/apps/files_encryption/tests/keymanager.php
index 7b8fd5d124d..b2d200cca3e 100644
--- a/apps/files_encryption/tests/keymanager.php
+++ b/apps/files_encryption/tests/keymanager.php
@@ -6,15 +6,15 @@
* See the COPYING-README file.
*/
-require_once realpath(dirname(__FILE__) . '/../../../lib/base.php');
-require_once realpath(dirname(__FILE__) . '/../lib/crypt.php');
-require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php');
-require_once realpath(dirname(__FILE__) . '/../lib/proxy.php');
-require_once realpath(dirname(__FILE__) . '/../lib/stream.php');
-require_once realpath(dirname(__FILE__) . '/../lib/util.php');
-require_once realpath(dirname(__FILE__) . '/../lib/helper.php');
-require_once realpath(dirname(__FILE__) . '/../appinfo/app.php');
-require_once realpath(dirname(__FILE__) . '/util.php');
+require_once __DIR__ . '/../../../lib/base.php';
+require_once __DIR__ . '/../lib/crypt.php';
+require_once __DIR__ . '/../lib/keymanager.php';
+require_once __DIR__ . '/../lib/proxy.php';
+require_once __DIR__ . '/../lib/stream.php';
+require_once __DIR__ . '/../lib/util.php';
+require_once __DIR__ . '/../lib/helper.php';
+require_once __DIR__ . '/../appinfo/app.php';
+require_once __DIR__ . '/util.php';
use OCA\Encryption;
@@ -57,11 +57,11 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
function setUp() {
// set content for encrypting / decrypting in tests
- $this->dataLong = file_get_contents(realpath(dirname(__FILE__) . '/../lib/crypt.php'));
+ $this->dataLong = file_get_contents(__DIR__ . '/../lib/crypt.php');
$this->dataShort = 'hats';
- $this->dataUrl = realpath(dirname(__FILE__) . '/../lib/crypt.php');
- $this->legacyData = realpath(dirname(__FILE__) . '/legacy-text.txt');
- $this->legacyEncryptedData = realpath(dirname(__FILE__) . '/legacy-encrypted-text.txt');
+ $this->dataUrl = __DIR__ . '/../lib/crypt.php';
+ $this->legacyData = __DIR__ . '/legacy-text.txt';
+ $this->legacyEncryptedData = __DIR__ . '/legacy-encrypted-text.txt';
$this->randomKey = Encryption\Crypt::generateKey();
$keypair = Encryption\Crypt::createKeypair();
diff --git a/apps/files_encryption/tests/share.php b/apps/files_encryption/tests/share.php
index 59d4adc6fee..6a29d2428dc 100755
--- a/apps/files_encryption/tests/share.php
+++ b/apps/files_encryption/tests/share.php
@@ -20,16 +20,16 @@
*
*/
-require_once realpath(dirname(__FILE__) . '/../3rdparty/Crypt_Blowfish/Blowfish.php');
-require_once realpath(dirname(__FILE__) . '/../../../lib/base.php');
-require_once realpath(dirname(__FILE__) . '/../lib/crypt.php');
-require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php');
-require_once realpath(dirname(__FILE__) . '/../lib/proxy.php');
-require_once realpath(dirname(__FILE__) . '/../lib/stream.php');
-require_once realpath(dirname(__FILE__) . '/../lib/util.php');
-require_once realpath(dirname(__FILE__) . '/../lib/helper.php');
-require_once realpath(dirname(__FILE__) . '/../appinfo/app.php');
-require_once realpath(dirname(__FILE__) . '/util.php');
+require_once __DIR__ . '/../3rdparty/Crypt_Blowfish/Blowfish.php';
+require_once __DIR__ . '/../../../lib/base.php';
+require_once __DIR__ . '/../lib/crypt.php';
+require_once __DIR__ . '/../lib/keymanager.php';
+require_once __DIR__ . '/../lib/proxy.php';
+require_once __DIR__ . '/../lib/stream.php';
+require_once __DIR__ . '/../lib/util.php';
+require_once __DIR__ . '/../lib/helper.php';
+require_once __DIR__ . '/../appinfo/app.php';
+require_once __DIR__ . '/util.php';
use OCA\Encryption;
diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php
index 5193f8c9686..530ee3a7b2d 100644
--- a/apps/files_encryption/tests/stream.php
+++ b/apps/files_encryption/tests/stream.php
@@ -20,14 +20,14 @@
*
*/
-require_once realpath(dirname(__FILE__) . '/../../../lib/base.php');
-require_once realpath(dirname(__FILE__) . '/../lib/crypt.php');
-require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php');
-require_once realpath(dirname(__FILE__) . '/../lib/proxy.php');
-require_once realpath(dirname(__FILE__) . '/../lib/stream.php');
-require_once realpath(dirname(__FILE__) . '/../lib/util.php');
-require_once realpath(dirname(__FILE__) . '/../appinfo/app.php');
-require_once realpath(dirname(__FILE__) . '/util.php');
+require_once __DIR__ . '/../../../lib/base.php';
+require_once __DIR__ . '/../lib/crypt.php';
+require_once __DIR__ . '/../lib/keymanager.php';
+require_once __DIR__ . '/../lib/proxy.php';
+require_once __DIR__ . '/../lib/stream.php';
+require_once __DIR__ . '/../lib/util.php';
+require_once __DIR__ . '/../appinfo/app.php';
+require_once __DIR__ . '/util.php';
use OCA\Encryption;
diff --git a/apps/files_encryption/tests/trashbin.php b/apps/files_encryption/tests/trashbin.php
index d64035df50e..2a41ace4015 100755
--- a/apps/files_encryption/tests/trashbin.php
+++ b/apps/files_encryption/tests/trashbin.php
@@ -20,15 +20,15 @@
*
*/
-require_once realpath(dirname(__FILE__) . '/../../../lib/base.php');
-require_once realpath(dirname(__FILE__) . '/../lib/crypt.php');
-require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php');
-require_once realpath(dirname(__FILE__) . '/../lib/proxy.php');
-require_once realpath(dirname(__FILE__) . '/../lib/stream.php');
-require_once realpath(dirname(__FILE__) . '/../lib/util.php');
-require_once realpath(dirname(__FILE__) . '/../appinfo/app.php');
-require_once realpath(dirname(__FILE__) . '/../../files_trashbin/appinfo/app.php');
-require_once realpath(dirname(__FILE__) . '/util.php');
+require_once __DIR__ . '/../../../lib/base.php';
+require_once __DIR__ . '/../lib/crypt.php';
+require_once __DIR__ . '/../lib/keymanager.php';
+require_once __DIR__ . '/../lib/proxy.php';
+require_once __DIR__ . '/../lib/stream.php';
+require_once __DIR__ . '/../lib/util.php';
+require_once __DIR__ . '/../appinfo/app.php';
+require_once __DIR__ . '/../../files_trashbin/appinfo/app.php';
+require_once __DIR__ . '/util.php';
use OCA\Encryption;
diff --git a/apps/files_encryption/tests/util.php b/apps/files_encryption/tests/util.php
index 368b7b3dc3f..eddc4c6b3ff 100755
--- a/apps/files_encryption/tests/util.php
+++ b/apps/files_encryption/tests/util.php
@@ -6,13 +6,13 @@
* See the COPYING-README file.
*/
-require_once realpath(dirname(__FILE__) . '/../../../lib/base.php');
-require_once realpath(dirname(__FILE__) . '/../lib/crypt.php');
-require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php');
-require_once realpath(dirname(__FILE__) . '/../lib/proxy.php');
-require_once realpath(dirname(__FILE__) . '/../lib/stream.php');
-require_once realpath(dirname(__FILE__) . '/../lib/util.php');
-require_once realpath(dirname(__FILE__) . '/../appinfo/app.php');
+require_once __DIR__ . '/../../../lib/base.php';
+require_once __DIR__ . '/../lib/crypt.php';
+require_once __DIR__ . '/../lib/keymanager.php';
+require_once __DIR__ . '/../lib/proxy.php';
+require_once __DIR__ . '/../lib/stream.php';
+require_once __DIR__ . '/../lib/util.php';
+require_once __DIR__ . '/../appinfo/app.php';
use OCA\Encryption;
@@ -69,12 +69,12 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
$this->pass = \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER1;
// set content for encrypting / decrypting in tests
- $this->dataUrl = realpath(dirname(__FILE__) . '/../lib/crypt.php');
+ $this->dataUrl = __DIR__ . '/../lib/crypt.php';
$this->dataShort = 'hats';
- $this->dataLong = file_get_contents(realpath(dirname(__FILE__) . '/../lib/crypt.php'));
- $this->legacyData = realpath(dirname(__FILE__) . '/legacy-text.txt');
- $this->legacyEncryptedData = realpath(dirname(__FILE__) . '/legacy-encrypted-text.txt');
- $this->legacyEncryptedDataKey = realpath(dirname(__FILE__) . '/encryption.key');
+ $this->dataLong = file_get_contents(__DIR__ . '/../lib/crypt.php');
+ $this->legacyData = __DIR__ . '/legacy-text.txt';
+ $this->legacyEncryptedData = __DIR__ . '/legacy-encrypted-text.txt';
+ $this->legacyEncryptedDataKey = __DIR__ . '/encryption.key';
$this->legacyKey = "30943623843030686906\0\0\0\0";
$keypair = Encryption\Crypt::createKeypair();
diff --git a/apps/files_encryption/tests/webdav.php b/apps/files_encryption/tests/webdav.php
index 33b3ce6f2f2..a2a8ce6e34f 100755
--- a/apps/files_encryption/tests/webdav.php
+++ b/apps/files_encryption/tests/webdav.php
@@ -20,14 +20,14 @@
*
*/
-require_once realpath(dirname(__FILE__) . '/../../../lib/base.php');
-require_once realpath(dirname(__FILE__) . '/../lib/crypt.php');
-require_once realpath(dirname(__FILE__) . '/../lib/keymanager.php');
-require_once realpath(dirname(__FILE__) . '/../lib/proxy.php');
-require_once realpath(dirname(__FILE__) . '/../lib/stream.php');
-require_once realpath(dirname(__FILE__) . '/../lib/util.php');
-require_once realpath(dirname(__FILE__) . '/../appinfo/app.php');
-require_once realpath(dirname(__FILE__) . '/util.php');
+require_once __DIR__ . '/../../../lib/base.php';
+require_once __DIR__ . '/../lib/crypt.php';
+require_once __DIR__ . '/../lib/keymanager.php';
+require_once __DIR__ . '/../lib/proxy.php';
+require_once __DIR__ . '/../lib/stream.php';
+require_once __DIR__ . '/../lib/util.php';
+require_once __DIR__ . '/../appinfo/app.php';
+require_once __DIR__ . '/util.php';
use OCA\Encryption;