mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 14:23:17 -04:00
fix(tests): Fix ImageTest test
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue