Fix tests

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2017-05-02 12:35:42 +02:00
parent 59e27f03b6
commit d25e13ea27
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 15 additions and 1 deletions

View File

@ -102,6 +102,8 @@ class ImageExportPluginTest extends TestCase {
$this->request->expects($this->once())->method('getPath')->willReturn('/files/welcome.txt'); $this->request->expects($this->once())->method('getPath')->willReturn('/files/welcome.txt');
$card = $this->getMockBuilder('Sabre\CardDAV\Card')->disableOriginalConstructor()->getMock(); $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->tree->expects($this->once())->method('getNodeForPath')->with('/files/welcome.txt')->willReturn($card);
$this->plugin->expects($this->once())->method('getPhoto')->willReturn($getPhotoResult); $this->plugin->expects($this->once())->method('getPhoto')->willReturn($getPhotoResult);
@ -110,10 +112,22 @@ class ImageExportPluginTest extends TestCase {
$this->response $this->response
->expects($this->at(0)) ->expects($this->at(0))
->method('setHeader') ->method('setHeader')
->with('Content-Type', $getPhotoResult['Content-Type']); ->with('Cache-Control', 'private, max-age=3600, must-revalidate');
$this->response $this->response
->expects($this->at(1)) ->expects($this->at(1))
->method('setHeader') ->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'); ->with('Content-Disposition', 'attachment');
$this->response $this->response
->expects($this->once()) ->expects($this->once())