]> source.dussan.org Git - nextcloud-server.git/commitdiff
Adjust chunking test for non-existing target node
authorJulius Härtl <jus@bitgrid.net>
Wed, 12 Aug 2020 06:18:35 +0000 (08:18 +0200)
committerJulius Härtl <jus@bitgrid.net>
Wed, 12 Aug 2020 06:18:46 +0000 (08:18 +0200)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
apps/dav/tests/unit/Upload/ChunkingPluginTest.php

index 27d6cbf7e850bb1c83393d9d81d25fbbb68634e1..d81c1eaf5046ea97d25021628b08394031ac59bd 100644 (file)
@@ -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() {