summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@karoshi.org.uk>2015-03-27 23:27:21 +0000
committerRobin McCorkell <rmccorkell@karoshi.org.uk>2015-03-27 23:29:46 +0000
commit1511a42da78bc4fbc2c202112bf10d249e3dc92f (patch)
treef4d0114442ad9167b1533f9cbf103f223ef4e4a6 /tests
parentd55b88c043adcd40c51999a26b47d39cc8e1a183 (diff)
downloadnextcloud-server-1511a42da78bc4fbc2c202112bf10d249e3dc92f.tar.gz
nextcloud-server-1511a42da78bc4fbc2c202112bf10d249e3dc92f.zip
Check for relative datadirectory path
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/util.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/lib/util.php b/tests/lib/util.php
index 4082c28f050..7d9064e0a2f 100644
--- a/tests/lib/util.php
+++ b/tests/lib/util.php
@@ -419,6 +419,25 @@ class Test_Util extends \Test\TestCase {
$this->assertFalse(\OCP\Util::needUpgrade());
}
+
+ public function testCheckDataDirectoryValidity() {
+ $dataDir = \OCP\Files::tmpFolder();
+ touch($dataDir . '/.ocdata');
+ $errors = \OC_Util::checkDataDirectoryValidity($dataDir);
+ $this->assertEmpty($errors);
+ \OCP\Files::rmdirr($dataDir);
+
+ $dataDir = \OCP\Files::tmpFolder();
+ // no touch
+ $errors = \OC_Util::checkDataDirectoryValidity($dataDir);
+ $this->assertNotEmpty($errors);
+ \OCP\Files::rmdirr($dataDir);
+
+ if (!\OC_Util::runningOnWindows()) {
+ $errors = \OC_Util::checkDataDirectoryValidity('relative/path');
+ $this->assertNotEmpty($errors);
+ }
+ }
}
/**