summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
m---------3rdparty0
-rw-r--r--apps/dav/lib/CalDAV/BirthdayService.php1
-rw-r--r--apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php2
-rw-r--r--apps/dav/lib/CalDAV/WebcalCaching/Plugin.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/AnonymousOptionsPlugin.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/LockPlugin.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/MaintenancePlugin.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/ServerFactory.php2
-rw-r--r--apps/dav/lib/Files/Sharing/FilesDropPlugin.php2
-rw-r--r--apps/dav/lib/Files/Sharing/PublicLinkCheckPlugin.php2
-rw-r--r--apps/dav/lib/Server.php2
-rw-r--r--apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php6
-rw-r--r--apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php23
-rw-r--r--apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php5
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/CopyEtagHeaderPluginTest.php4
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/FakeLockerPluginTest.php2
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php12
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/RequestTest/RequestTestCase.php2
-rw-r--r--apps/dav/tests/unit/DAV/Sharing/PluginTest.php5
-rw-r--r--apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php2
-rw-r--r--remote.php2
23 files changed, 45 insertions, 41 deletions
diff --git a/3rdparty b/3rdparty
-Subproject a70e51b4cce278e006090d91cf26d616cb73e91
+Subproject 179b231245bbae294d021b7158f99c3ffe7e2cb
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/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/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('<o:publish-calendar xmlns:o="http://calendarserver.org/ns/"/>');
$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('<o:unpublish-calendar xmlns:o="http://calendarserver.org/ns/"/>');
$response = new Response();
$this->plugin->httpPost($request, $response);
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"]
);
}
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('<?xml version="1.0" encoding="utf-8" ?><CS:share xmlns:D="DAV:" xmlns:CS="http://owncloud.org/ns"><CS:set><D:href>principal:principals/admin</D:href><CS:read-write/></CS:set> <CS:remove><D:href>mailto:wilfredo@example.com</D:href></CS:remove></CS:share>');
$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/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 = '<?xml version="1.0" encoding="utf-8"?><d:prop xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns"><d:lockdiscovery><d:activelock><d:lockscope><d:exclusive/></d:lockscope><d:locktype><d:write/></d:locktype><d:lockroot><d:href>MyPath</d:href></d:lockroot><d:depth>infinity</d:depth><d:timeout>Second-1800</d:timeout><d:locktoken><d:href>opaquelocktoken:fe4f7f2437b151fbcb4e9f5c8118c6b1</d:href></d:locktoken><d:owner/></d:activelock></d:lockdiscovery></d:prop>';
+ $expectedXml = '<?xml version="1.0" encoding="utf-8"?><d:prop xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns"><d:lockdiscovery><d:activelock><d:lockscope><d:exclusive/></d:lockscope><d:locktype><d:write/></d:locktype><d:lockroot><d:href>MyPath</d:href></d:lockroot><d:depth>infinity</d:depth><d:timeout>Second-1800</d:timeout><d:locktoken><d:href>opaquelocktoken:fe4f7f2437b151fbcb4e9f5c8118c6b1</d:href></d:locktoken></d:activelock></d:lockdiscovery></d:prop>';
$this->assertXmlStringEqualsXmlString($expectedXml, $response->getBody());
}
diff --git a/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php
index 3af82f31f50..5ff1316752e 100644
--- a/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php
@@ -62,7 +62,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);
}
@@ -75,7 +75,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);
}
@@ -90,7 +90,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('');
}
@@ -102,7 +102,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);
}
@@ -187,7 +187,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);
}
@@ -224,7 +224,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/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);
}
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('<?xml version="1.0" encoding="utf-8" ?><CS:share xmlns:D="DAV:" xmlns:CS="http://owncloud.org/ns"><CS:set><D:href>principal:principals/admin</D:href><CS:read-write/></CS:set> <CS:remove><D:href>mailto:wilfredo@example.com</D:href></CS:remove></CS:share>');
$response = new Response();
$this->plugin->httpPost($request, $response);
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: