diff options
author | Robin Appelman <robin@icewind.nl> | 2021-01-26 17:48:04 +0300 |
---|---|---|
committer | Daniel Kesselberg <mail@danielkesselberg.de> | 2021-03-16 17:27:00 +0300 |
commit | 1d1d4de991541508181d2ac21fbc09e3e60e151a (patch) | |
tree | 01b9bbb605f784dc30fac0d3b2800e41b02a966f /tests | |
parent | b9b2c6d2fa6bd4ddf3a93188f6c7432edc115696 (diff) |
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 2b062e592ba..a759b86e4a1 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 Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\GenericEvent; @@ -54,6 +55,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') @@ -61,7 +65,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'); @@ -91,6 +96,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') @@ -98,7 +106,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'); @@ -142,6 +151,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') @@ -149,7 +161,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'); |