From b83c858e6d9636f8181986d2de17e671348fc1f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 12 Aug 2020 08:18:35 +0200 Subject: [PATCH] Adjust chunking test for non-existing target node MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/dav/tests/unit/Upload/ChunkingPluginTest.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/dav/tests/unit/Upload/ChunkingPluginTest.php b/apps/dav/tests/unit/Upload/ChunkingPluginTest.php index 27d6cbf7e8..d81c1eaf50 100644 --- a/apps/dav/tests/unit/Upload/ChunkingPluginTest.php +++ b/apps/dav/tests/unit/Upload/ChunkingPluginTest.php @@ -128,14 +128,18 @@ class ChunkingPluginTest extends TestCase { ->method('nodeExists') ->with('target') ->willReturn(false); - $this->response->expects($this->never()) - ->method('setStatus'); + $this->response->expects($this->once()) + ->method('setHeader') + ->with('Content-Length', '0'); + $this->response->expects($this->once()) + ->method('setStatus') + ->with(204); $this->request->expects($this->once()) ->method('getHeader') ->with('OC-Total-Length') ->willReturn(4); - $this->assertNull($this->plugin->beforeMove('source', 'target')); + $this->assertFalse($this->plugin->beforeMove('source', 'target')); } public function testBeforeMoveFutureFileMoveIt() {