diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-12-08 22:57:33 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-12-08 22:57:33 +0100 |
commit | 25a87d4058b3ec7f21649940949b6fc0237968dc (patch) | |
tree | b21a76a5272e5a3599c28b787541fed98ddc4638 /tests | |
parent | f219f5a7a62fe88b364b9a5f50e9730eba1ee84c (diff) | |
parent | a369d7812463c2afddf1640c42643de6312ab9ba (diff) | |
download | nextcloud-server-25a87d4058b3ec7f21649940949b6fc0237968dc.tar.gz nextcloud-server-25a87d4058b3ec7f21649940949b6fc0237968dc.zip |
Merge pull request #12577 from owncloud/public-mount-api
Add a public api for apps to add mounts
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/files/mount/manager.php | 10 | ||||
-rw-r--r-- | tests/lib/files/mount/mount.php | 10 | ||||
-rw-r--r-- | tests/lib/files/node/folder.php | 12 | ||||
-rw-r--r-- | tests/lib/files/utils/scanner.php | 12 |
4 files changed, 22 insertions, 22 deletions
diff --git a/tests/lib/files/mount/manager.php b/tests/lib/files/mount/manager.php index 051b76ccf2e..78322b47d50 100644 --- a/tests/lib/files/mount/manager.php +++ b/tests/lib/files/mount/manager.php @@ -30,33 +30,33 @@ class Manager extends \Test\TestCase { public function testFind() { $this->assertNull($this->manager->find('/')); - $rootMount = new \OC\Files\Mount\Mount(new Temporary(array()), '/'); + $rootMount = new \OC\Files\Mount\MountPoint(new Temporary(array()), '/'); $this->manager->addMount($rootMount); $this->assertEquals($rootMount, $this->manager->find('/')); $this->assertEquals($rootMount, $this->manager->find('/foo/bar')); $storage = new Temporary(array()); - $mount1 = new \OC\Files\Mount\Mount($storage, '/foo'); + $mount1 = new \OC\Files\Mount\MountPoint($storage, '/foo'); $this->manager->addMount($mount1); $this->assertEquals($rootMount, $this->manager->find('/')); $this->assertEquals($mount1, $this->manager->find('/foo/bar')); $this->assertEquals(1, count($this->manager->findIn('/'))); - $mount2 = new \OC\Files\Mount\Mount(new Temporary(array()), '/bar'); + $mount2 = new \OC\Files\Mount\MountPoint(new Temporary(array()), '/bar'); $this->manager->addMount($mount2); $this->assertEquals(2, count($this->manager->findIn('/'))); $id = $mount1->getStorageId(); $this->assertEquals(array($mount1), $this->manager->findByStorageId($id)); - $mount3 = new \OC\Files\Mount\Mount($storage, '/foo/bar'); + $mount3 = new \OC\Files\Mount\MountPoint($storage, '/foo/bar'); $this->manager->addMount($mount3); $this->assertEquals(array($mount1, $mount3), $this->manager->findByStorageId($id)); } public function testLong() { $storage = new LongId(array()); - $mount = new \OC\Files\Mount\Mount($storage, '/foo'); + $mount = new \OC\Files\Mount\MountPoint($storage, '/foo'); $this->manager->addMount($mount); $id = $mount->getStorageId(); diff --git a/tests/lib/files/mount/mount.php b/tests/lib/files/mount/mount.php index 5ee3d934e97..584766de836 100644 --- a/tests/lib/files/mount/mount.php +++ b/tests/lib/files/mount/mount.php @@ -9,7 +9,7 @@ namespace Test\Files\Mount; -use OC\Files\Storage\Loader; +use OC\Files\Storage\StorageFactory; use OC\Files\Storage\Wrapper\Wrapper; class Mount extends \Test\TestCase { @@ -17,12 +17,12 @@ class Mount extends \Test\TestCase { $storage = $this->getMockBuilder('\OC\Files\Storage\Temporary') ->disableOriginalConstructor() ->getMock(); - $mount = new \OC\Files\Mount\Mount($storage, '/foo'); + $mount = new \OC\Files\Mount\MountPoint($storage, '/foo'); $this->assertInstanceOf('\OC\Files\Storage\Temporary', $mount->getStorage()); } public function testFromStorageClassname() { - $mount = new \OC\Files\Mount\Mount('\OC\Files\Storage\Temporary', '/foo'); + $mount = new \OC\Files\Mount\MountPoint('\OC\Files\Storage\Temporary', '/foo'); $this->assertInstanceOf('\OC\Files\Storage\Temporary', $mount->getStorage()); } @@ -34,13 +34,13 @@ class Mount extends \Test\TestCase { return new Wrapper(array('storage' => $storage)); }; - $loader = new Loader(); + $loader = new StorageFactory(); $loader->addStorageWrapper('test_wrapper', $wrapper); $storage = $this->getMockBuilder('\OC\Files\Storage\Temporary') ->disableOriginalConstructor() ->getMock(); - $mount = new \OC\Files\Mount\Mount($storage, '/foo', array(), $loader); + $mount = new \OC\Files\Mount\MountPoint($storage, '/foo', array(), $loader); $this->assertInstanceOf('\OC\Files\Storage\Wrapper\Wrapper', $mount->getStorage()); } } diff --git a/tests/lib/files/node/folder.php b/tests/lib/files/node/folder.php index 4aa57aa9373..d8c047a2b75 100644 --- a/tests/lib/files/node/folder.php +++ b/tests/lib/files/node/folder.php @@ -10,7 +10,7 @@ namespace Test\Files\Node; use OC\Files\Cache\Cache; use OC\Files\FileInfo; -use OC\Files\Mount\Mount; +use OC\Files\Mount\MountPoint; use OC\Files\Node\Node; use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; @@ -419,7 +419,7 @@ class Folder extends \Test\TestCase { $cache = $this->getMock('\OC\Files\Cache\Cache', array(), array('')); $subCache = $this->getMock('\OC\Files\Cache\Cache', array(), array('')); $subStorage = $this->getMock('\OC\Files\Storage\Storage'); - $subMount = $this->getMock('\OC\Files\Mount\Mount', array(), array(null, '')); + $subMount = $this->getMock('\OC\Files\Mount\MountPoint', array(), array(null, '')); $subMount->expects($this->once()) ->method('getStorage') @@ -487,7 +487,7 @@ class Folder extends \Test\TestCase { ->method('getUser') ->will($this->returnValue($this->user)); $storage = $this->getMock('\OC\Files\Storage\Storage'); - $mount = new Mount($storage, '/bar'); + $mount = new MountPoint($storage, '/bar'); $cache = $this->getMock('\OC\Files\Cache\Cache', array(), array('')); $view->expects($this->once()) @@ -530,7 +530,7 @@ class Folder extends \Test\TestCase { ->method('getUser') ->will($this->returnValue($this->user)); $storage = $this->getMock('\OC\Files\Storage\Storage'); - $mount = new Mount($storage, '/bar'); + $mount = new MountPoint($storage, '/bar'); $cache = $this->getMock('\OC\Files\Cache\Cache', array(), array('')); $storage->expects($this->once()) @@ -568,8 +568,8 @@ class Folder extends \Test\TestCase { ->method('getUser') ->will($this->returnValue($this->user)); $storage = $this->getMock('\OC\Files\Storage\Storage'); - $mount1 = new Mount($storage, '/bar'); - $mount2 = new Mount($storage, '/bar/foo/asd'); + $mount1 = new MountPoint($storage, '/bar'); + $mount2 = new MountPoint($storage, '/bar/foo/asd'); $cache = $this->getMock('\OC\Files\Cache\Cache', array(), array('')); $view->expects($this->any()) diff --git a/tests/lib/files/utils/scanner.php b/tests/lib/files/utils/scanner.php index f729be81bd7..65ddfe47514 100644 --- a/tests/lib/files/utils/scanner.php +++ b/tests/lib/files/utils/scanner.php @@ -9,17 +9,17 @@ namespace Test\Files\Utils; use OC\Files\Filesystem; -use OC\Files\Mount\Mount; +use OC\Files\Mount\MountPoint; use OC\Files\Storage\Temporary; class TestScanner extends \OC\Files\Utils\Scanner { /** - * @var \OC\Files\Mount\Mount[] $mounts + * @var \OC\Files\Mount\MountPoint[] $mounts */ private $mounts = array(); /** - * @param \OC\Files\Mount\Mount $mount + * @param \OC\Files\Mount\MountPoint $mount */ public function addMount($mount) { $this->mounts[] = $mount; @@ -56,7 +56,7 @@ class Scanner extends \Test\TestCase { public function testReuseExistingRoot() { $storage = new Temporary(array()); - $mount = new Mount($storage, ''); + $mount = new MountPoint($storage, ''); Filesystem::getMountManager()->addMount($mount); $cache = $storage->getCache(); @@ -78,7 +78,7 @@ class Scanner extends \Test\TestCase { public function testReuseExistingFile() { $storage = new Temporary(array()); - $mount = new Mount($storage, ''); + $mount = new MountPoint($storage, ''); Filesystem::getMountManager()->addMount($mount); $cache = $storage->getCache(); @@ -105,7 +105,7 @@ class Scanner extends \Test\TestCase { $propagator = $this->getMock('\OC\Files\Cache\ChangePropagator', array('propagateChanges'), array(), '', false); $storage = new Temporary(array()); - $mount = new Mount($storage, '/foo'); + $mount = new MountPoint($storage, '/foo'); Filesystem::getMountManager()->addMount($mount); $cache = $storage->getCache(); |