]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix tests 4657/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Tue, 2 May 2017 10:35:42 +0000 (12:35 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Tue, 2 May 2017 10:39:37 +0000 (12:39 +0200)
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php

index fc4be1433fe0c7a8408126e1148406a3e0987b4f..ed311e79f4ae38a2d83e713e3047b3e7464a8c4e 100644 (file)
@@ -102,6 +102,8 @@ class ImageExportPluginTest extends TestCase {
                $this->request->expects($this->once())->method('getPath')->willReturn('/files/welcome.txt');
 
                $card = $this->getMockBuilder('Sabre\CardDAV\Card')->disableOriginalConstructor()->getMock();
+               $card->method('getETag')
+                       ->willReturn('"myEtag"');
                $this->tree->expects($this->once())->method('getNodeForPath')->with('/files/welcome.txt')->willReturn($card);
 
                $this->plugin->expects($this->once())->method('getPhoto')->willReturn($getPhotoResult);
@@ -110,10 +112,22 @@ class ImageExportPluginTest extends TestCase {
                        $this->response
                                ->expects($this->at(0))
                                ->method('setHeader')
-                               ->with('Content-Type', $getPhotoResult['Content-Type']);
+                               ->with('Cache-Control', 'private, max-age=3600, must-revalidate');
                        $this->response
                                ->expects($this->at(1))
                                ->method('setHeader')
+                               ->with('Etag', '"myEtag"');
+                       $this->response
+                               ->expects($this->at(2))
+                               ->method('setHeader')
+                               ->with('Pragma', 'public');
+                       $this->response
+                               ->expects($this->at(3))
+                               ->method('setHeader')
+                               ->with('Content-Type', $getPhotoResult['Content-Type']);
+                       $this->response
+                               ->expects($this->at(4))
+                               ->method('setHeader')
                                ->with('Content-Disposition', 'attachment');
                        $this->response
                                ->expects($this->once())