summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2021-05-07 16:58:33 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2021-05-07 16:58:33 +0200
commit884e34b12a90f8958ac46e0b8c135d61c3895cd5 (patch)
treece99e6d9fe38fb00f808cec95a4a3d8f2dfc0941 /apps/dav/tests
parentf8c519f5f0b52075c5b343233a5e48f9bc8cf3aa (diff)
downloadnextcloud-server-884e34b12a90f8958ac46e0b8c135d61c3895cd5.tar.gz
nextcloud-server-884e34b12a90f8958ac46e0b8c135d61c3895cd5.zip
Remove the untyped calendar create event
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/dav/tests')
-rw-r--r--apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php9
-rw-r--r--apps/dav/tests/unit/CalDAV/CalDavBackendTest.php9
2 files changed, 12 insertions, 6 deletions
diff --git a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php
index 17ac839b5f2..1264342e27c 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\CalendarCreatedEvent;
use OCA\DAV\Events\CalendarDeletedEvent;
use OCA\DAV\Events\CalendarObjectCreatedEvent;
use OCP\App\IAppManager;
@@ -150,9 +151,11 @@ abstract class AbstractCalDavBackend extends TestCase {
}
protected function createTestCalendar() {
- $this->legacyDispatcher->expects($this->at(0))
- ->method('dispatch')
- ->with('\OCA\DAV\CalDAV\CalDavBackend::createCalendar');
+ $this->dispatcher->expects(self::once())
+ ->method('dispatchTyped')
+ ->with(self::callback(function ($event) {
+ return $event instanceof CalendarCreatedEvent;
+ }));
$this->backend->createCalendar(self::UNIT_TEST_USER, 'Example', [
'{http://apple.com/ns/ical/}calendar-color' => '#1C4587FF'
diff --git a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
index 097fbd79fe3..ec77c1f7d8c 100644
--- a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
+++ b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
@@ -36,6 +36,7 @@ use DateTime;
use DateTimeZone;
use OCA\DAV\CalDAV\CalDavBackend;
use OCA\DAV\CalDAV\Calendar;
+use OCA\DAV\Events\CalendarCreatedEvent;
use OCA\DAV\Events\CalendarDeletedEvent;
use OCA\DAV\Events\CalendarObjectCreatedEvent;
use OCA\DAV\Events\CalendarUpdatedEvent;
@@ -527,9 +528,11 @@ EOD;
}
public function testPublications() {
- $this->legacyDispatcher->expects($this->at(0))
- ->method('dispatch')
- ->with('\OCA\DAV\CalDAV\CalDavBackend::createCalendar');
+ $this->dispatcher->expects(self::once())
+ ->method('dispatchTyped')
+ ->with(self::callback(function ($event) {
+ return $event instanceof CalendarCreatedEvent;
+ }));
$this->backend->createCalendar(self::UNIT_TEST_USER, 'Example', []);