diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2021-05-07 12:36:23 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2021-05-07 13:13:45 +0300 |
commit | 257613e6efd429dd1c6cde4abbcbb590d32408e8 (patch) | |
tree | 104b2ae9487bc1ae17e8f936078abfdb38f1bd8b /apps/dav/tests/unit/CalDAV/CalDavBackendTest.php | |
parent | f808267949e5513188961ca5f6fc38d57f6c7fd1 (diff) |
Remove the \OCA\DAV\CalDAV\CalDavBackend::createCalendarObject event
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/dav/tests/unit/CalDAV/CalDavBackendTest.php')
-rw-r--r-- | apps/dav/tests/unit/CalDAV/CalDavBackendTest.php | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php index 96ae4312fda..097fbd79fe3 100644 --- a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php +++ b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php @@ -37,6 +37,7 @@ use DateTimeZone; use OCA\DAV\CalDAV\CalDavBackend; use OCA\DAV\CalDAV\Calendar; use OCA\DAV\Events\CalendarDeletedEvent; +use OCA\DAV\Events\CalendarObjectCreatedEvent; use OCA\DAV\Events\CalendarUpdatedEvent; use OCP\IConfig; use OCP\IL10N; @@ -187,9 +188,11 @@ END:VEVENT END:VCALENDAR EOD; - $this->legacyDispatcher->expects($this->at(0)) - ->method('dispatch') - ->with('\OCA\DAV\CalDAV\CalDavBackend::createCalendarObject'); + $this->dispatcher->expects(self::once()) + ->method('dispatchTyped') + ->with(self::callback(function ($event) { + return $event instanceof CalendarObjectCreatedEvent; + })); $this->backend->createCalendarObject($calendarId, $uri, $calData); /** @var IACL $child */ @@ -233,9 +236,11 @@ END:VEVENT END:VCALENDAR EOD; - $this->legacyDispatcher->expects($this->at(0)) - ->method('dispatch') - ->with('\OCA\DAV\CalDAV\CalDavBackend::createCalendarObject'); + $this->dispatcher->expects(self::once()) + ->method('dispatchTyped') + ->with(self::callback(function ($event) { + return $event instanceof CalendarObjectCreatedEvent; + })); $this->backend->createCalendarObject($calendarId, $uri, $calData); // get all the cards @@ -378,19 +383,25 @@ END:VCALENDAR EOD; $uri0 = static::getUniqueID('card'); - $this->legacyDispatcher->expects($this->at(0)) - ->method('dispatch') - ->with('\OCA\DAV\CalDAV\CalDavBackend::createCalendarObject'); + $this->dispatcher->expects(self::once()) + ->method('dispatchTyped') + ->with(self::callback(function ($event) { + return $event instanceof CalendarObjectCreatedEvent; + })); $this->backend->createCalendarObject($calendarId, $uri0, $calData[0]); $uri1 = static::getUniqueID('card'); - $this->legacyDispatcher->expects($this->at(0)) - ->method('dispatch') - ->with('\OCA\DAV\CalDAV\CalDavBackend::createCalendarObject'); + $this->dispatcher->expects(self::once()) + ->method('dispatchTyped') + ->with(self::callback(function ($event) { + return $event instanceof CalendarObjectCreatedEvent; + })); $this->backend->createCalendarObject($calendarId, $uri1, $calData[1]); $uri2 = static::getUniqueID('card'); - $this->legacyDispatcher->expects($this->at(0)) - ->method('dispatch') - ->with('\OCA\DAV\CalDAV\CalDavBackend::createCalendarObject'); + $this->dispatcher->expects(self::once()) + ->method('dispatchTyped') + ->with(self::callback(function ($event) { + return $event instanceof CalendarObjectCreatedEvent; + })); $this->backend->createCalendarObject($calendarId, $uri2, $calData[2]); // get all the cards |