From 8648ee131a10a48df601346f7e8bdee7a7b40a9d Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 6 Feb 2020 19:05:37 +0100 Subject: [PATCH 1/6] Update Sabre (and friends) to 4.0 Signed-off-by: Christoph Wurst --- 3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty b/3rdparty index a70e51b4cce..179b231245b 160000 --- a/3rdparty +++ b/3rdparty @@ -1 +1 @@ -Subproject commit a70e51b4cce278e006090d91cf26d616cb73e911 +Subproject commit 179b231245bbae294d021b7158f99c3ffe7e2cb6 From 52ba75f6442ad326f5113cd3e89c4024118c4fcf Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Mon, 9 Mar 2020 16:32:04 +0100 Subject: [PATCH 2/6] Sabre/DAV 4.0: beforeMethod is now beforeMethod:* Signed-off-by: Georg Ehrke --- .../lib/CalDAV/InvitationResponse/InvitationResponseServer.php | 2 +- apps/dav/lib/CalDAV/WebcalCaching/Plugin.php | 2 +- apps/dav/lib/Connector/Sabre/AnonymousOptionsPlugin.php | 2 +- apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php | 2 +- apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php | 2 +- apps/dav/lib/Connector/Sabre/LockPlugin.php | 2 +- apps/dav/lib/Connector/Sabre/MaintenancePlugin.php | 2 +- apps/dav/lib/Connector/Sabre/ServerFactory.php | 2 +- apps/dav/lib/Files/Sharing/FilesDropPlugin.php | 2 +- apps/dav/lib/Files/Sharing/PublicLinkCheckPlugin.php | 2 +- apps/dav/lib/Server.php | 2 +- apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php | 2 +- remote.php | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php b/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php index 0702d8fc9ad..e285bbc378c 100644 --- a/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php +++ b/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php @@ -94,7 +94,7 @@ class InvitationResponseServer { )); // wait with registering these until auth is handled and the filesystem is setup - $this->server->on('beforeMethod', function () use ($root) { + $this->server->on('beforeMethod:*', function () use ($root) { // register plugins from apps $pluginManager = new PluginManager( \OC::$server, diff --git a/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php b/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php index cea11de395c..783c73968be 100644 --- a/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php +++ b/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php @@ -83,7 +83,7 @@ class Plugin extends ServerPlugin { */ public function initialize(Server $server) { $this->server = $server; - $server->on('beforeMethod', [$this, 'beforeMethod']); + $server->on('beforeMethod:*', [$this, 'beforeMethod']); } /** diff --git a/apps/dav/lib/Connector/Sabre/AnonymousOptionsPlugin.php b/apps/dav/lib/Connector/Sabre/AnonymousOptionsPlugin.php index de414e3aa2f..79999f968ae 100644 --- a/apps/dav/lib/Connector/Sabre/AnonymousOptionsPlugin.php +++ b/apps/dav/lib/Connector/Sabre/AnonymousOptionsPlugin.php @@ -46,7 +46,7 @@ class AnonymousOptionsPlugin extends ServerPlugin { public function initialize(\Sabre\DAV\Server $server) { $this->server = $server; // before auth - $this->server->on('beforeMethod', [$this, 'handleAnonymousOptions'], 9); + $this->server->on('beforeMethod:*', [$this, 'handleAnonymousOptions'], 9); } /** diff --git a/apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php b/apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php index 947b2960eab..896a6a5518c 100644 --- a/apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php +++ b/apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php @@ -74,7 +74,7 @@ class AppEnabledPlugin extends ServerPlugin { public function initialize(\Sabre\DAV\Server $server) { $this->server = $server; - $this->server->on('beforeMethod', [$this, 'checkAppEnabled'], 30); + $this->server->on('beforeMethod:*', [$this, 'checkAppEnabled'], 30); } /** diff --git a/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php b/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php index 6d7a635f1dd..07c7aad0d1e 100644 --- a/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php +++ b/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php @@ -53,7 +53,7 @@ class BlockLegacyClientPlugin extends ServerPlugin { */ public function initialize(\Sabre\DAV\Server $server) { $this->server = $server; - $this->server->on('beforeMethod', [$this, 'beforeHandler'], 200); + $this->server->on('beforeMethod:*', [$this, 'beforeHandler'], 200); } /** diff --git a/apps/dav/lib/Connector/Sabre/LockPlugin.php b/apps/dav/lib/Connector/Sabre/LockPlugin.php index 0d5cad6d9a4..077086c40df 100644 --- a/apps/dav/lib/Connector/Sabre/LockPlugin.php +++ b/apps/dav/lib/Connector/Sabre/LockPlugin.php @@ -45,7 +45,7 @@ class LockPlugin extends ServerPlugin { */ public function initialize(\Sabre\DAV\Server $server) { $this->server = $server; - $this->server->on('beforeMethod', [$this, 'getLock'], 50); + $this->server->on('beforeMethod:*', [$this, 'getLock'], 50); $this->server->on('afterMethod', [$this, 'releaseLock'], 50); } diff --git a/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php b/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php index 4076abe59fe..67e57e788b7 100644 --- a/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php +++ b/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php @@ -67,7 +67,7 @@ class MaintenancePlugin extends ServerPlugin { */ public function initialize(\Sabre\DAV\Server $server) { $this->server = $server; - $this->server->on('beforeMethod', [$this, 'checkMaintenanceMode'], 1); + $this->server->on('beforeMethod:*', [$this, 'checkMaintenanceMode'], 1); } /** diff --git a/apps/dav/lib/Connector/Sabre/ServerFactory.php b/apps/dav/lib/Connector/Sabre/ServerFactory.php index 9efd9ba7b56..d26e19c67c7 100644 --- a/apps/dav/lib/Connector/Sabre/ServerFactory.php +++ b/apps/dav/lib/Connector/Sabre/ServerFactory.php @@ -140,7 +140,7 @@ class ServerFactory { } // wait with registering these until auth is handled and the filesystem is setup - $server->on('beforeMethod', function () use ($server, $objectTree, $viewCallBack) { + $server->on('beforeMethod:*', function () use ($server, $objectTree, $viewCallBack) { // ensure the skeleton is copied $userFolder = \OC::$server->getUserFolder(); diff --git a/apps/dav/lib/Files/Sharing/FilesDropPlugin.php b/apps/dav/lib/Files/Sharing/FilesDropPlugin.php index 7a34ef95079..4542d0b52d0 100644 --- a/apps/dav/lib/Files/Sharing/FilesDropPlugin.php +++ b/apps/dav/lib/Files/Sharing/FilesDropPlugin.php @@ -61,7 +61,7 @@ class FilesDropPlugin extends ServerPlugin { * @throws MethodNotAllowed */ public function initialize(\Sabre\DAV\Server $server) { - $server->on('beforeMethod', [$this, 'beforeMethod'], 999); + $server->on('beforeMethod:*', [$this, 'beforeMethod'], 999); $this->enabled = false; } diff --git a/apps/dav/lib/Files/Sharing/PublicLinkCheckPlugin.php b/apps/dav/lib/Files/Sharing/PublicLinkCheckPlugin.php index 84401196b1a..4c45a299027 100644 --- a/apps/dav/lib/Files/Sharing/PublicLinkCheckPlugin.php +++ b/apps/dav/lib/Files/Sharing/PublicLinkCheckPlugin.php @@ -52,7 +52,7 @@ class PublicLinkCheckPlugin extends ServerPlugin { * @return void */ public function initialize(\Sabre\DAV\Server $server) { - $server->on('beforeMethod', [$this, 'beforeMethod']); + $server->on('beforeMethod:*', [$this, 'beforeMethod']); } public function beforeMethod(RequestInterface $request, ResponseInterface $response){ diff --git a/apps/dav/lib/Server.php b/apps/dav/lib/Server.php index 2502d53997a..230e72fd277 100644 --- a/apps/dav/lib/Server.php +++ b/apps/dav/lib/Server.php @@ -217,7 +217,7 @@ class Server { $this->server->addPlugin(new SearchPlugin($lazySearchBackend)); // wait with registering these until auth is handled and the filesystem is setup - $this->server->on('beforeMethod', function () use ($root, $lazySearchBackend) { + $this->server->on('beforeMethod:*', function () use ($root, $lazySearchBackend) { // custom properties plugin must be the last one $userSession = \OC::$server->getUserSession(); $user = $userSession->getUser(); diff --git a/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php b/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php index 77646b2c9d1..82a4515c7e3 100644 --- a/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php +++ b/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php @@ -66,7 +66,7 @@ class FilesDropPluginTest extends TestCase { $this->server->expects($this->once()) ->method('on') ->with( - $this->equalTo('beforeMethod'), + $this->equalTo('beforeMethod:*'), $this->equalTo([$this->plugin, 'beforeMethod']), $this->equalTo(999) ); diff --git a/remote.php b/remote.php index 7d20b4fbdf4..b1777e92f77 100644 --- a/remote.php +++ b/remote.php @@ -58,7 +58,7 @@ function handleException($e) { // we shall not log on RemoteException $server->addPlugin(new ExceptionLoggerPlugin('webdav', \OC::$server->getLogger())); } - $server->on('beforeMethod', function () use ($e) { + $server->on('beforeMethod:*', function () use ($e) { if ($e instanceof RemoteException) { switch ($e->getCode()) { case 503: From 102a328e65518a730691a52fa9c1c76617371cac Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Tue, 10 Mar 2020 13:43:18 +0100 Subject: [PATCH 3/6] Fix usage of Sabre\HTTP\Request in unit tests Signed-off-by: Georg Ehrke --- .../tests/unit/CalDAV/Publishing/PublishingTest.php | 6 ++---- apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php | 5 ++--- .../Connector/Sabre/CopyEtagHeaderPluginTest.php | 4 ++-- .../tests/unit/Connector/Sabre/QuotaPluginTest.php | 12 ++++++------ apps/dav/tests/unit/DAV/Sharing/PluginTest.php | 5 ++--- 5 files changed, 14 insertions(+), 18 deletions(-) diff --git a/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php b/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php index cf62b6eb05d..f7972d37d43 100644 --- a/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php +++ b/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php @@ -82,9 +82,8 @@ class PluginTest extends TestCase { $this->book->expects($this->once())->method('setPublishStatus')->with(true); // setup request - $request = new Request(); + $request = new Request('POST', 'cal1'); $request->addHeader('Content-Type', 'application/xml'); - $request->setUrl('cal1'); $request->setBody(''); $response = new Response(); $this->plugin->httpPost($request, $response); @@ -95,9 +94,8 @@ class PluginTest extends TestCase { $this->book->expects($this->once())->method('setPublishStatus')->with(false); // setup request - $request = new Request(); + $request = new Request('POST', 'cal1'); $request->addHeader('Content-Type', 'application/xml'); - $request->setUrl('cal1'); $request->setBody(''); $response = new Response(); $this->plugin->httpPost($request, $response); diff --git a/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php b/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php index 742f231287e..b8cdb70b7f9 100644 --- a/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php +++ b/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php @@ -47,7 +47,7 @@ class PluginTest extends TestCase { protected function setUp(): void { parent::setUp(); - + /** @var Auth | \PHPUnit_Framework_MockObject_MockObject $authBackend */ $authBackend = $this->getMockBuilder(Auth::class)->disableOriginalConstructor()->getMock(); $authBackend->method('isDavAuthenticated')->willReturn(true); @@ -75,9 +75,8 @@ class PluginTest extends TestCase { ]], ['mailto:wilfredo@example.com']); // setup request - $request = new Request(); + $request = new Request('POST', 'addressbook1.vcf'); $request->addHeader('Content-Type', 'application/xml'); - $request->setUrl('addressbook1.vcf'); $request->setBody('principal:principals/admin mailto:wilfredo@example.com'); $response = new Response(); $this->plugin->httpPost($request, $response); diff --git a/apps/dav/tests/unit/Connector/Sabre/CopyEtagHeaderPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/CopyEtagHeaderPluginTest.php index f2012a87a3d..29b549f3b4a 100644 --- a/apps/dav/tests/unit/Connector/Sabre/CopyEtagHeaderPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/CopyEtagHeaderPluginTest.php @@ -54,7 +54,7 @@ class CopyEtagHeaderPluginTest extends TestCase { } public function testCopyEtag() { - $request = new \Sabre\Http\Request(); + $request = new \Sabre\Http\Request('GET', 'dummy.file'); $response = new \Sabre\Http\Response(); $response->setHeader('Etag', 'abcd'); @@ -64,7 +64,7 @@ class CopyEtagHeaderPluginTest extends TestCase { } public function testNoopWhenEmpty() { - $request = new \Sabre\Http\Request(); + $request = new \Sabre\Http\Request('GET', 'dummy.file'); $response = new \Sabre\Http\Response(); $this->plugin->afterMethod($request, $response); diff --git a/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php index d7554741fc0..f604ee8a685 100644 --- a/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php @@ -66,7 +66,7 @@ class QuotaPluginTest extends TestCase { $this->init(0); $this->plugin->expects($this->never()) ->method('getFileChunking'); - $this->server->httpRequest = new \Sabre\HTTP\Request(null, null, $headers); + $this->server->httpRequest = new \Sabre\HTTP\Request('POST', 'dummy.file', $headers); $length = $this->plugin->getLength(); $this->assertEquals($expected, $length); } @@ -79,7 +79,7 @@ class QuotaPluginTest extends TestCase { $this->plugin->expects($this->never()) ->method('getFileChunking'); - $this->server->httpRequest = new \Sabre\HTTP\Request(null, null, $headers); + $this->server->httpRequest = new \Sabre\HTTP\Request('POST', 'dummy.file', $headers); $result = $this->plugin->checkQuota(''); $this->assertTrue($result); } @@ -94,7 +94,7 @@ class QuotaPluginTest extends TestCase { $this->plugin->expects($this->never()) ->method('getFileChunking'); - $this->server->httpRequest = new \Sabre\HTTP\Request(null, null, $headers); + $this->server->httpRequest = new \Sabre\HTTP\Request('POST', 'dummy.file', $headers); $this->plugin->checkQuota(''); } @@ -106,7 +106,7 @@ class QuotaPluginTest extends TestCase { $this->plugin->expects($this->never()) ->method('getFileChunking'); - $this->server->httpRequest = new \Sabre\HTTP\Request(null, null, $headers); + $this->server->httpRequest = new \Sabre\HTTP\Request('POST', 'dummy.file', $headers); $result = $this->plugin->checkQuota('/sub/test.txt'); $this->assertTrue($result); } @@ -191,7 +191,7 @@ class QuotaPluginTest extends TestCase { ->willReturn($mockChunking); $headers['OC-CHUNKED'] = 1; - $this->server->httpRequest = new \Sabre\HTTP\Request(null, null, $headers); + $this->server->httpRequest = new \Sabre\HTTP\Request('POST', 'dummy.file', $headers); $result = $this->plugin->checkQuota('/sub/test.txt-chunking-12345-3-1'); $this->assertTrue($result); } @@ -228,7 +228,7 @@ class QuotaPluginTest extends TestCase { ->willReturn($mockChunking); $headers['OC-CHUNKED'] = 1; - $this->server->httpRequest = new \Sabre\HTTP\Request(null, null, $headers); + $this->server->httpRequest = new \Sabre\HTTP\Request('POST', 'dummy.file', $headers); $this->plugin->checkQuota('/sub/test.txt-chunking-12345-3-1'); } diff --git a/apps/dav/tests/unit/DAV/Sharing/PluginTest.php b/apps/dav/tests/unit/DAV/Sharing/PluginTest.php index 9eeaccc29d7..9776d17642c 100644 --- a/apps/dav/tests/unit/DAV/Sharing/PluginTest.php +++ b/apps/dav/tests/unit/DAV/Sharing/PluginTest.php @@ -47,7 +47,7 @@ class PluginTest extends TestCase { protected function setUp(): void { parent::setUp(); - + /** @var Auth | \PHPUnit_Framework_MockObject_MockObject $authBackend */ $authBackend = $this->getMockBuilder(Auth::class)->disableOriginalConstructor()->getMock(); $authBackend->method('isDavAuthenticated')->willReturn(true); @@ -77,9 +77,8 @@ class PluginTest extends TestCase { ]], ['mailto:wilfredo@example.com']); // setup request - $request = new Request(); + $request = new Request('POST', 'addressbook1.vcf'); $request->addHeader('Content-Type', 'application/xml'); - $request->setUrl('addressbook1.vcf'); $request->setBody('principal:principals/admin mailto:wilfredo@example.com'); $response = new Response(); $this->plugin->httpPost($request, $response); From 5e2c802bb7314da4dbcfee12c5e2d943e8fafa1d Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Tue, 10 Mar 2020 14:13:43 +0100 Subject: [PATCH 4/6] Set custom ProdId in Birthday service, do not depend on Sabre Versio number for unit tests Signed-off-by: Georg Ehrke --- apps/dav/lib/CalDAV/BirthdayService.php | 1 + .../unit/CardDAV/BirthdayServiceTest.php | 23 ++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php index 31ea38fc7b7..208b923f531 100644 --- a/apps/dav/lib/CalDAV/BirthdayService.php +++ b/apps/dav/lib/CalDAV/BirthdayService.php @@ -256,6 +256,7 @@ class BirthdayService { $vCal = new VCalendar(); $vCal->VERSION = '2.0'; + $vCal->PRODID = '-//IDN nextcloud.com//Birthday calendar//EN'; $vEvent = $vCal->createComponent('VEVENT'); $vEvent->add('DTSTART'); $vEvent->DTSTART->setDateTime( diff --git a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php index e38bd1810a8..0bb4a8c4a34 100644 --- a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php +++ b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php @@ -91,6 +91,7 @@ class BirthdayServiceTest extends TestCase { $this->assertNull($cal); } else { $this->assertInstanceOf('Sabre\VObject\Component\VCalendar', $cal); + $this->assertEquals('-//IDN nextcloud.com//Birthday calendar//EN', $cal->PRODID->getValue()); $this->assertTrue(isset($cal->VEVENT)); $this->assertEquals('FREQ=YEARLY', $cal->VEVENT->RRULE->getValue()); $this->assertEquals($expectedSummary, $cal->VEVENT->SUMMARY->getValue()); @@ -259,21 +260,27 @@ class BirthdayServiceTest extends TestCase { ); } if ($expectedOp === 'create') { - $service->expects($this->exactly(3))->method('buildDateFromContact')->willReturn(new VCalendar()); + $vCal = new VCalendar(); + $vCal->PRODID = '-//Nextcloud testing//mocked object//'; + + $service->expects($this->exactly(3))->method('buildDateFromContact')->willReturn($vCal); $this->calDav->expects($this->exactly(3))->method('createCalendarObject')->withConsecutive( - [1234, 'default-gump.vcf.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.6//EN\r\nCALSCALE:GREGORIAN\r\nEND:VCALENDAR\r\n"], - [1234, 'default-gump.vcf-death.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.6//EN\r\nCALSCALE:GREGORIAN\r\nEND:VCALENDAR\r\n"], - [1234, 'default-gump.vcf-anniversary.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.6//EN\r\nCALSCALE:GREGORIAN\r\nEND:VCALENDAR\r\n"] + [1234, 'default-gump.vcf.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nCALSCALE:GREGORIAN\r\nPRODID:-//Nextcloud testing//mocked object//\r\nEND:VCALENDAR\r\n"], + [1234, 'default-gump.vcf-death.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nCALSCALE:GREGORIAN\r\nPRODID:-//Nextcloud testing//mocked object//\r\nEND:VCALENDAR\r\n"], + [1234, 'default-gump.vcf-anniversary.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nCALSCALE:GREGORIAN\r\nPRODID:-//Nextcloud testing//mocked object//\r\nEND:VCALENDAR\r\n"] ); } if ($expectedOp === 'update') { - $service->expects($this->exactly(3))->method('buildDateFromContact')->willReturn(new VCalendar()); + $vCal = new VCalendar(); + $vCal->PRODID = '-//Nextcloud testing//mocked object//'; + + $service->expects($this->exactly(3))->method('buildDateFromContact')->willReturn($vCal); $service->expects($this->exactly(3))->method('birthdayEvenChanged')->willReturn(true); $this->calDav->expects($this->exactly(3))->method('getCalendarObject')->willReturn(['calendardata' => '']); $this->calDav->expects($this->exactly(3))->method('updateCalendarObject')->withConsecutive( - [1234, 'default-gump.vcf.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.6//EN\r\nCALSCALE:GREGORIAN\r\nEND:VCALENDAR\r\n"], - [1234, 'default-gump.vcf-death.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.6//EN\r\nCALSCALE:GREGORIAN\r\nEND:VCALENDAR\r\n"], - [1234, 'default-gump.vcf-anniversary.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.6//EN\r\nCALSCALE:GREGORIAN\r\nEND:VCALENDAR\r\n"] + [1234, 'default-gump.vcf.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nCALSCALE:GREGORIAN\r\nPRODID:-//Nextcloud testing//mocked object//\r\nEND:VCALENDAR\r\n"], + [1234, 'default-gump.vcf-death.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nCALSCALE:GREGORIAN\r\nPRODID:-//Nextcloud testing//mocked object//\r\nEND:VCALENDAR\r\n"], + [1234, 'default-gump.vcf-anniversary.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nCALSCALE:GREGORIAN\r\nPRODID:-//Nextcloud testing//mocked object//\r\nEND:VCALENDAR\r\n"] ); } From 80b7ef9b4168ef32ef15f2bf98ac515d59b6d2f4 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Tue, 10 Mar 2020 15:01:08 +0100 Subject: [PATCH 5/6] Adjust FakeLockerPluginTest to new Sabre version Signed-off-by: Georg Ehrke --- apps/dav/tests/unit/Connector/Sabre/FakeLockerPluginTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dav/tests/unit/Connector/Sabre/FakeLockerPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FakeLockerPluginTest.php index 473c0164d06..d24b4dfe962 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FakeLockerPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FakeLockerPluginTest.php @@ -172,7 +172,7 @@ class FakeLockerPluginTest extends TestCase { $this->assertSame(false, $this->fakeLockerPlugin->fakeLockProvider($request, $response)); - $expectedXml = 'MyPathinfinitySecond-1800opaquelocktoken:fe4f7f2437b151fbcb4e9f5c8118c6b1'; + $expectedXml = 'MyPathinfinitySecond-1800opaquelocktoken:fe4f7f2437b151fbcb4e9f5c8118c6b1'; $this->assertXmlStringEqualsXmlString($expectedXml, $response->getBody()); } From 55081b7fd29b58600d5e0d13ed678de902098e4f Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Tue, 10 Mar 2020 15:23:33 +0100 Subject: [PATCH 6/6] RequestTestCase: Default type for headers needs to be array Signed-off-by: Georg Ehrke --- .../tests/unit/Connector/Sabre/RequestTest/RequestTestCase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dav/tests/unit/Connector/Sabre/RequestTest/RequestTestCase.php b/apps/dav/tests/unit/Connector/Sabre/RequestTest/RequestTestCase.php index 771d73dec5f..3624a9cc30e 100644 --- a/apps/dav/tests/unit/Connector/Sabre/RequestTest/RequestTestCase.php +++ b/apps/dav/tests/unit/Connector/Sabre/RequestTest/RequestTestCase.php @@ -92,7 +92,7 @@ abstract class RequestTestCase extends TestCase { * @return \Sabre\HTTP\Response * @throws \Exception */ - protected function request($view, $user, $password, $method, $url, $body = null, $headers = null) { + protected function request($view, $user, $password, $method, $url, $body = null, $headers = []) { if (is_string($body)) { $body = $this->getStream($body); }