diff options
author | Robin Appelman <robin@icewind.nl> | 2021-01-26 15:48:04 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2021-03-15 17:51:34 +0000 |
commit | c7278790738c346e25f4ad201806e4a7a9e81363 (patch) | |
tree | b066ec7fff801ce43890ef6a1edc9c66470592e4 /tests | |
parent | ec0985ba68069a6fb2bd3c9454be5d533a124881 (diff) | |
download | nextcloud-server-c7278790738c346e25f4ad201806e4a7a9e81363.tar.gz nextcloud-server-c7278790738c346e25f4ad201806e4a7a9e81363.zip |
adjust tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Share20/LegacyHooksTest.php | 19 |
1 files changed, 16 insertions, 3 deletions
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'); |