Skip to content

Commit

Permalink
adjust test
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Oct 31, 2017
1 parent 20cd583 commit 6eb72bf
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ public function setUp() {
new \OCA\DAV\Connector\Sabre\FilesPlugin(
$this->tree,
$this->createMock(IConfig::class),
$this->createMock(IRequest::class)
$this->createMock(IRequest::class),
$this->createMock(IPreview::class)
)
);

Expand Down Expand Up @@ -515,20 +516,17 @@ public function testPrepareResponses() {

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

$this->assertEquals(200, $responses[0]->getHttpStatus());
$this->assertEquals(200, $responses[1]->getHttpStatus());
$this->assertEquals('/files/username/node1', $responses[0]['href']);
$this->assertEquals('/files/username/sub/node2', $responses[1]['href']);

$this->assertEquals('http://example.com/owncloud/remote.php/dav/files/username/node1', $responses[0]->getHref());
$this->assertEquals('http://example.com/owncloud/remote.php/dav/files/username/sub/node2', $responses[1]->getHref());

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

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

0 comments on commit 6eb72bf

Please sign in to comment.