summaryrefslogtreecommitdiffstats
path: root/tests/Core/Controller
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-10-21 12:51:22 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-11-03 14:00:33 +0100
commit9e6b26dcd05362599bade82d7b326336a5cc7c0b (patch)
tree15ece4612b963dc3a9705cec4491253da329b69e /tests/Core/Controller
parent55af6b45f72e0717d7b6f07b69bc0f12f4fb4cd9 (diff)
downloadnextcloud-server-9e6b26dcd05362599bade82d7b326336a5cc7c0b.tar.gz
nextcloud-server-9e6b26dcd05362599bade82d7b326336a5cc7c0b.zip
Add cache 1 day cache to preview endpoint
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests/Core/Controller')
-rw-r--r--tests/Core/Controller/PreviewControllerTest.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/Core/Controller/PreviewControllerTest.php b/tests/Core/Controller/PreviewControllerTest.php
index 63a26761344..df1af6a0802 100644
--- a/tests/Core/Controller/PreviewControllerTest.php
+++ b/tests/Core/Controller/PreviewControllerTest.php
@@ -25,6 +25,7 @@ namespace Tests\Core\Controller;
use OC\Core\Controller\PreviewController;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
+use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\IRootFolder;
@@ -59,7 +60,8 @@ class PreviewControllerTest extends \Test\TestCase {
$this->createMock(IRequest::class),
$this->previewManager,
$this->rootFolder,
- $this->userId
+ $this->userId,
+ $this->createMock(ITimeFactory::class)
);
}
@@ -216,8 +218,9 @@ class PreviewControllerTest extends \Test\TestCase {
->willReturn('myMime');
$res = $this->controller->getPreview('file', 10, 10, true, true, 'myMode');
- $expected = new Http\FileDisplayResponse($preview, Http::STATUS_OK, ['Content-Type' => 'myMime']);
- $this->assertEquals($expected, $res);
+ $this->assertEquals('myMime', $res->getHeaders()['Content-Type']);
+ $this->assertEquals(Http::STATUS_OK, $res->getStatus());
+ $this->assertEquals($preview, $this->invokePrivate($res, 'file'));
}
}