From 73e6eea57e0454a74b6b461e15d2c4fac61ed524 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 4 Apr 2018 12:50:54 +0200 Subject: [PATCH] Fix tests Signed-off-by: Roeland Jago Douma --- lib/private/Files/Mount/Manager.php | 4 ++-- lib/public/Files/Mount/IMountManager.php | 4 ++-- tests/lib/Files/Storage/Wrapper/EncryptionTest.php | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/private/Files/Mount/Manager.php b/lib/private/Files/Mount/Manager.php index f27dfaacc8..019dda03a4 100644 --- a/lib/private/Files/Mount/Manager.php +++ b/lib/private/Files/Mount/Manager.php @@ -76,9 +76,9 @@ class Manager implements IMountManager { * Find the mount for $path * * @param string $path - * @return MountPoint + * @return MountPoint|null */ - public function find(string $path): IMountPoint { + public function find(string $path) { \OC_Util::setupFS(); $path = $this->formatPath($path); if (isset($this->mounts[$path])) { diff --git a/lib/public/Files/Mount/IMountManager.php b/lib/public/Files/Mount/IMountManager.php index da40419d9e..b9ec85bc1d 100644 --- a/lib/public/Files/Mount/IMountManager.php +++ b/lib/public/Files/Mount/IMountManager.php @@ -61,10 +61,10 @@ interface IMountManager { * Find the mount for $path * * @param string $path - * @return \OCP\Files\Mount\IMountPoint + * @return \OCP\Files\Mount\IMountPoint|null * @since 8.2.0 */ - public function find(string $path): IMountPoint; + public function find(string $path); /** * Find all mounts in $path diff --git a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php index 082c08b3e4..22c93ee0a9 100644 --- a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php +++ b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php @@ -730,6 +730,8 @@ class EncryptionTest extends Storage { $temp = \OC::$server->getTempManager(); return fopen($temp->getTemporaryFile(), $mode); }); + $storage2->method('getId') + ->willReturn('stroage2'); $cache = $this->createMock(ICache::class); $cache->expects($this->once()) ->method('get') @@ -777,6 +779,8 @@ class EncryptionTest extends Storage { $temp = \OC::$server->getTempManager(); return fopen($temp->getTemporaryFile(), $mode); }); + $storage2->method('getId') + ->willReturn('stroage2'); if($expectedEncrypted) { $cache = $this->createMock(ICache::class); $cache->expects($this->once())