diff options
author | Joas Schilling <coding@schilljs.com> | 2023-07-25 19:30:15 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-07-27 09:57:53 +0200 |
commit | c67c067ee796d8a466c47458d06a8a0c20f8d5c2 (patch) | |
tree | 70ee4ddbfc886038cb58a26e9226e1aeb1b1e3fd /tests/lib | |
parent | 44a0a621075962fecd9a3c94e724e2b544f7ce38 (diff) | |
download | nextcloud-server-c67c067ee796d8a466c47458d06a8a0c20f8d5c2.tar.gz nextcloud-server-c67c067ee796d8a466c47458d06a8a0c20f8d5c2.zip |
fix: Move Sharing events to IEventDispatcher
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/Share20/LegacyHooksTest.php | 6 | ||||
-rw-r--r-- | tests/lib/Share20/ManagerTest.php | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/lib/Share20/LegacyHooksTest.php b/tests/lib/Share20/LegacyHooksTest.php index b8b005abd4e..54d8e0be725 100644 --- a/tests/lib/Share20/LegacyHooksTest.php +++ b/tests/lib/Share20/LegacyHooksTest.php @@ -27,12 +27,12 @@ use OC\EventDispatcher\SymfonyAdapter; use OC\Share20\LegacyHooks; use OC\Share20\Manager; use OCP\Constants; +use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Cache\ICacheEntry; use OCP\Files\File; use OCP\IServerContainer; use OCP\Share\IShare; use Psr\Log\LoggerInterface; -use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\GenericEvent; use Test\TestCase; @@ -40,7 +40,7 @@ class LegacyHooksTest extends TestCase { /** @var LegacyHooks */ private $hooks; - /** @var EventDispatcher */ + /** @var IEventDispatcher */ private $eventDispatcher; /** @var Manager */ @@ -53,7 +53,7 @@ class LegacyHooksTest extends TestCase { $logger = $this->createMock(LoggerInterface::class); $eventDispatcher = new \OC\EventDispatcher\EventDispatcher($symfonyDispatcher, \OC::$server->get(IServerContainer::class), $logger); $this->eventDispatcher = new SymfonyAdapter($eventDispatcher, $logger); - $this->hooks = new LegacyHooks($this->eventDispatcher); + $this->hooks = new LegacyHooks($eventDispatcher); $this->manager = \OC::$server->getShareManager(); } diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php index 0e56592e1a5..a23aa6023af 100644 --- a/tests/lib/Share20/ManagerTest.php +++ b/tests/lib/Share20/ManagerTest.php @@ -545,7 +545,7 @@ class ManagerTest extends \Test\TestCase { ['core', 'shareapi_enforce_links_password', 'no', 'no'], ]); - $this->eventDispatcher->expects($this->once())->method('dispatch') + $this->dispatcher->expects($this->once())->method('dispatchTyped') ->willReturnCallback(function (Event $event) { $this->assertInstanceOf(ValidatePasswordPolicyEvent::class, $event); /** @var ValidatePasswordPolicyEvent $event */ @@ -567,7 +567,7 @@ class ManagerTest extends \Test\TestCase { ['core', 'shareapi_enforce_links_password', 'no', 'no'], ]); - $this->eventDispatcher->expects($this->once())->method('dispatch') + $this->dispatcher->expects($this->once())->method('dispatchTyped') ->willReturnCallback(function (Event $event) { $this->assertInstanceOf(ValidatePasswordPolicyEvent::class, $event); /** @var ValidatePasswordPolicyEvent $event */ |