aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/AppInfo/PluginManagerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/tests/unit/AppInfo/PluginManagerTest.php')
-rw-r--r--apps/dav/tests/unit/AppInfo/PluginManagerTest.php56
1 files changed, 20 insertions, 36 deletions
diff --git a/apps/dav/tests/unit/AppInfo/PluginManagerTest.php b/apps/dav/tests/unit/AppInfo/PluginManagerTest.php
index 53e63269067..0082aa45286 100644
--- a/apps/dav/tests/unit/AppInfo/PluginManagerTest.php
+++ b/apps/dav/tests/unit/AppInfo/PluginManagerTest.php
@@ -1,34 +1,16 @@
<?php
+
+declare(strict_types=1);
/**
- * @copyright Copyright (c) 2016, ownCloud GmbH.
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Georg Ehrke <oc.list@georgehrke.com>
- * @author Joas Schilling <coding@schilljs.com>
- * @author Julius Härtl <jus@bitgrid.net>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- * @author Vincent Petry <vincent@nextcloud.com>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * 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, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
+ * SPDX-FileCopyrightText: 2016 ownCloud GmbH.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OCA\DAV\Tests\unit\AppInfo;
use OC\App\AppManager;
use OC\ServerContainer;
use OCA\DAV\AppInfo\PluginManager;
+use OCA\DAV\CalDAV\AppCalendar\AppCalendarPlugin;
use OCA\DAV\CalDAV\Integration\ICalendarProvider;
use Sabre\DAV\Collection;
use Sabre\DAV\ServerPlugin;
@@ -40,12 +22,11 @@ use Test\TestCase;
* @package OCA\DAV\Tests\Unit\AppInfo
*/
class PluginManagerTest extends TestCase {
- public function test() {
+ public function test(): void {
$server = $this->createMock(ServerContainer::class);
-
$appManager = $this->createMock(AppManager::class);
- $appManager->method('getInstalledApps')
+ $appManager->method('getEnabledApps')
->willReturn(['adavapp', 'adavapp2']);
$appInfo1 = [
@@ -94,6 +75,7 @@ class PluginManagerTest extends TestCase {
$pluginManager = new PluginManager($server, $appManager);
+ $appCalendarPlugin = $this->createMock(AppCalendarPlugin::class);
$calendarPlugin1 = $this->createMock(ICalendarProvider::class);
$calendarPlugin2 = $this->createMock(ICalendarProvider::class);
$calendarPlugin3 = $this->createMock(ICalendarProvider::class);
@@ -106,17 +88,18 @@ class PluginManagerTest extends TestCase {
$dummyCollection2 = $this->createMock(Collection::class);
$dummy2Collection1 = $this->createMock(Collection::class);
- $server->method('query')
+ $server->method('get')
->willReturnMap([
- ['\OCA\DAV\ADavApp\PluginOne', true, $dummyPlugin1],
- ['\OCA\DAV\ADavApp\PluginTwo', true, $dummyPlugin2],
- ['\OCA\DAV\ADavApp\CalendarPluginOne', true, $calendarPlugin1],
- ['\OCA\DAV\ADavApp\CalendarPluginTwo', true, $calendarPlugin2],
- ['\OCA\DAV\ADavApp\CollectionOne', true, $dummyCollection1],
- ['\OCA\DAV\ADavApp\CollectionTwo', true, $dummyCollection2],
- ['\OCA\DAV\ADavApp2\PluginOne', true, $dummy2Plugin1],
- ['\OCA\DAV\ADavApp2\CalendarPluginOne', true, $calendarPlugin3],
- ['\OCA\DAV\ADavApp2\CollectionOne', true, $dummy2Collection1],
+ [AppCalendarPlugin::class, $appCalendarPlugin],
+ ['\OCA\DAV\ADavApp\PluginOne', $dummyPlugin1],
+ ['\OCA\DAV\ADavApp\PluginTwo', $dummyPlugin2],
+ ['\OCA\DAV\ADavApp\CalendarPluginOne', $calendarPlugin1],
+ ['\OCA\DAV\ADavApp\CalendarPluginTwo', $calendarPlugin2],
+ ['\OCA\DAV\ADavApp\CollectionOne', $dummyCollection1],
+ ['\OCA\DAV\ADavApp\CollectionTwo', $dummyCollection2],
+ ['\OCA\DAV\ADavApp2\PluginOne', $dummy2Plugin1],
+ ['\OCA\DAV\ADavApp2\CalendarPluginOne', $calendarPlugin3],
+ ['\OCA\DAV\ADavApp2\CollectionOne', $dummy2Collection1],
]);
$expectedPlugins = [
@@ -125,6 +108,7 @@ class PluginManagerTest extends TestCase {
$dummy2Plugin1,
];
$expectedCalendarPlugins = [
+ $appCalendarPlugin,
$calendarPlugin1,
$calendarPlugin2,
$calendarPlugin3,