aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2021-04-29 10:04:08 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2021-04-29 15:31:19 +0200
commit63eb3694e4a2d87342f8b478bd02fff79a8c73e7 (patch)
tree927a85056427fa32254f37ee58ad709d93f1cf4d /apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php
parentabb5b5d983be485b7e006085643788e5e007d942 (diff)
downloadnextcloud-server-63eb3694e4a2d87342f8b478bd02fff79a8c73e7.tar.gz
nextcloud-server-63eb3694e4a2d87342f8b478bd02fff79a8c73e7.zip
Exclusively use the typed calendar deletion events for DAV
We had both in places, but the old one isn't used anywhere outside this app, so it's time to migrate the code. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php')
-rw-r--r--apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php
index 51ba8c1867a..b512847a7e8 100644
--- a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php
+++ b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php
@@ -31,6 +31,7 @@ use OC\KnownUser\KnownUserService;
use OCA\DAV\CalDAV\CalDavBackend;
use OCA\DAV\CalDAV\Proxy\ProxyMapper;
use OCA\DAV\Connector\Sabre\Principal;
+use OCA\DAV\Events\CalendarDeletedEvent;
use OCP\App\IAppManager;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
@@ -133,11 +134,12 @@ abstract class AbstractCalDavBackend extends TestCase {
private function cleanupForPrincipal($principal): void {
$calendars = $this->backend->getCalendarsForUser($principal);
+ $this->legacyDispatcher->expects(self::exactly(count($calendars)))
+ ->method('dispatchTyped')
+ ->with(self::callback(function ($event) {
+ return $event instanceof CalendarDeletedEvent;
+ }));
foreach ($calendars as $calendar) {
- $this->legacyDispatcher->expects($this->at(0))
- ->method('dispatch')
- ->with('\OCA\DAV\CalDAV\CalDavBackend::deleteCalendar');
-
$this->backend->deleteCalendar($calendar['id']);
}
$subscriptions = $this->backend->getSubscriptionsForUser($principal);