diff options
author | Joas Schilling <coding@schilljs.com> | 2023-05-31 14:15:52 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-06-02 08:08:24 +0200 |
commit | 6d076c1ee9f0cd2de7357df801c27b08a70b89a1 (patch) | |
tree | 6b73bdbfe84e19e6b1a655c24a5ee87e566b6531 /tests/lib | |
parent | 5591da0b33f4f4ce50f289318c49595e116ba4a3 (diff) | |
download | nextcloud-server-6d076c1ee9f0cd2de7357df801c27b08a70b89a1.tar.gz nextcloud-server-6d076c1ee9f0cd2de7357df801c27b08a70b89a1.zip |
fix(dispatcher): Migrate to OCP event dispatcher before symfony/event-dispatcher upgrade
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/EventDispatcher/SymfonyAdapterTest.php | 1 | ||||
-rw-r--r-- | tests/lib/Share20/LegacyHooksTest.php | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/tests/lib/EventDispatcher/SymfonyAdapterTest.php b/tests/lib/EventDispatcher/SymfonyAdapterTest.php index 1b770c94e56..623706f9da7 100644 --- a/tests/lib/EventDispatcher/SymfonyAdapterTest.php +++ b/tests/lib/EventDispatcher/SymfonyAdapterTest.php @@ -179,6 +179,7 @@ class SymfonyAdapterTest extends TestCase { $symfonyDispatcher->expects(self::once()) ->method('dispatch') ->with( + $this->anything(), $eventName ) ->willReturnArgument(0); diff --git a/tests/lib/Share20/LegacyHooksTest.php b/tests/lib/Share20/LegacyHooksTest.php index c7ea141eaf8..b8b005abd4e 100644 --- a/tests/lib/Share20/LegacyHooksTest.php +++ b/tests/lib/Share20/LegacyHooksTest.php @@ -23,12 +23,15 @@ namespace Test\Share20; +use OC\EventDispatcher\SymfonyAdapter; use OC\Share20\LegacyHooks; use OC\Share20\Manager; use OCP\Constants; 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; @@ -46,7 +49,10 @@ class LegacyHooksTest extends TestCase { protected function setUp(): void { parent::setUp(); - $this->eventDispatcher = new EventDispatcher(); + $symfonyDispatcher = new \Symfony\Component\EventDispatcher\EventDispatcher(); + $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->manager = \OC::$server->getShareManager(); } |