Skip to content

Commit b19309d

Browse files
committed
adjust test
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 4632949 commit b19309d

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
use OCP\Files\FileInfo;
3939
use OCP\IRequest;
4040
use OCP\IConfig;
41-
use OCP\Files\FileInfo;
4241

4342
class FilesReportPluginTest extends \Test\TestCase {
4443
/** @var \Sabre\DAV\Server|\PHPUnit_Framework_MockObject_MockObject */
@@ -128,7 +127,8 @@ public function setUp() {
128127
new \OCA\DAV\Connector\Sabre\FilesPlugin(
129128
$this->tree,
130129
$this->createMock(IConfig::class),
131-
$this->createMock(IRequest::class)
130+
$this->createMock(IRequest::class),
131+
$this->createMock(IPreview::class)
132132
)
133133
);
134134

@@ -504,20 +504,17 @@ public function testPrepareResponses() {
504504

505505
$this->assertCount(2, $responses);
506506

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']);
512509

513-
$props1 = $responses[0]->getResponseProperties();
510+
$props1 = $responses[0];
514511
$this->assertEquals('111', $props1[200]['{http://owncloud.org/ns}fileid']);
515512
$this->assertNull($props1[404]['{DAV:}getcontentlength']);
516513
$this->assertInstanceOf('\Sabre\DAV\Xml\Property\ResourceType', $props1[200]['{DAV:}resourcetype']);
517514
$resourceType1 = $props1[200]['{DAV:}resourcetype']->getValue();
518515
$this->assertEquals('{DAV:}collection', $resourceType1[0]);
519516

520-
$props2 = $responses[1]->getResponseProperties();
517+
$props2 = $responses[1];
521518
$this->assertEquals('1024', $props2[200]['{DAV:}getcontentlength']);
522519
$this->assertEquals('222', $props2[200]['{http://owncloud.org/ns}fileid']);
523520
$this->assertInstanceOf('\Sabre\DAV\Xml\Property\ResourceType', $props2[200]['{DAV:}resourcetype']);

0 commit comments

Comments
 (0)