Revert "Fix mounting wrapped storages resulting in many-layered wrapping"

This reverts commit 75a5e6e12b.
This commit is contained in:
Robin McCorkell 2015-08-10 23:20:27 +01:00
parent 118cb7df1a
commit 3b27603762
2 changed files with 1 additions and 27 deletions

View File

@ -29,7 +29,6 @@ namespace OC\Files\Mount;
use \OC\Files\Filesystem;
use OC\Files\Storage\StorageFactory;
use OC\Files\Storage\Storage;
use OC\Files\Storage\Wrapper\Wrapper;
use OCP\Files\Mount\IMountPoint;
class MountPoint implements IMountPoint {
@ -93,11 +92,7 @@ class MountPoint implements IMountPoint {
$this->mountPoint = $mountpoint;
if ($storage instanceof Storage) {
$this->class = get_class($storage);
$this->storage = $storage;
// only wrap if not already wrapped
if (!($this->storage instanceof Wrapper)) {
$this->storage = $this->loader->wrap($this, $this->storage);
}
$this->storage = $this->loader->wrap($this, $storage);
} else {
// Update old classes to new namespace
if (strpos($storage, 'OC_Filestorage_') !== false) {

View File

@ -70,25 +70,4 @@ class MountPoint extends \Test\TestCase {
// storage wrapper never called
$this->assertFalse($called);
}
public function testWrappedStorage() {
$storage = $this->getMockBuilder('\OC\Files\Storage\Wrapper\Wrapper')
->disableOriginalConstructor()
->getMock();
$loader = $this->getMock('\OCP\Files\Storage\IStorageFactory');
$loader->expects($this->never())
->method('getInstance');
$loader->expects($this->never())
->method('wrap');
$mountPoint = new \OC\Files\Mount\MountPoint(
$storage,
'/mountpoint',
null,
$loader
);
$this->assertEquals($storage, $mountPoint->getStorage());
}
}