Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-01-09 13:27:53 +0300
committerGitHub <noreply@github.com>2018-01-09 13:27:53 +0300
commitdb6b9fdb6a1b0bce8b3d75dfbb727251860855df (patch)
treee51d12406f873a7550b83c4a4261927d0f4097fa /tests
parentb0891991414e0a555d054ff66ac3ff2b33c3f4d6 (diff)
parent87e99651f5d7b0f86bcae2a7366f6ae4f0600a87 (diff)
Merge pull request #7745 from nextcloud/7692_12
[stable12] Don't lie about preview types
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Preview/GeneratorTest.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/lib/Preview/GeneratorTest.php b/tests/lib/Preview/GeneratorTest.php
index f1383b0691b..130cccdf09e 100644
--- a/tests/lib/Preview/GeneratorTest.php
+++ b/tests/lib/Preview/GeneratorTest.php
@@ -93,6 +93,8 @@ class GeneratorTest extends \Test\TestCase {
$maxPreview = $this->createMock(ISimpleFile::class);
$maxPreview->method('getName')
->willReturn('1000-1000-max.png');
+ $maxPreview->method('getMimeType')
+ ->willReturn('image/png');
$previewFolder->method('getDirectoryListing')
->willReturn([$maxPreview]);
@@ -170,6 +172,7 @@ class GeneratorTest extends \Test\TestCase {
$image->method('width')->willReturn(2048);
$image->method('height')->willReturn(2048);
$image->method('valid')->willReturn(true);
+ $image->method('dataMimeType')->willReturn('image/png');
$this->helper->method('getThumbnail')
->will($this->returnCallback(function ($provider, $file, $x, $y) use ($invalidProvider, $validProvider, $image) {
@@ -185,6 +188,7 @@ class GeneratorTest extends \Test\TestCase {
$maxPreview = $this->createMock(ISimpleFile::class);
$maxPreview->method('getName')->willReturn('2048-2048-max.png');
+ $maxPreview->method('getMimeType')->willReturn('image/png');
$previewFile = $this->createMock(ISimpleFile::class);
@@ -219,6 +223,7 @@ class GeneratorTest extends \Test\TestCase {
$image->method('data')
->willReturn('my resized data');
$image->method('valid')->willReturn(true);
+ $image->method('dataMimeType')->willReturn('image/png');
$previewFile->expects($this->once())
->method('putContent')
@@ -362,6 +367,8 @@ class GeneratorTest extends \Test\TestCase {
$maxPreview = $this->createMock(ISimpleFile::class);
$maxPreview->method('getName')
->willReturn($maxX . '-' . $maxY . '-max.png');
+ $maxPreview->method('getMimeType')
+ ->willReturn('image/png');
$previewFolder->method('getDirectoryListing')
->willReturn([$maxPreview]);
@@ -382,6 +389,7 @@ class GeneratorTest extends \Test\TestCase {
$image->method('height')->willReturn($maxY);
$image->method('width')->willReturn($maxX);
$image->method('valid')->willReturn(true);
+ $image->method('dataMimeType')->willReturn('image/png');
$preview = $this->createMock(ISimpleFile::class);
$previewFolder->method('newFile')