diff options
-rw-r--r-- | lib/private/Files/Cache/Wrapper/CacheJail.php | 2 | ||||
-rw-r--r-- | lib/private/Share20/Share.php | 1 | ||||
-rw-r--r-- | tests/lib/Share20/LegacyHooksTest.php | 19 |
3 files changed, 17 insertions, 5 deletions
diff --git a/lib/private/Files/Cache/Wrapper/CacheJail.php b/lib/private/Files/Cache/Wrapper/CacheJail.php index 97700156d08..fe3124301ba 100644 --- a/lib/private/Files/Cache/Wrapper/CacheJail.php +++ b/lib/private/Files/Cache/Wrapper/CacheJail.php @@ -231,7 +231,7 @@ class CacheJail extends CacheWrapper { } private function formatSearchResults($results) { - return array_map(function($entry) { + return array_map(function ($entry) { $entry['path'] = $this->getJailedPath($entry['path'], $this->getGetUnjailedRoot()); return $entry; }, $results); diff --git a/lib/private/Share20/Share.php b/lib/private/Share20/Share.php index 9b782d5a446..a4fbf051413 100644 --- a/lib/private/Share20/Share.php +++ b/lib/private/Share20/Share.php @@ -31,7 +31,6 @@ namespace OC\Share20; use OCP\Files\Cache\ICacheEntry; -use OCP\Files\File; use OCP\Files\FileInfo; use OCP\Files\IRootFolder; use OCP\Files\Node; diff --git a/tests/lib/Share20/LegacyHooksTest.php b/tests/lib/Share20/LegacyHooksTest.php index 66dbafe7691..a615e26afb0 100644 --- a/tests/lib/Share20/LegacyHooksTest.php +++ b/tests/lib/Share20/LegacyHooksTest.php @@ -26,6 +26,7 @@ namespace Test\Share20; use OC\Share20\LegacyHooks; use OC\Share20\Manager; use OCP\Constants; +use OCP\Files\Cache\ICacheEntry; use OCP\Files\File; use OCP\Share\IShare; use Symfony\Component\EventDispatcher\EventDispatcher; @@ -55,6 +56,9 @@ class LegacyHooksTest extends TestCase { $path = $this->createMock(File::class); $path->method('getId')->willReturn(1); + $info = $this->createMock(ICacheEntry::class); + $info->method('getMimeType')->willReturn('text/plain'); + $share = $this->manager->newShare(); $share->setId(42) ->setProviderId('prov') @@ -62,7 +66,8 @@ class LegacyHooksTest extends TestCase { ->setSharedWith('awesomeUser') ->setSharedBy('sharedBy') ->setNode($path) - ->setTarget('myTarget'); + ->setTarget('myTarget') + ->setNodeCacheEntry($info); $hookListner = $this->getMockBuilder('Dummy')->setMethods(['pre'])->getMock(); \OCP\Util::connectHook('OCP\Share', 'pre_unshare', $hookListner, 'pre'); @@ -92,6 +97,9 @@ class LegacyHooksTest extends TestCase { $path = $this->createMock(File::class); $path->method('getId')->willReturn(1); + $info = $this->createMock(ICacheEntry::class); + $info->method('getMimeType')->willReturn('text/plain'); + $share = $this->manager->newShare(); $share->setId(42) ->setProviderId('prov') @@ -99,7 +107,8 @@ class LegacyHooksTest extends TestCase { ->setSharedWith('awesomeUser') ->setSharedBy('sharedBy') ->setNode($path) - ->setTarget('myTarget'); + ->setTarget('myTarget') + ->setNodeCacheEntry($info); $hookListner = $this->getMockBuilder('Dummy')->setMethods(['post'])->getMock(); \OCP\Util::connectHook('OCP\Share', 'post_unshare', $hookListner, 'post'); @@ -143,6 +152,9 @@ class LegacyHooksTest extends TestCase { $path = $this->createMock(File::class); $path->method('getId')->willReturn(1); + $info = $this->createMock(ICacheEntry::class); + $info->method('getMimeType')->willReturn('text/plain'); + $share = $this->manager->newShare(); $share->setId(42) ->setProviderId('prov') @@ -150,7 +162,8 @@ class LegacyHooksTest extends TestCase { ->setSharedWith('awesomeUser') ->setSharedBy('sharedBy') ->setNode($path) - ->setTarget('myTarget'); + ->setTarget('myTarget') + ->setNodeCacheEntry($info); $hookListner = $this->getMockBuilder('Dummy')->setMethods(['postFromSelf'])->getMock(); \OCP\Util::connectHook('OCP\Share', 'post_unshareFromSelf', $hookListner, 'postFromSelf'); |