aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/Command/DeleteCalendarTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/tests/unit/Command/DeleteCalendarTest.php')
-rw-r--r--apps/dav/tests/unit/Command/DeleteCalendarTest.php55
1 files changed, 15 insertions, 40 deletions
diff --git a/apps/dav/tests/unit/Command/DeleteCalendarTest.php b/apps/dav/tests/unit/Command/DeleteCalendarTest.php
index 1c499dbcc25..2bd269de6dc 100644
--- a/apps/dav/tests/unit/Command/DeleteCalendarTest.php
+++ b/apps/dav/tests/unit/Command/DeleteCalendarTest.php
@@ -2,27 +2,11 @@
declare(strict_types=1);
/**
- *
- * @copyright Copyright (c) 2021, Mattia Narducci (mattianarducci1@gmail.com)
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
-namespace OCA\DAV\Tests\Command;
+namespace OCA\DAV\Tests\unit\Command;
use OCA\DAV\CalDAV\BirthdayService;
use OCA\DAV\CalDAV\CalDavBackend;
@@ -44,23 +28,12 @@ class DeleteCalendarTest extends TestCase {
public const USER = 'user';
public const NAME = 'calendar';
- /** @var CalDavBackend|MockObject */
- private $calDav;
-
- /** @var IConfig|MockObject */
- private $config;
-
- /** @var IL10N|MockObject */
- private $l10n;
-
- /** @var IUserManager|MockObject */
- private $userManager;
-
- /** @var DeleteCalendar */
- private $command;
-
- /** @var MockObject|LoggerInterface */
- private $logger;
+ private CalDavBackend&MockObject $calDav;
+ private IConfig&MockObject $config;
+ private IL10N&MockObject $l10n;
+ private IUserManager&MockObject $userManager;
+ private LoggerInterface&MockObject $logger;
+ private DeleteCalendar $command;
protected function setUp(): void {
parent::setUp();
@@ -116,7 +89,7 @@ class DeleteCalendarTest extends TestCase {
public function testInvalidCalendar(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage(
- 'User <' . self::USER . '> has no calendar named <' . self::NAME . '>.');
+ 'User <' . self::USER . '> has no calendar named <' . self::NAME . '>.');
$this->userManager->expects($this->once())
->method('userExists')
@@ -142,7 +115,7 @@ class DeleteCalendarTest extends TestCase {
$calendar = [
'id' => $id,
'principaluri' => 'principals/users/' . self::USER,
- 'uri' => self::NAME
+ 'uri' => self::NAME,
];
$this->userManager->expects($this->once())
@@ -203,7 +176,8 @@ class DeleteCalendarTest extends TestCase {
$calendar = [
'id' => $id,
'principaluri' => 'principals/users/' . self::USER,
- 'uri' => BirthdayService::BIRTHDAY_CALENDAR_URI
+ 'uri' => BirthdayService::BIRTHDAY_CALENDAR_URI,
+ '{DAV:}displayname' => 'Test',
];
$this->userManager->expects($this->once())
@@ -232,7 +206,8 @@ class DeleteCalendarTest extends TestCase {
$calendar = [
'id' => 1234,
'principaluri' => 'principals/users/' . self::USER,
- 'uri' => BirthdayService::BIRTHDAY_CALENDAR_URI
+ 'uri' => BirthdayService::BIRTHDAY_CALENDAR_URI,
+ '{DAV:}displayname' => 'Test',
];
$this->userManager->expects($this->once())
->method('userExists')