mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
fix tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
e3bafcc7a8
commit
9f3dbb699a
3 changed files with 16 additions and 5 deletions
|
|
@ -196,11 +196,15 @@ class MountPoint implements IMountPoint {
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getStorageId() {
|
||||
if (!$this->storageId) {
|
||||
$this->storageId = $this->getStorage()->getId();
|
||||
$storage = $this->getStorage();
|
||||
if (is_null($storage)) {
|
||||
return null;
|
||||
}
|
||||
$this->storageId = $storage->getId();
|
||||
if (strlen($this->storageId) > 64) {
|
||||
$this->storageId = md5($this->storageId);
|
||||
}
|
||||
|
|
@ -213,7 +217,11 @@ class MountPoint implements IMountPoint {
|
|||
*/
|
||||
public function getNumericStorageId() {
|
||||
if (is_null($this->numericStorageId)) {
|
||||
$this->numericStorageId = $this->getStorage()->getStorageCache()->getNumericId();
|
||||
$storage = $this->getStorage();
|
||||
if (is_null($storage)) {
|
||||
return -1;
|
||||
}
|
||||
$this->numericStorageId = $storage->getStorageCache()->getNumericId();
|
||||
}
|
||||
return $this->numericStorageId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ interface IMountPoint {
|
|||
/**
|
||||
* Get the id of the storages
|
||||
*
|
||||
* @return string
|
||||
* @return string|null
|
||||
* @since 8.0.0
|
||||
*/
|
||||
public function getStorageId();
|
||||
|
|
@ -63,7 +63,7 @@ interface IMountPoint {
|
|||
/**
|
||||
* Get the id of the storages
|
||||
*
|
||||
* @return int
|
||||
* @return int|null
|
||||
* @since 9.1.0
|
||||
*/
|
||||
public function getNumericStorageId();
|
||||
|
|
|
|||
|
|
@ -1590,6 +1590,9 @@ class ViewTest extends \Test\TestCase {
|
|||
->setConstructorArgs([[]])
|
||||
->getMock();
|
||||
$storage->method('getId')->willReturn('non-null-id');
|
||||
$storage->method('getStorageCache')->willReturnCallback(function () use ($storage) {
|
||||
return new \OC\Files\Cache\Storage($storage);
|
||||
});
|
||||
|
||||
$mounts[] = $this->getMockBuilder(TestMoveableMountPoint::class)
|
||||
->setMethods(['moveMount'])
|
||||
|
|
|
|||
Loading…
Reference in a new issue