[TASK] Make frontend/Tests/Unit/DataProcessing notice free 97/57897/4
authorChristian Kuhn <lolli@schwarzbu.ch>
Tue, 14 Aug 2018 17:35:08 +0000 (19:35 +0200)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Tue, 14 Aug 2018 18:02:38 +0000 (20:02 +0200)
Resolves: #85847
Releases: master
Change-Id: I2fee7a27c3cc5a06f6ef3298ddb1b75b766b2db7
Reviewed-on: https://review.typo3.org/57897
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
typo3/sysext/frontend/Classes/DataProcessing/GalleryProcessor.php
typo3/sysext/frontend/Tests/Unit/Processor/GalleryProcessorTest.php

index e4d830b..cbd26c7 100644 (file)
@@ -494,10 +494,10 @@ class GalleryProcessor implements DataProcessorInterface
                 $fileKey = (($row - 1) * $this->galleryData['count']['columns']) + $column - 1;
 
                 $this->galleryData['rows'][$row]['columns'][$column] = [
-                    'media' => $this->fileObjects[$fileKey],
+                    'media' => $this->fileObjects[$fileKey] ?? null,
                     'dimensions' => [
-                        'width' => $this->mediaDimensions[$fileKey]['width'],
-                        'height' => $this->mediaDimensions[$fileKey]['height']
+                        'width' => $this->mediaDimensions[$fileKey]['width'] ?? null,
+                        'height' => $this->mediaDimensions[$fileKey]['height'] ?? null
                     ]
                 ];
             }
index c854df8..56d7004 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types = 1);
 namespace TYPO3\CMS\Frontend\Tests\Unit\Processor;
 
 /*
@@ -17,18 +18,14 @@ use TYPO3\CMS\Core\Resource\FileReference;
 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
 use TYPO3\CMS\Frontend\ContentObject\Exception\ContentRenderingException;
 use TYPO3\CMS\Frontend\DataProcessing\GalleryProcessor;
+use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 
 /**
  * Tests for  GalleryProcessor
  */
-class GalleryProcessorTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
+class GalleryProcessorTest extends UnitTestCase
 {
     /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
-    /**
      * @var ContentObjectRenderer|\PHPUnit_Framework_MockObject_MockObject
      */
     protected $contentObjectRenderer;