summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-04-23 13:54:58 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-05-27 20:51:36 +0200
commit69e650d0e8d0ea38724d0d4afc16683403dad6e0 (patch)
treedd1a35c2025de86f81a042c551e844e8aa2692d3 /apps/dav/tests
parent240006bdf517df0a72d52efb285fdf9cf8b58d35 (diff)
downloadnextcloud-server-69e650d0e8d0ea38724d0d4afc16683403dad6e0.tar.gz
nextcloud-server-69e650d0e8d0ea38724d0d4afc16683403dad6e0.zip
CalDAV and CardDAV plugins need to be registered for the principals collection as well
https://github.com/owncloud/core/pull/30149/commits/9f2e6431b88a9635b291b0e824abf74ba766616d Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/dav/tests')
-rw-r--r--apps/dav/tests/unit/ServerTest.php22
1 files changed, 17 insertions, 5 deletions
diff --git a/apps/dav/tests/unit/ServerTest.php b/apps/dav/tests/unit/ServerTest.php
index 58c77c1b0ec..986899a2107 100644
--- a/apps/dav/tests/unit/ServerTest.php
+++ b/apps/dav/tests/unit/ServerTest.php
@@ -38,12 +38,24 @@ use OCA\DAV\AppInfo\PluginManager;
*/
class ServerTest extends \Test\TestCase {
- public function test() {
- /** @var IRequest $r */
+ /**
+ * @dataProvider providesUris
+ */
+ public function test($uri, array $plugins) {
+ /** @var IRequest | \PHPUnit_Framework_MockObject_MockObject $r */
$r = $this->createMock(IRequest::class);
- $r->method('getRequestUri')
- ->willReturn('/');
+ $r->expects($this->any())->method('getRequestUri')->willReturn($uri);
$s = new Server($r, '/');
- $this->assertInstanceOf('OCA\DAV\Server', $s);
+ $this->assertNotNull($s->server);
+ foreach ($plugins as $plugin) {
+ $this->assertNotNull($s->server->getPlugin($plugin));
+ }
+ }
+ public function providesUris() {
+ return [
+ 'principals' => ['principals/users/admin', ['caldav', 'oc-resource-sharing', 'carddav']],
+ 'calendars' => ['calendars/admin', ['caldav', 'oc-resource-sharing']],
+ 'addressbooks' => ['addressbooks/admin', ['carddav', 'oc-resource-sharing']],
+ ];
}
}