|
38 | 38 | use OCP\Files\FileInfo; |
39 | 39 | use OCP\IRequest; |
40 | 40 | use OCP\IConfig; |
41 | | -use OCP\Files\FileInfo; |
42 | 41 |
|
43 | 42 | class FilesReportPluginTest extends \Test\TestCase { |
44 | 43 | /** @var \Sabre\DAV\Server|\PHPUnit_Framework_MockObject_MockObject */ |
@@ -128,7 +127,8 @@ public function setUp() { |
128 | 127 | new \OCA\DAV\Connector\Sabre\FilesPlugin( |
129 | 128 | $this->tree, |
130 | 129 | $this->createMock(IConfig::class), |
131 | | - $this->createMock(IRequest::class) |
| 130 | + $this->createMock(IRequest::class), |
| 131 | + $this->createMock(IPreview::class) |
132 | 132 | ) |
133 | 133 | ); |
134 | 134 |
|
@@ -504,20 +504,17 @@ public function testPrepareResponses() { |
504 | 504 |
|
505 | 505 | $this->assertCount(2, $responses); |
506 | 506 |
|
507 | | - $this->assertEquals(200, $responses[0]->getHttpStatus()); |
508 | | - $this->assertEquals(200, $responses[1]->getHttpStatus()); |
509 | | - |
510 | | - $this->assertEquals('http://example.com/owncloud/remote.php/dav/files/username/node1', $responses[0]->getHref()); |
511 | | - $this->assertEquals('http://example.com/owncloud/remote.php/dav/files/username/sub/node2', $responses[1]->getHref()); |
| 507 | + $this->assertEquals('/files/username/node1', $responses[0]['href']); |
| 508 | + $this->assertEquals('/files/username/sub/node2', $responses[1]['href']); |
512 | 509 |
|
513 | | - $props1 = $responses[0]->getResponseProperties(); |
| 510 | + $props1 = $responses[0]; |
514 | 511 | $this->assertEquals('111', $props1[200]['{http://owncloud.org/ns}fileid']); |
515 | 512 | $this->assertNull($props1[404]['{DAV:}getcontentlength']); |
516 | 513 | $this->assertInstanceOf('\Sabre\DAV\Xml\Property\ResourceType', $props1[200]['{DAV:}resourcetype']); |
517 | 514 | $resourceType1 = $props1[200]['{DAV:}resourcetype']->getValue(); |
518 | 515 | $this->assertEquals('{DAV:}collection', $resourceType1[0]); |
519 | 516 |
|
520 | | - $props2 = $responses[1]->getResponseProperties(); |
| 517 | + $props2 = $responses[1]; |
521 | 518 | $this->assertEquals('1024', $props2[200]['{DAV:}getcontentlength']); |
522 | 519 | $this->assertEquals('222', $props2[200]['{http://owncloud.org/ns}fileid']); |
523 | 520 | $this->assertInstanceOf('\Sabre\DAV\Xml\Property\ResourceType', $props2[200]['{DAV:}resourcetype']); |
|
0 commit comments