summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2020-02-03 13:37:30 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2020-03-18 13:41:04 +0100
commit15a21ee19a7a0db41a7e20c15eb1943a6f5f37b8 (patch)
tree609417ef31e5ab03994b4dc6ccba3a222840f496 /apps/dav/tests
parent451c8761a710c62bc19b75ceba9de670b95aca9e (diff)
downloadnextcloud-server-15a21ee19a7a0db41a7e20c15eb1943a6f5f37b8.tar.gz
nextcloud-server-15a21ee19a7a0db41a7e20c15eb1943a6f5f37b8.zip
remove the detour trough node and work with path directly
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/dav/tests')
-rw-r--r--apps/dav/tests/unit/DAV/CustomPropertiesBackendTest.php39
1 files changed, 0 insertions, 39 deletions
diff --git a/apps/dav/tests/unit/DAV/CustomPropertiesBackendTest.php b/apps/dav/tests/unit/DAV/CustomPropertiesBackendTest.php
index 9f0fbdc3a01..45aab9af1f5 100644
--- a/apps/dav/tests/unit/DAV/CustomPropertiesBackendTest.php
+++ b/apps/dav/tests/unit/DAV/CustomPropertiesBackendTest.php
@@ -52,9 +52,6 @@ class CustomPropertiesBackendTest extends TestCase {
/** @var CustomPropertiesBackend | \PHPUnit_Framework_MockObject_MockObject */
private $backend;
- /** @var (Node | \PHPUnit_Framework_MockObject_MockObject)[] */
- private $nodes = [];
-
protected function setUp(): void {
parent::setUp();
@@ -71,38 +68,6 @@ class CustomPropertiesBackendTest extends TestCase {
$this->user
);
- $this->tree->method('getNodeForPath')
- ->willReturnCallback(function ($path) {
- if (isset($this->nodes[$path])) {
- return $this->nodes[$path];
- } else {
- throw new NotFound();
- }
- });
- }
-
- /**
- * @param string $path
- * @return INode|\PHPUnit\Framework\MockObject\MockObject
- */
- private function addNode($path) {
- $node = $this->createMock(INode::class);
- $node->method('getPath')
- ->willReturn($path);
- $this->nodes[$path] = $node;
- return $node;
- }
-
- /**
- * @param string $path
- * @return Node|\PHPUnit\Framework\MockObject\MockObject
- */
- private function addCalendar($path) {
- $node = $this->createMock(Node::class);
- $node->method('getPath')
- ->willReturn($path);
- $this->nodes[$path] = $node;
- return $node;
}
protected function tearDown(): void {
@@ -170,7 +135,6 @@ class CustomPropertiesBackendTest extends TestCase {
$db->expects($this->never())
->method($this->anything());
- $this->addNode('foo_bar_path_1337_0');
$backend->propFind('foo_bar_path_1337_0', $propFind);
}
@@ -212,8 +176,6 @@ class CustomPropertiesBackendTest extends TestCase {
$setProps[$name] = $value;
});
- $this->addNode('calendars/foo/bar_path_1337_0');
-
$this->backend->propFind('calendars/foo/bar_path_1337_0', $propFind);
$this->assertEquals($props, $setProps);
}
@@ -223,7 +185,6 @@ class CustomPropertiesBackendTest extends TestCase {
*/
public function testPropPatch(string $path, array $existing, array $props, array $result) {
$this->insertProps($this->user->getUID(), $path, $existing);
- $this->addNode($path);
$propPatch = new PropPatch($props);
$this->backend->propPatch($path, $propPatch);