Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/files/mount.php')
-rw-r--r--tests/lib/files/mount.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/lib/files/mount.php b/tests/lib/files/mount.php
index f223f0f6c53..4e6aaf0679b 100644
--- a/tests/lib/files/mount.php
+++ b/tests/lib/files/mount.php
@@ -10,6 +10,12 @@ namespace Test\Files;
use \OC\Files\Storage\Temporary;
+class LongId extends Temporary {
+ public function getId() {
+ return 'long:' . str_repeat('foo', 50) . parent::getId();
+ }
+}
+
class Mount extends \PHPUnit_Framework_TestCase {
public function setup() {
\OC_Util::setupFS();
@@ -38,4 +44,15 @@ class Mount extends \PHPUnit_Framework_TestCase {
$mount2 = new \OC\Files\Mount($storage, '/foo/bar');
$this->assertEquals(array($mount, $mount2), \OC\Files\Mount::findById($id));
}
+
+ public function testLong() {
+ $storage = new LongId(array());
+ $mount = new \OC\Files\Mount($storage, '/foo');
+
+ $id = $mount->getStorageId();
+ $storageId = $storage->getId();
+ $this->assertEquals(array($mount), \OC\Files\Mount::findById($id));
+ $this->assertEquals(array($mount), \OC\Files\Mount::findById($storageId));
+ $this->assertEquals(array($mount), \OC\Files\Mount::findById(md5($storageId)));
+ }
}