fix(tests): Fix ImageTest test

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/47535/head
Côme Chilliet 2024-08-29 10:05:55 +07:00 committed by Côme Chilliet
parent b778f3de0a
commit 80d7d867bd
1 changed files with 7 additions and 5 deletions

@ -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);