$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);
$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);
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);
]], ['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);
}
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');
}
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);
$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);
}
$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);
}
$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('');
}
$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);
}
->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);
}
->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');
}
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);
]], ['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);