diff options
author | Robin McCorkell <rmccorkell@karoshi.org.uk> | 2015-03-07 00:12:46 +0000 |
---|---|---|
committer | Robin McCorkell <rmccorkell@karoshi.org.uk> | 2015-07-20 16:27:26 +0100 |
commit | 75a5e6e12b18a9f5b7b113cd7e2c9c56c204084d (patch) | |
tree | 51a9ba575f69fddc99f34a8cc611f7dd716c1554 /tests/lib/files/mount | |
parent | df19cabb44f9106484290a269ef6d4cb07b059d7 (diff) | |
download | nextcloud-server-75a5e6e12b18a9f5b7b113cd7e2c9c56c204084d.tar.gz nextcloud-server-75a5e6e12b18a9f5b7b113cd7e2c9c56c204084d.zip |
Fix mounting wrapped storages resulting in many-layered wrapping
This usually doesn't cause issues, but in unit tests sometimes a wrapped
storage is passed to Filesystem::mount() and gets rewrapped, hitting the
XDebug function nesting level limit when used.
Diffstat (limited to 'tests/lib/files/mount')
-rw-r--r-- | tests/lib/files/mount/mountpoint.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/lib/files/mount/mountpoint.php b/tests/lib/files/mount/mountpoint.php index 29610e6058d..d758c1b8d4d 100644 --- a/tests/lib/files/mount/mountpoint.php +++ b/tests/lib/files/mount/mountpoint.php @@ -70,4 +70,25 @@ 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()); + } } |