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;
$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')
->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');
$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')
->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');
$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')
->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');