From 80d7d867bd6a3d69064d5a47ef41200f6ebd170a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 29 Aug 2024 10:05:55 +0200 Subject: [PATCH] fix(tests): Fix ImageTest test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- tests/lib/ImageTest.php | 12 +++++++----- 1 file 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);