diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-07-13 16:05:11 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-07-15 13:55:26 +0200 |
commit | 217a69ebf9cd766c23b6f69037cbbe07cb00b7ce (patch) | |
tree | f95428cddfe142f569a5c1a2dfd35fd6e3648e5c /apps/files_sharing/tests/Controller | |
parent | 2ad95feab6dd525cdda5aa61c22119c98d21ca97 (diff) | |
download | nextcloud-server-217a69ebf9cd766c23b6f69037cbbe07cb00b7ce.tar.gz nextcloud-server-217a69ebf9cd766c23b6f69037cbbe07cb00b7ce.zip |
Add BeforeTemplateRenderedEvent for files_sharing
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/files_sharing/tests/Controller')
-rw-r--r-- | apps/files_sharing/tests/Controller/ShareControllerTest.php | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/apps/files_sharing/tests/Controller/ShareControllerTest.php b/apps/files_sharing/tests/Controller/ShareControllerTest.php index 2f1df959afb..18b663f09bc 100644 --- a/apps/files_sharing/tests/Controller/ShareControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareControllerTest.php @@ -48,6 +48,7 @@ use OCP\AppFramework\Http\Template\LinkMenuAction; use OCP\AppFramework\Http\Template\PublicTemplateResponse; use OCP\AppFramework\Http\Template\SimpleMenuAction; use OCP\Constants; +use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\File; use OCP\Files\NotFoundException; use OCP\Files\Storage; @@ -64,7 +65,6 @@ use OCP\Security\ISecureRandom; use OCP\Share\Exceptions\ShareNotFound; use OCP\Share\IShare; use PHPUnit\Framework\MockObject\MockObject; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; use OCP\Activity\IManager; use OCP\Files\IRootFolder; use OCP\Defaults; @@ -102,7 +102,7 @@ class ShareControllerTest extends \Test\TestCase { private $federatedShareProvider; /** @var IAccountManager|MockObject */ private $accountManager; - /** @var EventDispatcherInterface|MockObject */ + /** @var IEventDispatcher|MockObject */ private $eventDispatcher; /** @var IL10N */ private $l10n; @@ -123,7 +123,7 @@ class ShareControllerTest extends \Test\TestCase { $this->federatedShareProvider->expects($this->any()) ->method('isIncomingServer2serverShareEnabled')->willReturn(true); $this->accountManager = $this->createMock(IAccountManager::class); - $this->eventDispatcher = $this->createMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $this->eventDispatcher = $this->createMock(IEventDispatcher::class); $this->l10n = $this->createMock(IL10N::class); $this->shareController = new \OCA\Files_Sharing\Controller\ShareController( @@ -296,11 +296,10 @@ class ShareControllerTest extends \Test\TestCase { }); $this->eventDispatcher->expects($this->once()) - ->method('dispatch') + ->method('dispatchTyped') ->with( - 'OCA\Files_Sharing::loadAdditionalScripts', $this->callback(function ($event) use ($share) { - return $event->getArgument('share') === $share; + return $event->getShare() === $share; }) ); @@ -443,11 +442,10 @@ class ShareControllerTest extends \Test\TestCase { }); $this->eventDispatcher->expects($this->once()) - ->method('dispatch') + ->method('dispatchTyped') ->with( - 'OCA\Files_Sharing::loadAdditionalScripts', $this->callback(function ($event) use ($share) { - return $event->getArgument('share') === $share; + return $event->getShare() === $share; }) ); @@ -594,11 +592,10 @@ class ShareControllerTest extends \Test\TestCase { }); $this->eventDispatcher->expects($this->once()) - ->method('dispatch') + ->method('dispatchTyped') ->with( - 'OCA\Files_Sharing::loadAdditionalScripts', $this->callback(function ($event) use ($share) { - return $event->getArgument('share') === $share; + return $event->getShare() === $share; }) ); |