0
0
mirror of https://github.com/nextcloud/server.git synced 2025-01-01 18:00:09 +00:00
nextcloud_server/apps/dav/tests/unit/CalDAV/PluginTest.php
Andy Scherzinger 56d4f3aa2d
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-28 14:41:28 +02:00

52 lines
1.1 KiB
PHP

<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Tests\unit\CalDAV;
use OCA\DAV\CalDAV\Plugin;
use Test\TestCase;
class PluginTest extends TestCase {
/** @var Plugin */
private $plugin;
protected function setUp(): void {
parent::setUp();
$this->plugin = new Plugin();
}
public function linkProvider() {
return [
[
'principals/users/MyUserName',
'calendars/MyUserName',
],
[
'principals/calendar-resources/Resource-ABC',
'system-calendars/calendar-resources/Resource-ABC',
],
[
'principals/calendar-rooms/Room-ABC',
'system-calendars/calendar-rooms/Room-ABC',
],
];
}
/**
* @dataProvider linkProvider
*
* @param $input
* @param $expected
*/
public function testGetCalendarHomeForPrincipal($input, $expected): void {
$this->assertSame($expected, $this->plugin->getCalendarHomeForPrincipal($input));
}
public function testGetCalendarHomeForUnknownPrincipal(): void {
$this->assertNull($this->plugin->getCalendarHomeForPrincipal('FOO/BAR/BLUB'));
}
}