aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSimon L <szaimen@e.mail.de>2023-04-17 20:22:39 +0200
committerGitHub <noreply@github.com>2023-04-17 20:22:39 +0200
commit5cda8f0f45f1bc5261a08cf9014a3df11a5fd6a2 (patch)
treea7ca4a36e24a6f0b40c6b10431af623fb05dff76 /tests
parentd87cc208bbf3b9c3801196712fc9453aab955702 (diff)
parente542e60dbcb688d28f1335d20709555c0528e8cd (diff)
downloadnextcloud-server-5cda8f0f45f1bc5261a08cf9014a3df11a5fd6a2.tar.gz
nextcloud-server-5cda8f0f45f1bc5261a08cf9014a3df11a5fd6a2.zip
Merge pull request #35129 from Glandos/previewperf2
[Performance] Reuse preview directory listing
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Preview/GeneratorTest.php19
1 files changed, 7 insertions, 12 deletions
diff --git a/tests/lib/Preview/GeneratorTest.php b/tests/lib/Preview/GeneratorTest.php
index 1f6f43dce1e..37fc3935139 100644
--- a/tests/lib/Preview/GeneratorTest.php
+++ b/tests/lib/Preview/GeneratorTest.php
@@ -105,15 +105,12 @@ class GeneratorTest extends \Test\TestCase {
$maxPreview->method('getMimeType')
->willReturn('image/png');
- $previewFolder->method('getDirectoryListing')
- ->willReturn([$maxPreview]);
-
$previewFile = $this->createMock(ISimpleFile::class);
$previewFile->method('getSize')->willReturn(1000);
+ $previewFile->method('getName')->willReturn('256-256.png');
- $previewFolder->method('getFile')
- ->with($this->equalTo('256-256.png'))
- ->willReturn($previewFile);
+ $previewFolder->method('getDirectoryListing')
+ ->willReturn([$maxPreview, $previewFile]);
$this->legacyEventDispatcher->expects($this->once())
->method('dispatch')
@@ -344,14 +341,12 @@ class GeneratorTest extends \Test\TestCase {
$maxPreview->method('getMimeType')
->willReturn('image/png');
- $previewFolder->method('getDirectoryListing')
- ->willReturn([$maxPreview]);
-
$preview = $this->createMock(ISimpleFile::class);
$preview->method('getSize')->willReturn(1000);
- $previewFolder->method('getFile')
- ->with($this->equalTo('1024-512-crop.png'))
- ->willReturn($preview);
+ $preview->method('getName')->willReturn('1024-512-crop.png');
+
+ $previewFolder->method('getDirectoryListing')
+ ->willReturn([$maxPreview, $preview]);
$this->previewManager->expects($this->never())
->method('isMimeSupported');