diff options
author | Anna Larch <anna@nextcloud.com> | 2021-12-06 20:01:22 +0100 |
---|---|---|
committer | Anna Larch <anna@nextcloud.com> | 2022-03-16 12:48:50 +0100 |
commit | 0745fc50126e92406ec95265ef1ff5d4b5575d3e (patch) | |
tree | 452e44b917c0d242669ee93d58fc84d5210802e5 /apps/dav/tests/unit/CalDAV/CalendarHomeTest.php | |
parent | a626307da8e9a4e5124da1c35429892f745b2de9 (diff) | |
download | nextcloud-server-0745fc50126e92406ec95265ef1ff5d4b5575d3e.tar.gz nextcloud-server-0745fc50126e92406ec95265ef1ff5d4b5575d3e.zip |
Move calendar objects between calendars instead of deleting and recreating them
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'apps/dav/tests/unit/CalDAV/CalendarHomeTest.php')
-rw-r--r-- | apps/dav/tests/unit/CalDAV/CalendarHomeTest.php | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/apps/dav/tests/unit/CalDAV/CalendarHomeTest.php b/apps/dav/tests/unit/CalDAV/CalendarHomeTest.php index 451be14bcaf..ee3bc2b0859 100644 --- a/apps/dav/tests/unit/CalDAV/CalendarHomeTest.php +++ b/apps/dav/tests/unit/CalDAV/CalendarHomeTest.php @@ -32,13 +32,15 @@ use OCA\DAV\CalDAV\Integration\ExternalCalendar; use OCA\DAV\CalDAV\Integration\ICalendarProvider; use OCA\DAV\CalDAV\Outbox; use OCA\DAV\CalDAV\Trashbin\TrashbinHome; +use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; use Sabre\CalDAV\Schedule\Inbox; use Sabre\DAV\MkCol; use Test\TestCase; class CalendarHomeTest extends TestCase { - /** @var CalDavBackend | \PHPUnit\Framework\MockObject\MockObject */ + /** @var CalDavBackend | MockObject */ private $backend; /** @var array */ @@ -50,6 +52,9 @@ class CalendarHomeTest extends TestCase { /** @var CalendarHome */ private $calendarHome; + /** @var MockObject|LoggerInterface */ + private $logger; + protected function setUp(): void { parent::setUp(); @@ -58,9 +63,13 @@ class CalendarHomeTest extends TestCase { 'uri' => 'user-principal-123', ]; $this->pluginManager = $this->createMock(PluginManager::class); + $this->logger = $this->createMock(LoggerInterface::class); - $this->calendarHome = new CalendarHome($this->backend, - $this->principalInfo); + $this->calendarHome = new CalendarHome( + $this->backend, + $this->principalInfo, + $this->logger + ); // Replace PluginManager with our mock $reflection = new \ReflectionClass($this->calendarHome); @@ -70,7 +79,7 @@ class CalendarHomeTest extends TestCase { } public function testCreateCalendarValidName() { - /** @var MkCol | \PHPUnit\Framework\MockObject\MockObject $mkCol */ + /** @var MkCol | MockObject $mkCol */ $mkCol = $this->createMock(MkCol::class); $mkCol->method('getResourceType') @@ -90,7 +99,7 @@ class CalendarHomeTest extends TestCase { $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); $this->expectExceptionMessage('The resource you tried to create has a reserved name'); - /** @var MkCol | \PHPUnit\Framework\MockObject\MockObject $mkCol */ + /** @var MkCol | MockObject $mkCol */ $mkCol = $this->createMock(MkCol::class); $this->calendarHome->createExtendedCollection('contact_birthdays', $mkCol); @@ -100,7 +109,7 @@ class CalendarHomeTest extends TestCase { $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); $this->expectExceptionMessage('The resource you tried to create has a reserved name'); - /** @var MkCol | \PHPUnit\Framework\MockObject\MockObject $mkCol */ + /** @var MkCol | MockObject $mkCol */ $mkCol = $this->createMock(MkCol::class); $this->calendarHome->createExtendedCollection('app-generated--example--foo-1', $mkCol); |