aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-08-29 10:05:55 +0200
committerCôme Chilliet <91878298+come-nc@users.noreply.github.com>2024-08-29 17:06:32 +0200
commit80d7d867bd6a3d69064d5a47ef41200f6ebd170a (patch)
tree7551be5bc13c4e1dd8a6778ca5cc5683c4ee0290 /tests
parentb778f3de0a79602ac5054f9919e822c8ac8079a9 (diff)
downloadnextcloud-server-80d7d867bd6a3d69064d5a47ef41200f6ebd170a.tar.gz
nextcloud-server-80d7d867bd6a3d69064d5a47ef41200f6ebd170a.zip
fix(tests): Fix ImageTest test
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/ImageTest.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/lib/ImageTest.php b/tests/lib/ImageTest.php
index 1c46a59cd65..80cf22a9442 100644
--- a/tests/lib/ImageTest.php
+++ b/tests/lib/ImageTest.php
@@ -9,6 +9,7 @@ namespace Test;
use OC;
use OC\Image;
+use OCP\IAppConfig;
use OCP\IConfig;
class ImageTest extends \Test\TestCase {
@@ -137,16 +138,17 @@ class ImageTest extends \Test\TestCase {
$expected = ob_get_clean();
$this->assertEquals($expected, $img->data());
+ $appConfig = $this->createMock(IAppConfig::class);
+ $appConfig->expects($this->once())
+ ->method('getValueInt')
+ ->with('preview', 'jpeg_quality', 80)
+ ->willReturn(80);
$config = $this->createMock(IConfig::class);
$config->expects($this->once())
- ->method('getAppValue')
- ->with('preview', 'jpeg_quality', '80')
- ->willReturn(null);
- $config->expects($this->once())
->method('getSystemValueInt')
->with('preview_max_memory', 256)
->willReturn(256);
- $img = new Image(null, null, $config);
+ $img = new Image(null, $appConfig, $config);
$img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.jpg');
$raw = imagecreatefromstring(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg'));
imageinterlace($raw, true);