aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2020-02-03 13:41:55 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2020-03-18 13:41:04 +0100
commit861c897e93633d4561917128e30b4adc6fe84a79 (patch)
tree08bcab8aee4b4392ef43ad881a7fd8d226d539be /apps/dav
parent15a21ee19a7a0db41a7e20c15eb1943a6f5f37b8 (diff)
downloadnextcloud-server-861c897e93633d4561917128e30b4adc6fe84a79.tar.gz
nextcloud-server-861c897e93633d4561917128e30b4adc6fe84a79.zip
fix tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php59
1 files changed, 2 insertions, 57 deletions
diff --git a/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php b/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php
index 855f7276502..a78d64f9c94 100644
--- a/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php
@@ -144,16 +144,6 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
* Test that propFind on a missing file soft fails
*/
public function testPropFindMissingFileSoftFail() {
- $this->tree->expects($this->at(0))
- ->method('getNodeForPath')
- ->with('/dummypath')
- ->will($this->throwException(new \Sabre\DAV\Exception\NotFound()));
-
- $this->tree->expects($this->at(1))
- ->method('getNodeForPath')
- ->with('/dummypath')
- ->will($this->throwException(new \Sabre\DAV\Exception\ServiceUnavailable()));
-
$propFind = new \Sabre\DAV\PropFind(
'/dummypath',
array(
@@ -174,20 +164,14 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
$propFind
);
- // no exception, soft fail
- $this->addToAssertionCount(1);
+ // assert that the above didn't throw exceptions
+ $this->assertTrue(true);
}
/**
* Test setting/getting properties
*/
public function testSetGetPropertiesForFile() {
- $node = $this->createTestNode(File::class);
- $this->tree->expects($this->any())
- ->method('getNodeForPath')
- ->with('/dummypath')
- ->will($this->returnValue($node));
-
$this->applyDefaultProps();
$propFind = new \Sabre\DAV\PropFind(
@@ -214,39 +198,6 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
* Test getting properties from directory
*/
public function testGetPropertiesForDirectory() {
- $rootNode = $this->createTestNode(Directory::class);
-
- $nodeSub = $this->getMockBuilder(File::class)
- ->disableOriginalConstructor()
- ->getMock();
- $nodeSub->expects($this->any())
- ->method('getId')
- ->will($this->returnValue(456));
-
- $nodeSub->expects($this->any())
- ->method('getPath')
- ->will($this->returnValue('/dummypath/test.txt'));
-
- $this->tree->expects($this->at(0))
- ->method('getNodeForPath')
- ->with('/dummypath')
- ->will($this->returnValue($rootNode));
-
- $this->tree->expects($this->at(1))
- ->method('getNodeForPath')
- ->with('/dummypath/test.txt')
- ->will($this->returnValue($nodeSub));
-
- $this->tree->expects($this->at(2))
- ->method('getNodeForPath')
- ->with('/dummypath')
- ->will($this->returnValue($rootNode));
-
- $this->tree->expects($this->at(3))
- ->method('getNodeForPath')
- ->with('/dummypath/test.txt')
- ->will($this->returnValue($nodeSub));
-
$this->applyDefaultProps('/dummypath');
$this->applyDefaultProps('/dummypath/test.txt');
@@ -294,12 +245,6 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
* Test delete property
*/
public function testDeleteProperty() {
- $node = $this->createTestNode(File::class);
- $this->tree->expects($this->any())
- ->method('getNodeForPath')
- ->with('/dummypath')
- ->will($this->returnValue($node));
-
$this->applyDefaultProps();
$propPatch = new \Sabre\DAV\PropPatch(array(