[FOLLOWUP][BUGFIX] Check simplexml return type in ImageInfo 29/54829/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Tue, 28 Nov 2017 11:51:26 +0000 (12:51 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Tue, 28 Nov 2017 12:18:41 +0000 (13:18 +0100)
Fix unit test which fails on current master since last patch
set has been too long ago and no re-run was triggered after
subject class changed meanwhile.

Change-Id: Iade31ab04fff4a48bd87f3c0052a93ea54005109
Resolves: #79881
Releases: master
Reviewed-on: https://review.typo3.org/54829
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Tests/Unit/Type/File/ImageInfoTest.php

index 0a1af8a..b0eb7b0 100644 (file)
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Type\File;
 
 use org\bovigo\vfs\vfsStream;
 use TYPO3\CMS\Core\Imaging\GraphicalFunctions;
+use TYPO3\CMS\Core\Log\Logger;
 use TYPO3\CMS\Core\Type\File\ImageInfo;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
@@ -52,15 +53,14 @@ class ImageInfoTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
         ];
 
         $graphicalFunctionsProphecy = $this->prophesize(GraphicalFunctions::class);
+        $graphicalFunctionsProphecy->init()->shouldBeCalled();
         $graphicalFunctionsProphecy->imageMagickIdentify($root->url() . '/' . $testFile)->willReturn(null);
-
-        $imageInfoProphecy = $this->prophesize(ImageInfo::class)
-            ->willBeConstructedWith([$root->url() . '/' . $testFile]);
-        $imageInfoProphecy->getGraphicalFunctions()->willReturn($graphicalFunctionsProphecy->reveal());
-
         GeneralUtility::addInstance(GraphicalFunctions::class, $graphicalFunctionsProphecy->reveal());
 
+        $loggerProphecy = $this->prophesize(Logger::class);
+
         $imageInfo = new ImageInfo($root->url() . '/' . $testFile);
+        $imageInfo->setLogger($loggerProphecy->reveal());
 
         $this->assertEquals(0, $imageInfo->getWidth());
         $this->assertEquals(0, $imageInfo->getHeight());